langgraph-whatsapp-agent

MCP.Pizza Chef: lgesuellip

LangGraph WhatsApp Agent is a client template for building AI agents that interact with users on WhatsApp. It leverages LangGraph and Twilio APIs to process messages and images, invoke custom graph-based agents, and maintain persistent conversation states. Integrated with MCP servers, it supports multi-agent architectures, security validations, and observability via LangSmith, enabling scalable and secure AI-driven WhatsApp services.

Use This MCP client To

Deploy AI chatbots for customer support on WhatsApp Process and respond to WhatsApp image messages automatically Manage multi-agent workflows with supervisor-based architecture Integrate WhatsApp conversations with MCP servers like Supermemory Maintain persistent conversation context across WhatsApp sessions Validate incoming WhatsApp requests for enhanced security Monitor agent interactions using LangSmith observability tools Rapidly deploy AI agents on WhatsApp via LangGraph Platform

README

LangGraph WhatsApp Agent

A template for building WhatsApp agents using LangGraph and Twilio. This project enables you to deploy AI agents that interact with users via WhatsApp, process messages and images, and invoke custom graph-based agents hosted on the LangGraph Platform.

It provides a foundation for building scalable, secure, and maintainable AI agent services.

Fork this repo and iterate to create your production-ready solution.

Architecture Diagram

Features

  • Create custom LangGraph-powered agents for WhatsApp
  • Support for multi-agents with supervisor-based architecture
  • Integration with Model Context Protocol (MCP) servers (Supermemory, Sapier, etc.)
  • Support for image processing and multimodal interactions
  • Persistent conversation state across messages
  • Request validation for security
  • Comprehensive observability via LangSmith
  • Easy deployment with LangGraph Platform

Stack

  • WhatsApp Integration: Twilio API for messaging and multimedia handling
  • Agent Framework: LangGraph (by LangChain) as the MCP client and multi-agent system using langgraph_supervisor
  • Models: Supports Google Gemini, OpenAI GPT models, and more
  • MCP Servers: Using langchain-mcp-adapters
    • Supermemory
    • Zapier for access to thousands of apps and integrations (Google, Slack, Spotify, etc.)
  • Observability: Complete tracing with LangSmith
  • Deployment: LangGraph Platform for simplified production hosting

Prerequisites

  • Twilio account with WhatsApp integration
  • API key for LLM access (OpenAI, Google, etc.)
  • LangGraph Platform access
  • (Optional) MCP server configurations

Getting Started

  1. Fork this repository to start your own project
  2. Build your agent using the template structure
  3. Deploy to LangGraph Platform Langggraph Platform
  4. Configure Twilio webhook to point to your LangGraph deployment URL (/whatsapp) Twilio

License

This project is licensed under the terms included in the LICENSE file.

langgraph-whatsapp-agent FAQ

How does langgraph-whatsapp-agent handle message processing?
It processes text and image messages from WhatsApp using LangGraph-powered agents and Twilio APIs.
Can I run multiple agents simultaneously with this client?
Yes, it supports multi-agent setups with a supervisor-based architecture for managing workflows.
How is conversation state managed across messages?
The client maintains persistent conversation state to ensure context continuity across WhatsApp sessions.
What security features are included?
It includes request validation to secure incoming WhatsApp messages and prevent unauthorized access.
How does it integrate with MCP servers?
It connects with MCP servers like Supermemory and Sapier to enrich agent capabilities and context handling.
Is there support for multimodal interactions?
Yes, it supports image processing alongside text for richer user interactions.
How can I monitor and debug agent performance?
Observability is provided via LangSmith, enabling comprehensive monitoring and debugging.
What deployment options are available?
The client is designed for easy deployment on the LangGraph Platform for scalable production use.