How lgesuellip/langgraph-whatsapp-agent works
This template carries WhatsApp text and images through a Twilio-validated webhook to a LangGraph-hosted assistant, then formats the assistant reply as TwiML. Its agent template builds a supervisor with a calendar sub-agent and optional MCP tools. README-documented persistence, multimodal support, tracing, and deployment are included; where their implementation is not shown, links are limited to documented integrations.
Main entry points: graph.py Supervisor graph · server.py Webhook server · channel.py Message channel · agent.py Graph client
Components 18
WhatsApp ingress
- Webhook server
src/langgraph_whatsapp/server.py - Signature validation
src/langgraph_whatsapp/server.py - Message channel
src/langgraph_whatsapp/channel.py - Image retrieval
src/langgraph_whatsapp/channel.py
Agent runtime
- Graph client
src/langgraph_whatsapp/agent.py - Supervisor graph
src/agents/base/graph.py - Supervisor agent
src/agents/base/graph.py - Calendar agent
src/agents/base/graph.py - Agent prompts
src/agents/base/prompt.py
Agent integrations
- Gemini model
- Zapier MCP
- Supermemory MCP
Platform services
- LangGraph Platform
- Conversation state
- LangSmith tracing
- Platform auth
src/langgraph_whatsapp/auth.py
Other components
- WhatsApp user
- Twilio WhatsApp
Connections 25
- WhatsApp user → Twilio WhatsApp: sends messages
- Twilio WhatsApp → Webhook server: posts webhook
- Webhook server → Signature validation: validates signature
- Webhook server → Message channel: handles request
- Message channel → Image retrieval: downloads images
- Image retrieval → Twilio WhatsApp: fetches media
- Message channel → Graph client: invokes assistant
- Graph client → LangGraph Platform: streams run
- LangGraph Platform → Supervisor graph: runs graph
- Supervisor graph → Supervisor agent: builds supervisor
- Supervisor graph → Calendar agent: builds sub-agent
- Supervisor graph → Agent prompts: renders prompts
- Supervisor graph → Gemini model: configures model
- Supervisor graph → Zapier MCP: loads tools
- Supervisor graph → Supermemory MCP: loads tools
- Supervisor agent → Calendar agent: delegates scheduling
- Graph client → Conversation state: uses thread ID
- LangGraph Platform → Conversation state: persists conversation
- LangGraph Platform → LangSmith tracing: traces runs
- LangGraph Platform → Platform auth: authenticates requests
- LangGraph Platform → Graph client: returns result
- Graph client → Message channel: returns reply
- Message channel → Webhook server: returns TwiML
- Webhook server → Twilio WhatsApp: responds webhook
- Twilio WhatsApp → WhatsApp user: delivers reply