AI
Bring your own AI agent to WhatsApp: connect any framework (LangGraph, ADK, custom) with a webhook endpoint
Your team built an agent with LangGraph, Google ADK, CrewAI or plain code, and it works. Here is how to put it in front of customers on WhatsApp and every other channel without rebuilding it, with a team inbox and human handover around it.
MonoChat Team Updated: 6 min read
On this page
You can connect almost any AI agent to WhatsApp without rewriting it. Run your agent, built with LangGraph, Google ADK, CrewAI or your own code, behind an HTTPS endpoint, then add it in MonoChat as an AI Harness with the Custom provider: an endpoint URL and a shared secret. Place an AI Agent node in a flow, connect your WhatsApp number, and your agent answers customers on WhatsApp and every other channel MonoChat connects, with a shared inbox and human handover around it.
This guide is for teams that already have an agent, or want full control over how it works. It covers when bringing your own agent makes sense, what your endpoint is responsible for, the setup in MonoChat and the details that matter in production.
Why bring your own agent?
Most customer messaging platforms come with one built-in AI agent. That is convenient until:
- Your agent is already built. Your developers spent months on a LangGraph graph or an ADK multi-agent setup, with evaluations and tests. Rebuilding it inside a vendor’s bot builder throws that work away.
- You need your own logic. Pricing rules, eligibility checks, compliance steps or internal systems that only your code can reach.
- You want to choose the framework. Frameworks move fast. Today it is LangGraph; next year it may be something else. Your channels and inbox should not have to change with it.
- Data has to stay with you. Some organisations want the agent’s reasoning and tool calls to run on their own infrastructure.
MonoChat’s Agent Harness is built for this: bring your own agent framework and keep everything around it, the channels, the inbox, the people, in one place.
How the Custom harness works
Think of it as a division of labour.
MonoChat handles the conversation layer:
- The official connections to WhatsApp, Instagram, Messenger, TikTok, Telegram, web chat, SMS and voice (MonoChat is an official Meta Business Partner).
- The flow that decides when the agent is called, through the AI Agent node.
- The shared team inbox, where a person can take over with the full history.
Your endpoint handles the agent:
- Receiving the conversation from MonoChat.
- Running your agent: its reasoning, its tools, its memory.
- Returning the agent’s reply.
Between them sits a shared secret, a value both sides know, so your endpoint can verify that a request comes from your MonoChat account. MonoChat defines the exact request and response format your endpoint implements; if you do not have it yet, talk to us and we will share it with your developers.
What your endpoint should do
Whatever framework you use, a production-ready agent endpoint has a few jobs.
Verify every request
Check the shared secret on every call and reject anything that does not match. Store the secret in your secrets manager or environment variables, not in code, and rotate it if it is ever exposed.
Keep each conversation separate
Customers write in parallel. Make sure your agent’s state, memory and any working files are scoped to one conversation, so one customer’s details never leak into another’s answer.
Answer in chat-sized messages
Agents built for web apps tend to write long, formatted answers. WhatsApp is read on a phone. Ask your agent for short messages, one question at a time, and keep heavy Markdown out of replies.
Fail loudly, not silently
If a tool times out or your model provider returns an error, return a clear failure rather than a half-finished answer. A predictable failure lets the flow do the right thing, for example hand the conversation to a person.
Be quick
Customers expect a reply within seconds. Keep long-running work out of the reply path where you can, and make your tools fast or asynchronous.
Step by step in MonoChat
1. Deploy your agent behind HTTPS
Host your LangGraph, ADK, CrewAI or custom agent on your own server or cloud, reachable over HTTPS. Implement MonoChat’s request and response format and the shared-secret check.
2. Add an AI Harness with the Custom provider
In MonoChat, add an AI Harness, choose Custom and enter your endpoint URL and shared secret. You add the harness once and can use it in as many flows as you like.
3. Add an AI Agent node to a flow
In the flow that receives incoming conversations, add an AI Agent node and select your custom harness. Use the flow around it for what flows do best: greeting, routing by language or topic, business hours, and the path to a person.
4. Set a budget per run
Each AI Agent node supports budget limits per run. Use them as a safety net next to the limits you already enforce in your own code.
5. Connect WhatsApp and other channels
Connect your WhatsApp Business number, then attach the same flow to the other channels you use. There is no extra integration work per channel: your endpoint sees conversations, not channel APIs.
6. Test, then go live
Replay real customer messages through the flow. Check tool calls, response times, tone and handover. Watch the first days of live traffic closely, then widen what the agent is allowed to do.
Framework notes
LangGraph. A graph of nodes and edges is a natural fit for support journeys (triage, lookup, resolve, escalate). Wrap the compiled graph in a small HTTP service, load the conversation’s state on each request and return the final message.
Google ADK. ADK’s multi-agent trees, a coordinator with specialist sub-agents, map well to support, sales and billing teams. Expose the root agent through your endpoint and let ADK route internally.
CrewAI. Crews of role-based agents work well for tasks with clear hand-offs, such as research then answer. Keep crews small for chat: every extra agent adds latency.
Your own code. A plain loop with a model API and a few functions is often enough. You keep total control, and MonoChat gives you the channels and the inbox.
Handover: decide it in the flow
Decide in the flow which conversations go to a person and which team receives them, and write your agent so it tells the customer honestly when it cannot help instead of guessing. The flow then hands the conversation to the right team in the shared inbox with the full history. WhatsApp’s Business Messaging Policy also expects automated replies to offer a clear route to a human.
Keep your agent inside your business, too. Since January 15, 2026, WhatsApp keeps general-purpose AI assistants off the platform; agents that serve your own customers are fine. Our WhatsApp AI chatbot policy guide explains the rule.
When not to build your own
A custom agent is the most flexible option and also the one you maintain. If you are starting from scratch, a built-in option gets you live faster with nothing to host:
- MonoChat’s built-in harness on your MonoChat AI models.
- The OpenAI Agents SDK, run inside MonoChat (guide).
- The Claude Agent SDK or Pi, run on MonoChat’s agent runner (Claude guide).
- Hosted agents: the OpenAI Agents API or Claude Managed Agents, with your own key.
Because every option uses the same AI Agent node, you can start with one and move to your own agent later without touching your channels or handover. Compare them on the Agent Harness page.
Put this into practice with MonoChat