Skip to content
EchoOfCodePublic

About

ARGUS - Automated Recognition of Gatherings, Updates & Scheduling

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

ARGUS

Autonomous Real-time General Utility System

A self-hosted personal AI executive assistant, second brain & communication hub inside WhatsApp.

License: MIT CI FastAPI TypeScript Baileys Groq Docker

Overview β€’ Honest Risks β€’ Architecture β€’ Quickstart β€’ Configuration β€’ Command Cheatsheet β€’ Troubleshooting


🌟 Overview

ARGUS is an executive personal AI assistant that lives inside your own WhatsApp account. Designed as a self-hosted "second brain" and digital Chief of Staff, ARGUS reads your incoming chats, prioritizes emails, manages reminders, schedules events, tracks shared expenses, and transcribes voice notes.

What ARGUS Does

  • ⚑ System 1 Zero-Token Engine: Sub-5ms deterministic local execution for tasks, reminders, ledger records, status, and acknowledgments using 0 cloud tokens.
  • πŸ“΄ Offline Mode Guard: Toggle full offline execution (/offline) running purely on local SQLite storage with zero external cloud calls.
  • πŸ”€ Multi-Model AI Router: Dynamically routes between Groq (low-latency reasoning) and Google Gemini (deep code, long context, and analysis) with automatic intra-model and cross-provider failover.
  • 🧠 Second Brain: Automatically stores, categorizes, and recalls personal notes, facts, and preferences.
  • πŸ›‘οΈ Outbound Policy Engine & Autopilot (ADR 0003): 3-tiered autonomy (Draft Only, Supervised, Autonomous) restricted exclusively to 1-on-1 DMs with human approval queues and emergency bulk killswitches (/autopilot off for all).
  • πŸ’¬ Group Catch-up: Generates structured 3-tier summaries (Key Points, Links, Action Items) for active chats.
  • πŸ“¬ Email Triage (IMAP): Checks unread inbox messages and performs executive deep-dive breakdowns.
  • πŸ“… Calendar Scheduling: Generates 1-tap Google Calendar links from natural language or document dates.
  • πŸŽ™οΈ Voice Note Transcription: Transcribes WhatsApp voice memos using Groq Whisper.
  • πŸ’Έ Expense Ledger: Tracks shared expenses, debts, and balances via conversational commands.
  • πŸ“€ Message Drafter: Drafts polished messages for contacts and routes them through approval workflows.

⚠️ Honest Risks & Limitations

Before running ARGUS, understand the actual architecture and trade-offs:

  1. Unofficial WhatsApp Client: ARGUS uses @whiskeysockets/baileys, an unofficial WhatsApp Web reverse-engineered client. Using unofficial clients carries a potential risk of account suspension or ban by WhatsApp. ARGUS incorporates human-like typing delays, but use is entirely at your own risk.
  2. Cloud AI Inference: ARGUS is self-hosted, but it is not zero-cloud. Conversation snippets, email excerpts, and audio notes are sent over TLS to cloud inference APIs (Groq Cloud by default, or OpenAI/OpenRouter if configured).
  3. Prompt Injection Risk: When ARGUS processes messages from other contacts or group chats, external text reaches the model prompt. Never allow untrusted contacts to trigger sensitive tools without human oversight.
  4. Credential Security: Plaintext passwords, API keys, and sensitive financial secrets should never be saved in memory commands (remember ...). Memory vaults are indexed and retrieved directly by the LLM.
  5. Multi-Writer Concurrency: Both the Node.js bridge and Python brain interact with local SQLite databases. SQLite Write-Ahead Logging (WAL) is enabled to handle concurrent reads.

πŸ›οΈ Architecture

For the complete technical specification, data schemas, and design decisions, see docs/ARCHITECTURE.md.

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚          WhatsApp User Interface        β”‚
                     β”‚   (Self-Chat / Dedicated ARGUS Group)   β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚  Baileys (WebSockets)
                                          β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚          ARGUS WhatsApp Bridge          β”‚
                     β”‚       (apps/bridge: Node.js 20+)        β”‚
                     β”‚    Single Sender Policy Choke Point     β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚  HTTP + HMAC Signed Body (ADR 0001)
                                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              ARGUS AI BRAIN (FastAPI)                                  β”‚
