How They Use AI  |  Newest

<< Home  |  Tech

Built an open-source WhatsApp agent for voice and images

AreaTech
AI usedLangGraph
Sourcer/AI_Agents
Posted2026-11-20

The move

Deploy a LangGraph agent to WhatsApp using a keyed hash of the chat ID to maintain conversation history without a database.

Steps

  1. Set up a LangGraph agent in a single file.
  2. Use a keyed hash of the WhatsApp chat ID as the thread ID.
  3. Implement summarizationMiddleware to compact older messages.
  4. Connect the agent to WhatsApp using the WAHA gateway.
  5. Limit image generation to one call per message run.

Prompt for your AI

Act as a conversational assistant for WhatsApp. Process incoming voice notes by transcribing them, analyze attached photos, and maintain context for each unique chat thread. If asked for an image, generate one using [Image Generation Tool] and send it back. Summarize older messages to keep the conversation history concise.

What happened

The user built an open-source agent that connects to WhatsApp via a QR code. The agent processes voice notes, images, and text while maintaining conversation context through LangGraph threads. It uses summarization to manage long-term chat history and limits image generation to control costs.

Watch out

Using unofficial WhatsApp gateways like WAHA can lead to account bans, so use a spare phone number. The system currently drops messages if a second message arrives while the first is still processing.

Give it to your agent

Read https://howtheyuse.ai/p/built-an-open-source-whatsapp-agent-for-voice-and-images.md and help me do this.

Sources



Last updated November 26, 2026.