Blog · 24 November 2026
How to build a WhatsApp AI agent for your business
To build a WhatsApp AI agent, connect a number to the WhatsApp Business Platform through Meta's Cloud API or a provider, get the business verified and your message templates approved, then connect a language model to a knowledge base of approved content and the tools it may use. Add guardrails and a route to a person, and test it with real questions before launch.
- Published
WhatsApp Business App or the Business Platform
WhatsApp offers two products for businesses, and only one of them can run an AI agent. The WhatsApp Business App is the free app many small businesses already use on a phone. It has a business profile, quick replies, labels, and greeting and away messages, but no way for your own software to read and answer messages.
The WhatsApp Business Platform is the API version. Your software receives each incoming message through a webhook and sends replies through the API, which is what an AI agent needs. Meta hosts the API itself as the Cloud API, and many Business Solution Providers sell access with their own dashboards, shared inboxes and billing on top. Using the platform means accepting Meta's business and commerce policies, which limit what you may send and to whom.
If your number is already in use on the Business App, plan the move before you start. Moving a number to the platform changes how it is managed, and the options depend on your account and provider, so check them first.
Business verification and message templates
Meta asks you to set up a business portfolio and, for most production use, to complete business verification with documents that show the business is real. The display name customers see is reviewed too. Verification affects how many customers you can message, so start it early. It is often the slowest step, and it needs no code.
WhatsApp treats conversations a customer starts differently from messages your business starts. When a customer messages you, a 24-hour customer service window opens, and inside it the agent can reply freely. Outside that window the business can only send pre-approved message templates, such as an appointment reminder or an order update, and only to customers who have opted in. Meta reviews each template and puts it in a category such as marketing, utility or authentication, and the category affects what it costs.
For an AI agent, this means free-form conversation happens inside the 24-hour window, and anything proactive has to be written as a template in advance. List the reminders, confirmations and follow-ups you want early, so the templates are approved before launch.
Choosing a provider
You can connect to Meta's Cloud API directly or go through a Business Solution Provider. Going direct avoids a monthly platform fee and gives your developers full control, but you have to build the inbox your staff will use for handover. A provider adds a shared inbox, contact management and broadcast tools, and usually charges a monthly plan on top of Meta's message fees.
Questions to ask any provider:
- Does it pass every incoming message to your own webhook, so your agent can answer?
- Can staff take over a chat in its inbox, and can the agent pick it up again afterwards?
- How does it bill Meta's message fees, and what does it add on top?
- Where are messages stored, and can you export them?
- Can you move your number to another provider later?
Building the knowledge base
The agent should answer from content you have approved. The usual method is retrieval-augmented generation, or RAG. You collect the source material, such as FAQs, policies, price lists, opening hours and product details, split it into passages and store them in a search index. When a message arrives, the system finds the most relevant passages and gives them to the model with instructions to answer only from them, and to say it does not know when nothing relevant comes back.
The quality of the answers depends more on this material than on the choice of model. Out-of-date prices or two conflicting policy pages will turn into wrong answers. Give each document an owner, remove what is stale and decide how updates reach the index.
For the AI agents we build, we usually keep the index in PostgreSQL with pgvector, next to the rest of the application data, which keeps it simple to run and back up.
Tools, actions and guardrails
An agent that answers questions is useful. One that can check an order status, book a slot or open a support ticket saves your staff more time. Each of these is a tool: a function in your system that the model can ask to call, with a defined set of inputs. The model never touches your database directly. Your code checks every request, runs it and returns the result.
Guardrails are the rules that keep the agent within bounds:
- Answer only from retrieved content, and say so when nothing relevant is found
- Call only the tools on an agreed list, with every input validated before it runs
- Ask the customer to confirm before any action that changes data, such as a booking
- Decline topics outside your business
- Never ask for passwords, card numbers or other sensitive data in the chat
- Log every conversation so you can review answers and fix the source content
Handing over to a person
Every agent needs a clear rule for passing a chat to a human. Common triggers are a customer asking for a person, a complaint or refund request, a topic on a list you set, or the agent failing to find an answer. When the rule fires, the chat moves to your staff inbox with a short summary, so the customer does not have to explain again.
Decide what happens outside office hours. The agent can tell the customer when someone will reply and collect the details your team needs to pick it up the next morning. Agree the handback as well: once staff have resolved the issue, the agent can return to routine questions.
Language belongs in the same planning. An agent can work in English and Urdu, including Urdu typed in Roman script, which is how many people in Pakistan write on WhatsApp. Decide which languages you support and test each one with real messages from your customers.
Testing before launch
Write a test set before the agent is finished: real questions from your chat history, each with the answer it should get. Include the awkward cases, such as questions the knowledge base cannot answer, customers who change their mind halfway through a booking, angry messages, voice notes and messages that mix English and Urdu. Run the whole set again after every change to the prompts or the content.
Then launch to a small group, such as one branch or one product line, and read the transcripts every day for the first few weeks. Most fixes at this stage are to the source content: a missing policy, an unclear price or a question nobody expected.
What it costs to run
Running costs come from several places. Meta charges for template messages at rates that depend on the category and the customer's country, and it has changed its pricing model more than once, so check its current rate card. A provider, if you use one, adds a monthly plan. The language model is billed by usage, and so is speech-to-text if the agent handles voice notes. You also pay for hosting the webhook, the database and the index.
Some Pakistani vendors publish their own figures. One WhatsApp API provider lists a starter plan at about PKR 12,500 for one number and three agents, with Meta's per-message fees on top. One chatbot vendor estimates a WhatsApp plus AI setup at PKR 8,000 to 15,000 a month. These are vendor estimates checked in November 2026, not quotes, and your own cost depends on message volume and how long conversations run.
Building the agent is a separate, one-off cost that depends on the integrations, the size of the knowledge base and the guardrails. AAN Technologies builds AI agents, and after a short discovery call we give a written estimate of both the build and the expected monthly running cost.
Sources
How we can help
Questions we get asked
Can I build an AI agent on the free WhatsApp Business app?
No. The free WhatsApp Business app gives you quick replies, labels, and greeting and away messages, but it has no API, so your own software cannot read or answer messages. An AI agent needs the WhatsApp Business Platform, used through Meta's Cloud API directly or through a Business Solution Provider, which passes each message to your system and sends its replies.
Do I need Meta business verification for a WhatsApp AI agent?
For most production use, yes. Meta asks businesses on the WhatsApp Business Platform to set up a business portfolio and verify the business with official documents, and it reviews the display name customers see. Verification also affects how many customers you can message. It is often the slowest step, so start it at the same time as the build.
Can a WhatsApp AI agent reply in Urdu?
Yes. An AI agent can read and reply in English and in Urdu, including Roman Urdu, which many people in Pakistan use when typing on WhatsApp. Quality varies between language models and with how the knowledge base is written, so test the agent with real messages from your own customers in both languages before launch, and keep a route to a person.
How much does a WhatsApp AI agent cost to run each month?
Monthly cost combines Meta's template message fees, any provider plan, language model usage and hosting. As published vendor examples, one Pakistani WhatsApp API provider lists a starter plan at about PKR 12,500 with Meta's fees extra, and one chatbot vendor estimates WhatsApp plus AI at PKR 8,000 to 15,000 a month. Your own figure depends mostly on message volume.
How do you stop a WhatsApp AI agent from giving wrong answers?
Limit it to approved content. The agent searches an index of material you have signed off and is told to say it does not know when nothing relevant comes back. Actions run only through defined tools with checked inputs. Logging every conversation lets you find weak answers and fix the source, and a handover rule passes difficult chats to staff.