Skip to content
WaveSenda
Start free
BlogTutorial · 12 min

Build a WhatsApp AI agent that knows your business

A working agent in about twenty minutes: persona, knowledge, confidence threshold and handover. Including how to test it against real questions before it is anywhere near a customer.


An agent that answers WhatsApp questions from your own material, hands to a person when it is out of its depth, and can be tested before it is anywhere near a customer.

Twenty minutes for a working one. The last step — testing it against real questions — is the one that decides whether it is any good, and the one most people skip.

Step 1

Decide what it is allowed to be bad at

Before touching the console. Write down two lists:

It should answerIt should hand over
Opening hours, locationsAnything about a refund
Delivery times and costsComplaints
Stock and sizingCustom pricing or discounts
Return policy as writtenA specific order that has gone wrong
Payment methods acceptedAnything it has not been given material for

The second column is the more important one. An agent judged on how much it answers will be tuned to answer everything, and the questions it should not have touched are exactly the ones that cost you money.

Step 2

Create the agent and write its persona

Console → Agents → new. The persona is not decoration: it is the instruction the model works from. Be specific and short, and say what to refuse.

a persona that works
You answer questions for Kunshort, a kitchenware shop in Douala.

Be brief. Two or three sentences. This is WhatsApp, not email.
Answer only from the material you are given. If it is not there, say you
will get a colleague — do not guess, and never invent a price or a policy.

Hand over immediately for: refunds, complaints, discounts, or anything
about a specific order.

Match the customer's language. Do not open with "Certainly!" or
"I'd be happy to help" — nobody in a WhatsApp chat talks like that.

The last line matters more than it looks. A model’s default register reads as a robot instantly in a thread where every other message is eight words long.

Step 3

Give it your material

Console → Agents → Knowledge. Upload documents or paste text. What to include, in rough order of value:

  • Refunds, delivery, warranty. Most asked, most costly to get wrong.
  • Current prices. Only if current — a stale price quoted confidently is worse than no answer.
  • Product specs and sizing. High volume, low judgement.
  • Hours and locations.

Leave out marketing copy: it is written to persuade, not to answer, and an agent fed on it produces enthusiastic non-answers. Be careful with past support transcripts too — they are full of one-off concessions that should not become policy.

or via the API
curl -s -X POST "$WAVESENDA_URL/agents/knowledge/" \
  -H "Authorization: Bearer $WAVESENDA_API_KEY" \
  -F "agent=$AGENT_ID" \
  -F "file=@returns-policy.pdf"
Step 4

Set the handover rules

Three controls, and the defaults are rarely right for a specific business.

SettingWhat it doesWhere to start
Confidence thresholdBelow this, it hands over instead of answeringHigh. Lower it only if it is handing over things it clearly knew
Max replies per conversationStops a loop with a confused customer3 to 5
Handover messageWhat the customer reads as it steps asideShort, and promise nothing you cannot keep

Start it more cautious than feels necessary. An agent that hands over too often is mildly annoying to your team; one that answers too confidently is a wrong policy quoted to a customer in writing.

Step 5

Test it before anybody else does

The step that matters. Use the playground, and write twenty real questions — pulled from your actual inbox, not invented.

Include, deliberately:

  • Five it should answer easily. Baseline.
  • Five it should refuse. Refunds, discounts, a specific order.
  • Five it has no material for. It must hand over, not improvise.
  • Five phrased badly — typos, half sentences, a photo with “this one?”. This is what real messages look like.

Judge each answer on two things: is it correct, and would you have been happy for a customer to receive it. An answer that is technically right and sounds like a call centre fails the second test.

Step 6

Attach it, and watch the first week

Attach the agent to a session or a website widget. It answers first; your team still receives every question it answers, so a bad answer is something you correct rather than something you hear about from a complaint.

The moment a person replies, the agent stops for that conversation permanently. This is not negotiable and is the thing that makes teams willing to leave it switched on.

What to watch, and what it tells you

SignalWhat it means
Handover rate very lowIt is guessing. Raise the confidence threshold
Handover rate very highMissing material, not a model problem
Staff correcting itEach correction is a gap in the documents. Fix the document
Customers repeating the questionThe answer was technically right and not understood
Slow time-to-human after handoverThe benefit is being lost at the last step

Mistakes worth avoiding

  • Feeding it everything. More material makes retrieval worse, not better. Curate.
  • Letting it discuss price flexibility. It will eventually offer a discount you did not authorise, in writing.
  • Hiding that it is an agent. People work it out, and feeling deceived is worse than being answered by software.
  • Leaving stale documents in. Last year’s prices quoted confidently is the worst possible failure.
  • Judging it on deflection rate. That number rewards exactly the behaviour you do not want.

More on why retrieval matters in this post, and the reference in the agent docs.

Common questions

How long does it take to set up a WhatsApp AI agent?

About twenty minutes for a working one: persona, a few documents, handover rules. Testing it properly against real questions takes another hour and is where the quality comes from, so budget for that rather than skipping it.

What documents should I give it?

Refunds, delivery, warranty, current prices, product specs, hours. Leave out marketing copy, which is written to persuade rather than answer, and be careful with old support transcripts full of one-off concessions.

Will it stop when one of my team replies?

It should stop permanently for that conversation, not pause. Two voices answering one customer is worse than either alone, and an agent that resumes after a colleague has spoken is the fastest way to lose your team’s trust in it.

Can it answer in more than one language?

Yes — a model handles that naturally, and it can be told to match the customer’s language. Quality varies by language, so test in the ones your customers actually use rather than assuming.

How do I stop it inventing prices?

Instruct it to answer only from supplied material, set a high confidence threshold, and give it a current price list or none at all. The instruction alone is not enough — an agent with no prices and permission to guess will still guess.


Read next
The promises you made in WhatsApp and nobody wrote down
Follow-through · 7 min
Getting paid without leaving the chat
Payments · 7 min
Surviving a WhatsApp ban with a standby number
Continuity · 8 min
Build a WhatsApp AI agent that knows your business · WaveSenda