AI-powered proactive memory assistant that learns from your WhatsApp conversations and reminds you about relevant events while browsing β built with Gemini 3 Flash Preview.
Argus monitors your WhatsApp conversations via Evolution API webhooks, extracts events and intent using Google Gemini AI, and delivers real-time popup overlays in your Chrome browser β at the right time and on the right page.
WhatsApp Message
β
βΌ
Evolution API (webhook: messages.upsert)
β
βΌ
Argus Server (Express + WebSocket)
βββ Gemini AI extracts events / detects actions
βββ SQLite + FTS5 stores & indexes events
βββ QuickSave compresses context (~40-55% fewer tokens)
βββ Scheduler manages time-based reminders
β
βΌ
Chrome Extension (Manifest V3)
βββ WebSocket receives real-time events
βββ Content script renders popup overlays
βββ URL watcher triggers context reminders
βββ DOM watcher detects form mismatches
| # | Scenario | What Happens |
|---|---|---|
| 1 | Goa Cashew | Friend texts "try cashews at Zantye's in Goa" β later you browse a Goa travel site β Argus popup: "Rahul recommended cashews at Zantye's" |
| 2 | Insurance Accuracy | You type "Honda Civic 2022" on ACKO β but your WhatsApp says you own a 2018 model β popup: "You might be overpaying!" + βοΈ Fix It button |
| 3 | Gift Intent | Chat says "need makeup for sis birthday" β you visit Nykaa β popup: "Your sister's birthday gift β makeup is on sale!" |
| 4 | Netflix Subscription | You said "cancel Netflix after this show" β you visit netflix.com β popup: "You planned to cancel this subscription" |
| 5 | Calendar Conflict | You told dinner group "see you Thursday" β then schedule a meeting Thursday β popup: "This conflicts with your dinner plan" |
git clone https://github.com/Akshat74747/argus-whatsapp-assistant
cd whatsapp-chat-rmd-argus/argus
cp .env.example .env # Fill in GEMINI_MODEL_KEY + Evolution API credentials
docker compose up -d # Starts 4 containers (builds everything from source)
docker compose logs -f argus # View Argus logsEverything is included β Evolution API source, QuickSave, and Argus are all in this repo. No extra downloads needed.
Pre-Requisites
cd argus
npm install
cp .env.example .env # Fill in GEMINI_MODEL_KEY + Evolution API credentialsStart the evolution api first, and then creeat an instance at http://localhost:8080/manager
cd evolution-api
npm run dev:serverOnce evolution api starts up, start argus
cd argus
npm run devOpen chrome extensions manager and load unpacked the extension folder at argus/extension
| Container | Port | Purpose |
|---|---|---|
argus-server |
3000 | Express + WebSocket + Gemini AI + SQLite |
argus-evolution |
8080 | Evolution API β WhatsApp Web bridge |
argus-postgres |
5432 | PostgreSQL β Evolution API database |
argus-redis |
6379 | Redis β Evolution API cache |
- Go to
chrome://extensions/ - Enable Developer mode (top right)
- Click Load unpacked β select
argus/extension/ - Pin the Argus extension to your toolbar
Argus auto-creates and configures the Evolution API instance on startup. Just scan the QR code:
# Open Evolution API manager
open http://localhost:8080/manager
# Or check Argus logs for connection status
docker compose logs -f argus | grep -i evolutionThe instance name defaults to arguas (configurable via EVOLUTION_INSTANCE_NAME in .env).
# You still need postgres + redis running for Evolution API
# Only Argus itself runs locally
cd argus
npm install
cp .env.example .env # Set GEMINI_API_KEY + EVOLUTION_* vars
npm run dev # Starts with tsx hot reload on port 3000
β οΈ NEVER restart the server manually β it auto-restarts on rebuild. Only runnpx tscto compile.
whatsapp-chat-rmd-argus/
βββ argus/ # Main application
β βββ src/
β β βββ server.ts # Express + WebSocket server, all API routes
β β βββ db.ts # SQLite + FTS5 β events, messages, contacts, triggers
β β βββ evolution-db.ts # PostgreSQL direct read β Evolution API messages
β β βββ gemini.ts # Gemini AI β extraction, action detection, popup blueprints, chat
β β βββ quicksave.ts # QuickSave CEP v9.1 β S2A filter + dense format compression
β β βββ ingestion.ts # Webhook β action detection β event extraction β triggers
β β βββ matcher.ts # URL keyword extraction + FTS5 search + Gemini validation
β β βββ scheduler.ts # Time-based reminders (24h, 1h, 15min) + snooze
β β βββ types.ts # Zod schemas β Message, Event, Webhook, Config, PopupType
β βββ extension/ # Chrome Extension (Manifest V3)
β β βββ manifest.json # Permissions: tabs, scripting, sidePanel, <all_urls>
β β βββ background.js # Service worker β WebSocket client, tab routing, context check
β β βββ content.js # Injected overlay β 8 popup types, toasts, DOM form watcher
β β βββ styles.css # Popup/modal CSS
β β βββ sidepanel.html/js # AI Chat sidebar with markdown rendering
β β βββ popup.html/js/css # Extension popup β event cards + stats
β β βββ icons/ # Extension icons (16/32/48/128px)
β βββ tests/ # Vitest β db.test.ts, ingestion.test.ts, matcher.test.ts
β βββ data/ # SQLite database (events.db, auto-created)
β βββ docker-compose.yml # 4-container stack
β βββ Dockerfile # Multi-stage Node 22 Alpine build
β βββ .env.example # All config with defaults & comments
β βββ tsconfig.json
β βββ CHANGELOG.md # Full version history
β βββ package.json # ESM, Node 22+, Express 5
βββ evolution-api/ # WhatsApp API (forked, built from source)
β βββ Dockerfile # Multi-stage Node 24 Alpine
β βββ src/ # Evolution API source (Baileys-based)
βββ quicksave/ # QuickSave CEP v9.1 reference (read-only)
β βββ SKILL.md # Full protocol specification
β βββ references/ # PDL, S2A, NCL, KANJI docs
βββ Insurance website/ # Demo ACKO clone for insurance mismatch scenario
βββ aidata/ # Project context docs (read-only)
βββ RULES.md # Development rules & constraints
βββ INFO.md # Architecture documentation
βββ README.md # This file
Argus uses SQLite (better-sqlite3, synchronous API) as its sole database. All tables and FTS5 virtual tables are created automatically on startup.
| Table | Purpose |
|---|---|
events |
Events/tasks/reminders extracted from WhatsApp |
messages |
Raw WhatsApp messages (source of truth) |
triggers |
Time and URL-based notification triggers |
contacts |
Contact list with message counts |
context_dismissals |
Per-URL dismissal suppression (30-minute window) |
push_subscriptions |
Browser push subscription tokens |
events_fts |
FTS5 virtual table over events (title, keywords, description) |
/api/context-check and /api/internal/search use ftsSearchEvents() which runs a SQLite FTS5 MATCH query across title, keywords, and description. Results are ranked by BM25 relevance.
All popups are generated server-side by Gemini AI β the extension just renders whatever the server sends.
| Type | Icon | Trigger |
|---|---|---|
event_discovery |
π | New event extracted from WhatsApp message |
event_reminder |
β° | Scheduled time arrives (24h / 1h / 15min before) |
context_reminder |
π― | User visits a URL matching an event's context |
conflict_warning |
ποΈ | Two events overlap in time (Β±60 min window) |
insight_card |
π‘ | AI suggestion from conversation patterns |
snooze_reminder |
π€ | Snoozed event fires again after delay |
update_confirm |
π | WhatsApp message modifies an existing event β needs approval |
form_mismatch |
DOM form field contradicts WhatsApp memory (insurance scenario) |
βββ snoozed βββ
β β
discovered β scheduled β reminded β completed
β β
βββ ignored expired
- discovered β new event, waiting for user action
- scheduled β user approved, reminders set at 24h / 1h / 15min
- snoozed β postponed for N minutes
- reminded β reminder was shown
- completed β user marked done
- ignored β hidden, won't remind again
- expired β event time has passed
- dismissed β notification dismissed (can reappear on context trigger)
When a WhatsApp message references an existing event, Gemini detects the action:
| Action | Example Message | What Happens |
|---|---|---|
cancel / delete |
"cancel the dinner plan" | Event deleted |
complete |
"done with the cashews order" | Event marked complete |
ignore |
"skip the meeting" | Event hidden |
snooze / postpone |
"push the meeting to next week" | Event snoozed |
modify |
"change dinner to Friday 9pm" | Confirmation popup shown |
| Category | How It Works |
|---|---|
| Subscriptions | "cancel netflix" β context_url=netflix β popup on netflix.com |
| Travel | "cashews at Zantye's in Goa" β context_url=goa β popup on Goa travel sites |
| Shopping/Gifts | Beauty β nykaa, Fashion β myntra, General β amazon URL triggers |
| Insurance | DOM form watcher parses car make/model/year, cross-references with chat memory |
| Calendar | Time conflicts detected within Β±60 min window |
- Single Gemini call per message β classifies + extracts in one shot
- Handles Hinglish (Hindi + English), typos, informal chat
- Aggressive spam filter: price mentions, forwarded deals, brand accounts β low confidence
- Date resolution: relative dates ("kal", "Thursday", "next week") β absolute timestamps
- Event CRUD: Gemini detects if message creates, updates, or merges with existing events
- Context window: last 5 messages from same chat included for conversation continuity
All Gemini prompts use QuickSave-inspired compression:
- S2A Filter β ranks events by signal (time proximity, status, recency) β top 60 sent
- Dense Format β
#ID|TYPE|STATUS|"Title"|time|loc|sender|keywords(~40-55% fewer tokens) - L2 Edge Detection β cross-event relationships (cancelβsubscription, time conflicts, topic overlap)
- Chat Memory β older sidebar turns compressed into key facts, recent 6 turns stay raw
- Same token budget carries ~2x more event information
- Detects insurance-like pages (ACKO, PolicyBazaar, Digit, etc.)
MutationObserverwatches for dynamically added form inputsinputevent listeners with 1.5s debounce on all text fields- Regex parser extracts car make/model/year from input values
- Calls
/api/form-checkβ cross-references with WhatsApp chat memory - "βοΈ Fix It" button auto-fills the correct value + green highlight
Sidebar built into the Chrome extension, powered by Gemini AI with full access to your WhatsApp memory.
- Click the Argus extension icon in your Chrome toolbar
- Click "Open AI Chat" β or right-click the icon and select "Open side panel"
- The sidebar docks to the right side of any browser tab
The chat is context-aware β it knows your events, tasks, and WhatsApp history.
| Example Query | What It Does |
|---|---|
What do I have today? |
Lists all events scheduled for today |
Show all my events this week |
Weekly overview with dates and times |
Any pending tasks? |
Shows events in discovered or scheduled state |
What subscriptions should I cancel? |
Surfaces cancellation intents from your chats |
Any gift ideas from my chats? |
Extracts gift recommendations mentioned by contacts |
Show all recommendations from friends |
Lists all recommendation type events |
Six one-tap shortcuts appear at the top of the sidebar β tap any to instantly query without typing.
When the AI finds relevant events, it renders them as interactive cards directly in the chat:
- β Done β mark the event as complete
- π€ Snooze β snooze for 30 minutes
- ποΈ β delete the event permanently
The sidebar maintains the last 10 turns of conversation history per session. Older turns are compressed into key facts to stay within the Gemini context window (QuickSave CEP v9.1).
AI responses render bold, italic, inline code, and bullet lists inline β no plain text dump.
A dot in the header shows server status β green when connected to localhost:3000, yellow when unreachable. The panel polls every 30 seconds and reconnects
automatically.
| Endpoint | Method | Purpose |
|---|---|---|
/api/health |
GET | Health check (DB, Evolution API, model info) |
/api/stats |
GET | Message/event/contact statistics |
/api/events |
GET | List events (filter by ?status=discovered) |
/api/events/:id |
PATCH | Update event fields (title, time, location, etc.) |
/api/events/:id |
DELETE | Delete event permanently |
/api/events/:id/set-reminder |
POST | Schedule event (discovered β scheduled) |
/api/events/:id/snooze |
POST | Snooze event for N minutes |
/api/events/:id/ignore |
POST | Ignore event (hide, won't remind) |
/api/events/:id/complete |
POST | Mark event as done |
/api/events/:id/dismiss |
POST | Dismiss notification (can reappear) |
/api/events/:id/acknowledge |
POST | Acknowledge a reminder |
/api/events/:id/confirm-update |
POST | Confirm a pending modify action |
/api/events/day/:timestamp |
GET | Get all events for a specific day |
/api/webhook/whatsapp |
POST | Evolution API webhook receiver |
/api/context-check |
POST | Check URL for matching events |
/api/extract-context |
POST | Extract keywords from URL |
/api/form-check |
POST | Check form field vs WhatsApp memory |
/api/chat |
POST | AI Chat β context-aware conversation |
/ws |
WS | Real-time event notifications |
{
"event": "messages.upsert",
"instance": "arguas",
"data": {
"key": {
"remoteJid": "919876543210@s.whatsapp.net",
"fromMe": false,
"id": "3EB0ABC123..."
},
"pushName": "Rahul",
"message": {
"conversation": "Let's meet tomorrow at 5pm at Starbucks"
},
"messageTimestamp": 1739097600
}
}Only messages.upsert events are processed. All other events (messages.update, connection.update, etc.) are acknowledged but skipped.
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Runtime | Node.js | 22.x | ESM JavaScript runtime |
| Language | TypeScript | 5.7.x | Type-safe development |
| Web Server | Express.js | 5.x | HTTP + WebSocket server |
| Database | SQLite (better-sqlite3) | 11.x | Event/message storage + FTS5 search |
| AI | Gemini 3 Flash Preview | Latest | Event extraction, popups, chat |
| Evolution API | v2.3.7 | WhatsApp Web bridge (Baileys) | |
| Evolution DB | PostgreSQL | 16 | Evolution API storage (direct read) |
| Cache | Redis | 7 | Evolution API cache |
| Validation | Zod | 3.24.x | Runtime schema validation |
| Real-time | ws | 8.x | WebSocket server |
| Browser | Chrome Extension | Manifest V3 | Popups, URL detection, form watching |
| Compression | QuickSave CEP | v9.1 | S2A + dense format for Gemini prompts |
| Testing | Vitest | 2.x | Fast unit tests (<3s) |
| Containers | Docker Compose | β | 4-service stack |
| β | Why |
|---|---|
| FAISS / vector stores | FTS5 + Gemini validation is sufficient (90%+ accuracy) |
| OpenAI / embeddings | Gemini handles everything β extraction, validation, chat |
| RAG pipelines | Two-step FTS5 β Gemini replaces traditional RAG |
| Multi-stage LLM calls | Single Gemini call per message (classify + extract) |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Docker Compose Network β
β β
β ββββββββββββββββ ββββββββββββββββββββ β
β β postgres β β redis β β
β β :5432 β β :6379 β β
β ββββββββ¬ββββββββ ββββββββββ¬ββββββββββ β
β β β β
β βΌ βΌ β
β ββββββββββββββββββββββββββββββββββββββββ β
β β evolution-api :8080 β βββ WhatsApp QR β
β β WhatsApp Bridge (Baileys/Node 24) β β
β ββββββββββββββββ¬ββββββββββββββββββββββββ β
β β webhook POST + direct PG read β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββ β
β β argus :3000 β βββ Chrome Ext (WS) β
β β Express + WebSocket + Gemini AI β β
β β SQLite + FTS5 (internal volume) β β
β ββββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cd argus
docker compose up -d --build # Build & start all 4 containers
docker compose ps # Check status
docker compose logs -f argus # Argus logs
docker compose logs -f evolution-api # Evolution logs
docker compose down # Stop
docker compose down -v # Stop + delete all data
docker compose build argus # Rebuild Argus only
docker compose up -d argus # Restart Argus onlyAll config is in .env (copy from .env.example). Only GEMINI_API_KEY is required β everything else has sensible defaults.
| Variable | Default | Required | Description |
|---|---|---|---|
GEMINI_API_KEY |
β | β | Google AI Studio API key |
GEMINI_MODEL |
gemini-3-flash-preview |
β | Gemini model ID |
EVOLUTION_API_KEY |
rmd_evolution_api_key_12345 |
β | Evolution API auth key |
EVOLUTION_INSTANCE_NAME |
arguas |
β | WhatsApp instance name |
HOT_WINDOW_DAYS |
90 |
β | Context matching window (days) |
PROCESS_OWN_MESSAGES |
true |
β | Process your own sent messages |
SKIP_GROUP_MESSAGES |
false |
β | Skip group chat messages |
POSTGRES_PASSWORD |
postgres |
β | PostgreSQL password |
TIMEZONE |
Asia/Kolkata |
β | Server timezone |
| Metric | Target | Notes |
|---|---|---|
| Message ingestion | <500ms | Single Gemini call (classify + extract) |
| Context check | <800ms | FTS5 query <10ms + Gemini validation ~800ms |
| Database query | <10ms | SQLite FTS5 on 50k+ messages |
| Memory usage | <200MB | SQLite + Node runtime per container |
| WebSocket latency | <50ms | Event β browser overlay |
| Form mismatch check | <100ms | Regex parse + SQLite keyword search |
| Gemini cost/message | ~$0.0001 | Flash Preview pricing |
| Gemini cost/context check | ~$0.0003 | 10 candidates validated |
| QuickSave compression | ~2x density | 40-55% fewer tokens per prompt |
cd argus
npm run dev # Start with tsx hot reload
npm test # Fast tests (~2s, Vitest)
npm run build # Compile TypeScript (npx tsc)
npm run typecheck # Type check only (no emit)
npm run lint # ESLint with cache
npm run lint:fix # Auto-fix lint issues
npm run format # Prettier formatting
npm run db:reset # Delete SQLite DB + restart- Evolution API β WhatsApp Web integration
- Google Gemini β AI extraction, popups, chat
- SQLite FTS5 β Full-text search engine
- QuickSave CEP v9.1 β Context compression protocol by Kevin Tan (ktg.one)
- Chrome Extension Manifest V3 β Browser integration