Give your LangGraph agent its WhatsApp.
An open-source project that shows how to connect a LangGraph agent to a WhatsApp account you control. People message it like a contact, and it replies in the same chat.
What’s included
Everything between WhatsApp and your agent.
Pair it once by scanning a QR code.
Text and voice notes
People type or send an English voice note. The agent answers in text.
Photos and images
It reads a photo with its caption, and can send back a generated image.
Memory per sender
Each person gets a private thread. Long chats are summarized.
Your agent, your tools
Instructions and tools live in one file: src/agent/index.ts.
How it works
One message, there and back.
Four stops come with the starter. The agent is yours.
- Their phone
Step 1: WhatsApp
Someone messages the account you linked.
- Included
Step 2: WAHA
Receives it and forwards a signed webhook.
- Included
Step 3: Adapter
Checks it, handles media and finds the sender’s thread.
- Your code
Step 4: Your agent
LangGraph runs your instructions and tools.
- Included
Step 5: Same chat
The reply goes back to the sender. The model never picks the recipient.
Extensions
Where you could take it from here.
Ideas, not features. The starter is the base; each of these needs code of your own.
A /new command
Let someone start fresh. Each chat maps to one thread today; add a counter to the thread ID and /new opens the next one.
A recap on reset
Before starting over, send the person a short summary of the old chat and carry it into the new thread.
Contact profiles
Keep each person’s name, language and preferences in LangGraph’s long-term store, so they carry across threads.
Human handoff
Pause the agent and pass a chat to a person with a LangGraph interrupt, then hand it back.
A production backend
Run LangGraph’s production Agent Server on Postgres and Redis for durable threads and queued runs.
The official Cloud API
Swap WAHA for Meta’s WhatsApp Business Cloud API behind the same adapter.
Thinking of building on this? Tell me what you have in mind, and we’ll figure out where to start together. Grab a 15-min chat
FAQ
Questions
References