How shahd132/whatsapp-assistant-agent works
This is a WhatsApp assistant that replies in its owner’s style while holding uncertain or owner-only decisions for approval. Incoming messages pass through the bridge and FastAPI webhook, then media resolution, history/style context, reply generation, and verification before sending or holding. The owner can also manage held replies, controls, message history, and Mika through the dashboard. The sampled sources establish the main agent and webhook calls; some dashboard and approval relationships are documented in the README or SOURCE INDEX rather than shown in full source excerpts.
Main entry points: main.py Webhook policy · agent_graph.py Agent graph · dashboard.py Dashboard API · controls.py Controls and history
Components 21
WhatsApp ingress
- WhatsApp bridge
whatsapp-bridge/bridge_api.js - Webhook policy
app/main.py
Reply pipeline
- Agent graph
app/agent_graph.py - Media resolution
app/agent_graph.py - Voice transcription
app/stt.py - Image captioning
app/vision.py - Conversation memory
app/memory.py - Style retrieval
app/style_retrieval.py - Reply generation
app/llm.py - Chat export parsing
app/export_parser.py
Owner dashboard
- Held approvals
app/approvals.py - Dashboard API
app/dashboard.py - Dashboard interface
app/dashboard.html - Mika assistant
app/assistant.py - Controls and history
app/controls.py - Contact directory
app/contacts.py - Speech synthesis
app/tts.py
State and observability
- SQLite state
app/db.py - Structured logging
app/log.py
Other components
- Owner
Connections 32
- WhatsApp → WhatsApp bridge: exchanges messages
README.md - WhatsApp bridge → Webhook policy: posts incoming
README.md - Webhook policy → Agent graph: processes message
app/main.py - Webhook policy → Contact directory: resolves sender
app/main.py - Webhook policy → SQLite state: checks mode; records result
app/main.py - Agent graph → Media resolution: resolves media
app/agent_graph.py - Media resolution → Voice transcription: transcribes voice
app/agent_graph.py - Media resolution → Image captioning: captions image
app/agent_graph.py - Agent graph → Conversation memory: loads history
app/agent_graph.py - Agent graph → Style retrieval: retrieves examples
app/agent_graph.py - Agent graph → Reply generation: generates reply
app/agent_graph.py - Reply generation → Chat export parsing: uses parsed exports
- Agent graph → Structured logging: logs verification
app/agent_graph.py - Webhook policy → Held approvals: routes dashboard
app/main.py - Webhook policy → Dashboard API: registers routes
app/main.py - Webhook policy → Mika assistant: registers routes
app/main.py - Webhook policy → Controls and history: registers routes
app/main.py - Webhook policy → Conversation memory: stores messages
app/main.py - Webhook policy → Speech synthesis: speaks voice replies
app/main.py - Held approvals → SQLite state: reads and updates holds
app/approvals.py - Held approvals → WhatsApp bridge: sends approved item
README.md - Dashboard interface → Dashboard API: uses dashboard routes
README.md - Dashboard API → WhatsApp bridge: sends text or location
app/dashboard.py - Mika assistant → SQLite state: queries messages
app/assistant.py - Mika assistant → Controls and history: uses control settings
app/assistant.py - Controls and history → SQLite state: reads and changes state
app/controls.py - Controls and history → Contact directory: validates contact
app/controls.py - Dashboard API → Voice transcription: transcribes dictation
app/dashboard.py - Dashboard API → Speech synthesis: creates spoken replies
app/dashboard.py - Controls and history → Structured logging: logs changes
app/controls.py - Owner → Dashboard interface: operates dashboard
README.md - Owner → Held approvals: reviews held replies
README.md