β”‚   β€’ Central SQLite Writer (WAL)              β€’ ReAct Agent Tool Execution              β”‚
β”‚   β€’ Outbound Policy Engine (ADR 0003)        β€’ Encrypted Fernet Vault (AES-128)        β”‚
β”‚   β€’ Context Isolation Boundary               β€’ Native AG-UI Server-Sent Events Stream  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚ Single-Writer SQLite             β”‚ AG-UI SSE + REST (Key Auth)
                                  β–Ό                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              PERSISTENCE STORE                   β”‚ β”‚        ARGUS WEB CONTROL PLANE    β”‚
β”‚  β€’ argus.db (Single DB Owner)                    β”‚ β”‚       (apps/web: Next.js 14+)     β”‚
β”‚    - outbound_audit_log (Append-Only)            β”‚ β”‚   β€’ Real-Time Chat (AG-UI SSE)    β”‚
β”‚    - pending_approvals (Human-in-Loop)           β”‚ β”‚   β€’ Approvals Inbox (Approve/Edit)β”‚
β”‚    - message_log / chat_directory / expenses     β”‚ β”‚   β€’ Contacts & Autonomy (Tiers)   β”‚
β”‚  β€’ argus_memory.db (Second Brain Facts)          β”‚ β”‚   β€’ Second Brain (Zero Credentialsβ”‚
β”‚  β€’ argus_vault.db (Encrypted Credentials)        β”‚ β”‚   β€’ Ledger & System Status        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                                       β”‚ Host Loopback Only
                                                                       β–Ό
                                                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                     β”‚    CADDY REVERSE PROXY (Localhost)β”‚
                                                     β”‚    http://127.0.0.1:3000          β”‚
                                                     β”‚ (Tailscale / VPN for Remote Access)β”‚
                                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ–₯️ ARGUS Web Control Plane (apps/web)

Starting in Phase 3, ARGUS features a modern, single-owner web application built with Next.js (App Router), TypeScript, and Tailwind CSS behind a local Caddy reverse proxy at http://127.0.0.1:3000.

Key Screens & Capabilities:

  1. Chat (/chat): Real-time agent conversations powered by native AG-UI Server-Sent Events (SSE), with dynamic tool invocation cards (list_contacts, web_search, record_expense) and generation stop/cancellation.
  2. Approvals Inbox (/approvals): Human-in-the-loop review queue for assistant-generated outbound drafts. Every draft can be Approved, Edited & Approved, or Declined, automatically writing to the tamper-proof SQLite audit trail.
  3. Contacts & Autonomy (/contacts): Granular per-contact autonomy tiers (Tier 0: Draft Only, Tier 1: Supervised 15-minute token, Tier 2: Autonomous with 8-second undo delay) and a prominent Global Emergency Kill Switch.
  4. Second Brain Memory (/memory): Personal knowledge base and fact repository with Guaranteed Zero-Credential Exposure (sensitive credentials and vault entries are fundamentally excluded from the UI).
  5. Financial Ledger (/ledger): Aggregated personal expenses, debt balances ("Who Owes Whom"), category breakdown, and recent transaction records.
  6. Activity Log (/activity): Real-time chronological audit trail of outbound policy engine decisions and WhatsApp message logs.
  7. System Status (/status): Live WhatsApp bridge link status, QR code display for initial device pairing, AI brain health, and database inventory metrics.

Security & Remote Access:

  • Single-Owner Authentication: Every page and API route requires authentication with ARGUS_WEB_ACCESS_KEY (or ARGUS_SECRET), protected by constant-time comparison, an httpOnly secure session cookie, and IP rate limiting (max 5 failed attempts per 5 minutes).
  • Host Loopback by Default: Bound strictly to 127.0.0.1:3000. Never expose port 3000 or 8000 directly to the public internet.
  • Secure Remote Access: To access the ARGUS Web Control Plane remotely from a phone or laptop, connect via Tailscale (tailscale serve / MagicDNS) or an authenticated WireGuard/VPN tunnel.

πŸš€ Quickstart (Docker First)

Running with Docker is the recommended production deployment. Containers run unprivileged as non-root users with isolated network boundaries.

Prerequisites

  • Docker Engine 24+ and Docker Compose v2+
  • A free Groq API Key (console.groq.com)
  • (Optional) A Gmail App Password for email triage

Step 1: Clone Repository & Configure Environment

git clone https://github.com/EchoOfCode/ARGUS.git
cd ARGUS

Generate a secure 32-byte shared secret:

# On Linux / macOS:
openssl rand -hex 32

# On Windows PowerShell:
python -c "import secrets; print(secrets.token_hex(32))"

Initialize environment files:

cp apps/brain/.env.example apps/brain/.env
cp apps/bridge/.env.example apps/bridge/.env

Edit both .env files:

  • Set ARGUS_SECRET to the generated 32-byte hexadecimal string in both .env files.
  • In apps/brain/.env, add your GROQ_API_KEY.
  • In apps/bridge/.env, set MY_JID to your WhatsApp phone number formatted as 919876543210@s.whatsapp.net.

Step 2: Start Containers

# Build and start background containers
docker compose up --build -d

Security Note: In production, the brain container does not publish port 8000 to the host network. All bridge-to-brain traffic occurs over the private internal Docker network.


Step 3: Link WhatsApp via QR Code

Display the container logs to view the WhatsApp Web QR code:

docker compose logs -f argus-bridge
  1. Open WhatsApp on your phone.
  2. Go to Settings β†’ Linked Devices β†’ Link a Device.
  3. Scan the terminal QR code.
  4. Create a WhatsApp group named ARGUS (or text your own number in self-chat).
  5. Send help to begin!

Local Development Alternative (Without Docker)

If you prefer running directly on your host machine:

1. Setup Dependencies

make setup
# OR on Windows:
.\scripts\setup.bat

2. Start Services

make dev
# OR on Windows:
.\scripts\start.bat
  • Brain runs at http://127.0.0.1:8000 (Web Cockpit available at /dashboard).
  • Bridge logs into WhatsApp and displays the terminal QR code.

βš™οΈ Configuration Reference

Brain (apps/brain/.env)

Variable Required Default Description
ARGUS_SECRET Yes β€” HMAC shared secret (min 32 chars, cannot be placeholder).
LLM_PROVIDER No groq Inference backend: router (dynamic Groq/Gemini routing), groq, gemini, ollama, mock.
GROQ_API_KEY Yes β€” API key from Groq Cloud Console.
GROQ_MODEL No llama-3.3-70b-versatile Primary reasoning model (qwen/qwen3.8-27b supported).
GROQ_FALLBACK_MODEL No openai/gpt-oss-20b Intra-provider fallback model when primary hits rate limits.
GEMINI_API_KEY No β€” Google Gemini API key for coding, deep analysis, and failover.
GEMINI_MODEL No gemini-flash-lite-latest Model used for complex reasoning, code, and long queries.
EMAIL_USER No β€” Gmail address for IMAP inbox triage.
EMAIL_PASS No β€” Gmail 16-character App Password.
HOST No 127.0.0.1 Local bind address (bound to localhost for security).
PORT No 8000 Port for the FastAPI ASGI server.

Bridge (apps/bridge/.env)

Variable Required Default Description
MY_JID Yes β€” Owner WhatsApp JID (e.g. 919876543210@s.whatsapp.net).
ARGUS_SECRET Yes β€” Must match ARGUS_SECRET in brain configuration.
AI_BRAIN_URL No http://127.0.0.1:8000 URL for brain service (http://argus-brain:8000 in Docker).
LISTEN_MODE No all all to ingest all chats, or allowlist for restricted chats.
ALLOWED_JIDS No β€” Comma-separated list of allowed JIDs when in allowlist mode.
SEND_DELAY_MS No 1500 Natural typing delay between outgoing messages.
DEDICATED_GROUP_NAME No ARGUS WhatsApp group name for dedicated command channel.

πŸ“– Command Cheatsheet

(All examples use synthetic demonstration data)

Category Example Command / Slash Command What ARGUS Does Token Cost
⚑ System 1 & Modes /offline or offline mode Enables strict offline mode (runs 100% locally on PC; pauses cloud AI). 0 tokens
/online or online mode Re-enables Cloud AI reasoning alongside local fast-path. 0 tokens
/mode Displays current active operating mode (Online vs Offline). 0 tokens
/status or /s Instant telemetry: health, pending tasks/reminders, killswitch state. 0 tokens
clean up / reset Wipes active conversational working buffer and refreshes state. 0 tokens
πŸ“ Tasks & Todos /todo or todos Lists pending tasks with IDs. 0 tokens
add buy milk or /todo add buy milk Creates a new task in SQLite. 0 tokens
done #1 or complete buy milk Marks task #1 completed. 0 tokens
delete #1 Deletes task #1. 0 tokens
⏰ Reminders remind me in 45 minutes to submit report Schedules reminder using local NLP time parser. 0 tokens
remind me tomorrow morning to call doctor Schedules reminder for tomorrow morning (10:00 AM). 0 tokens
/reminders Displays all upcoming scheduled reminders. 0 tokens
cancel reminder #2 Cancels scheduled reminder #2. 0 tokens
πŸ’Έ Financial Ledger spent 50 on coffee Logs expense of β‚Ή50 under "coffee" category. 0 tokens
paid 450 for lunch with Alex Logs shared expense with contact. 0 tokens
/ledger or expenses / debts Aggregates monthly spend, all-time total, and unsettled debts. 0 tokens
πŸ€– Autopilot & Outbound /autopilot on Alex Enables auto-replies for contact in 1-on-1 DM (never in groups). Cloud AI
/autopilot off Alex Disables auto-replies for contact. 0 tokens
/autopilot off for all Bulk Emergency Killswitch: Disables auto-reply for all contacts. 0 tokens
/killswitch on / /killswitch off Global master silence switch (pauses all outgoing actions). 0 tokens
/approve 4 / /reject 4 Approves or discards queued outbound draft #4. 0 tokens
🧠 Second Brain remember office parking spot is B-12 Categorizes and stores note into memory vault. Cloud AI
where is my parking spot? Synthesizes instant answer from memory vault. Cloud AI
memories Displays categorized knowledge graph. Cloud AI
forget parking Deletes outdated memory entries. Cloud AI
πŸ’¬ Chat Catch-up catchup Project Alpha Generates 3-tier summary of recent group discussion. Cloud AI
summarize chat Summarizes most recent active conversation. Cloud AI
πŸ“¬ Email Reader read my emails Fetches unread email headers and senders via IMAP. Cloud AI
summarize email #1 Deep executive breakdown of specific message. Cloud AI
πŸ“… Calendar schedule Project Sync tomorrow at 4pm Produces 1-tap Google Calendar event creation link. Cloud AI
events / calendar Shows upcoming schedule from local database. 0 tokens
🚫 Exemptions exempt Family Group Stops message logging for spammy group chats. 0 tokens

πŸ› οΈ Troubleshooting

1. "ARGUS_SECRET must be at least 32 characters" or "cannot be placeholder"

  • Cause: Startup validation detected an empty, default placeholder, or short secret.
  • Fix: Generate a 32-byte secret (openssl rand -hex 32) and paste the exact value into both apps/brain/.env and apps/bridge/.env.

2. WhatsApp QR Code Disappears or Times Out

  • Fix: Restart the bridge service or attach to the container:
    docker compose restart argus-bridge
    docker compose logs -f argus-bridge
  • To completely reset WhatsApp authentication credentials:
    # Local:
    rm -rf apps/bridge/auth_info
    # Docker:
    docker volume rm argus_whatsapp_auth

3. Backing Up Persistent Data

Persistent data is isolated in Docker volumes:

  • argus_whatsapp_auth: WhatsApp Web encryption keys and pairing state.
  • argus_brain_memory: Second Brain memory database (argus_memory.db).
  • argus_bridge_data: Message log and contact cache (argus.db).

To back up databases:

docker run --rm -v argus_bridge_data:/data -v $(pwd):/backup alpine cp /data/argus.db /backup/
docker run --rm -v argus_brain_memory:/data -v $(pwd):/backup alpine cp /data/argus_memory.db /backup/

πŸ”’ Security & Community


πŸ“œ License

Licensed under the MIT License. Copyright Β© 2026 Mohammed Yusuf Ahmed.

About

ARGUS - Automated Recognition of Gatherings, Updates & Scheduling

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages