A full-featured WhatsApp AI assistant powered by Google Gemini for complex tasks, Groq (Llama 3.3 70B) for fast simple conversations, and Claude AI for investment analysis. Supports stock analysis, image generation, file creation, reminders, scheduling, Google Maps, and more.
Run headless on a VPS or manage via the Bot Manager macOS desktop app.
Made with β by Lewi Verdatama
- Simple chat (greetings, Q&A, chitchat) β Groq Llama 3.3 70B (free, fast, ~14,400 req/day)
- Complex tasks (files, images, maps, analysis, reminders) β Google Gemini 2.5 Flash
- Automatic fallback: if Groq is unavailable, everything goes to Gemini seamlessly
- Primary: Pollinations AI β free, no rate limits with API key
Models:
flux,flux-2-dev,imagen-4,seedream - Fallback: Google Imagen 3 β free tier with Gemini API key rotation
Generate and send files directly in WhatsApp:
- π Excel spreadsheets (
.xlsx) - π PDF documents
- π½οΈ PowerPoint presentations (
.pptx) - π CSV, TXT, HTML, JSON, and code files
- Natural language scheduling: "Remind me at 7 AM to take medicine"
- Supports relative time: "in 30 minutes", "tomorrow 9 AM"
- Timezone-aware (configurable, defaults to
Asia/Jakarta)
- Send messages to other contacts: "Send +Novita good morning"
- Contact resolution: saved shortcodes β contact names β phone numbers
- Location search and Google Maps link sharing
- Google Calendar event creation from natural language
- Analyze images, PDFs, and documents sent by users
- Extract text, summarize content, answer questions about files
- QR Code scanning (primary) β scannable directly in the Bot Manager app
- Phone number pairing code (automatic fallback after 3 QR failures)
- Auto-reconnect with exponential backoff
- Simulated read delays and typing indicators
- Configurable typing speed (WPM) and response timing
/gm analyze AAPLβ Gemini-powered stock analysis (free)/cl analyze BBRI.JKβ Claude-powered stock analysis (paid, shows credit used)- Fundamental data via FMP API β P/E, P/B, ROE, margins, D/E, FCF, EPS, beta
- Technical analysis via Yahoo Finance β RSI, SMA20/50, support/resistance levels
- π΅οΈ Bandarmology β Volume-based smart money tracking:
- OBV trend (accumulation vs distribution)
- Whale activity detection (π >2x avg volume)
- Smart money signals (π’ ACC, π΄ DIST, π΅οΈ STEALTH, π€ DRY-UP)
- 7-day Bandar Score (net acc/dist)
- Scalping specialization β entry zones, momentum, volume profile
- Trading plans β entry, stop-loss, TP1, TP2, position sizing
- Buy/Hold/Sell signals with confidence percentage
- π³ Claude credit tracking β shows cost per analysis + remaining balance
- US stocks + IDX stocks (BBRI.JK, BBCA.JK, TLKM.JK...)
A polished Electron app for managing the bot remotely via SSH β no terminal required.
| Panel | What it does |
|---|---|
| VPS Connection | Configure SSH credentials, test connection, restart bot |
| Bot Persona | Edit character prompt, bot name, timezone |
| API Keys | Manage Gemini / Groq / Pollinations keys |
| Saved Contacts | Add/remove contact shortcuts |
| Bot Keywords | Group trigger word, auto-reply toggle |
| Human Behavior | Typing speed, read delay, burst pause |
| Group Behavior | Mention-only mode, allowed/blocked group JIDs |
| π± WhatsApp Number | Change linked number + in-app QR scanner |
| Backup | VPS backup, download to Mac (dir picker), Google Drive upload |
| Import Settings | Import from VPS or XML file; export to XML |
| Live Logs | Real-time journal tail |
| Bot Status | Visual health dashboard |
- π Investment Manager:
/cland/gmprefix commands for AI-powered stock analysis - π΅οΈ Bandarmology: Volume-based smart money tracking (OBV, whale, Bandar Score)
- π³ Claude credit tracking: Shows cost per analysis + remaining balance
- π§ Anthropic API Key: New field in API Keys panel for Claude
/clanalysis - π FMP API Key: New field for Financial Modeling Prep fundamentals
- Yahoo Finance chart API (no crumb, works from EU VPS)
- Scalping analysis, trading plans, buy/hold/sell signals
- πΎ Local persistence: All settings auto-saved and restored on app restart
- πΌοΈ Image generation fix:
[IMAGE_GEN:]tag handler - π₯ Group filter fix: Trigger word must be at start of message
- π Fix: Startup crash
SyntaxError: Identifier 'fs' has already been declared - π± WhatsApp Number panel: Change linked account without SSH
- π· In-app QR scanner: QR renders directly in app with auto-refresh
- π Settings survive upgrades: Mirrored to
~/.bot-manager-settings.jsonoutside the app sandbox; auto-restored on next launch after reinstall - πΎ Download backup to Mac: SFTP download with native directory picker, saves chosen path for future use
- π XML export/import: Export all settings (VPS creds, API keys, persona, contacts, behavior, Google Drive creds) to
.xml; import from file to restore without needing VPS access - ποΈ Import tabs: "Import from VPS" | "Import from File" tab UI
- π Visual Bot Status dashboard: Hero status card with pulsing dot, 6 metric cards, animated RAM progress bar, color-coded log tail
- βοΈ Google Drive backup: Full OAuth2 flow, folder name/ID resolution, SFTP β Drive pipeline
- π Fix:
SyntaxErrorwhen saving personas with special characters β fixed with Base64 encoding daemon-reloadwarning filtered from log tail
- Initial release
| Platform | File |
|---|---|
| Apple Silicon (M1βM4) | Bot Manager-1.3.0-arm64.dmg |
| Intel Mac | Bot Manager-1.3.0-x64.dmg |
Upgrading from v1.1.x? Your settings now auto-restore. As a safeguard, use Import β Export Settings as XML before upgrading to keep a local backup.
Incoming Message
β
ββ /cl or /gm prefix? ββββββββββββββββββββββββββββββββΊ InvestorService
β /cl β Claude AI analysis (Yahoo Finance data)
β /gm β Gemini analysis
β
ββ Has media (image/PDF/file)? βββββββββββββββββββββββΊ Gemini (multimodal)
β
ββ Complex intent keyword detected? ββββββββββββββββββΊ Gemini
β
ββ Short/simple text? ββββββββββββββββββββββββββββββββΊ Groq (Llama 3.3 70B)
β
Groq fails? βββ
ββββΊ Gemini
See INSTALL.md for full setup instructions.
- Node.js 18+
- Google Gemini API key(s) β free at aistudio.google.com
- Groq API key (optional, free at console.groq.com)
- Pollinations API key (optional, free at enter.pollinations.ai)
- Claude API key (optional, for
/clinvestment analysis β console.anthropic.com) - FMP API key (optional, for stock fundamentals β financialmodelingprep.com)
git clone https://github.com/leoui/gemini-whatsapp-bot.git
cd gemini-whatsapp-bot
npm install
cp .env.example .env
nano .env # Add your API keys
node server.js # QR code appears in terminal| Variable | Required | Description |
|---|---|---|
GEMINI_API_KEY |
β | Comma-separated keys for rotation |
GROQ_API_KEY |
Optional | Free simple-chat routing |
POLLINATIONS_API_KEY |
Optional | Image generation |
CLAUDE_API_KEY |
Optional | /cl investment analysis (Claude AI) |
FMP_API_KEY |
Optional | Stock fundamentals (P/E, ROE, margins) |
WHATSAPP_PHONE_NUMBER |
Optional | Pairing code fallback |
TZ |
Optional | Timezone (default: Asia/Jakarta) |
GEMINI_API_KEY=key1,key2,key3 # Each free key β 500 req/day
- Open Bot Manager β WhatsApp Number
- Click Change WhatsApp Number
- Scan QR code that appears directly in the app
Run node server.js β scan QR in terminal with WhatsApp β Linked Devices β Link a Device.
| Request | AI | Result |
|---|---|---|
| "Hello!" | Groq | Greeting reply |
| "Create an Excel of top 10 countries" | Gemini | .xlsx sent |
| "Generate image of a sunset" | Gemini | Image sent |
| "Remind me at 7 AM to exercise" | Gemini | Reminder set |
| "Where is the Eiffel Tower?" | Gemini | Maps link |
/gm analyze AAPL |
Gemini | Stock analysis + trading plan |
/cl analyze BBRI.JK |
Claude | IDX stock analysis + scalping plan |
/gm is NVDA undervalued? |
Gemini | Valuation assessment |
| Component | Library |
|---|---|
Baileys ^6.7.17 |
|
| Gemini AI | @google/genai ^0.9.0 |
| Claude AI | Anthropic API (/v1/messages) |
| Groq AI | groq-sdk ^0.9.0 |
| Stock Data | Yahoo Finance chart API + FMP API |
| Desktop App | Electron 33 + Electron Builder |
| Excel | exceljs Β· PDF: pdfkit Β· PPTX: pptxgenjs |
MIT License β see LICENSE.
Not affiliated with WhatsApp or Meta. Use responsibly per WhatsApp's Terms of Service.