WhatsApp support agent
Every piece in this course, assembled once: a message arrives on WhatsApp, an agent answers it from your own documents, and the reply goes back on the same thread.
This is the payoff. Nothing in this build is new — a trigger, an agent, two tools, an output node — and that is the point. You have met all of it. What you have not seen is the four of them wired into something a customer could actually message.
The shape is four nodes and it barely changes between businesses:
- A message arrives. The WhatsApp entry point starts the workflow and carries what they said.
- An agent reads it. It decides whether it needs to look something up, does so, and composes an answer.
- Tools do the work. A knowledge base search for the facts, a CRM write so the conversation leaves a trace.
- The reply goes out. Back down the same WhatsApp thread.
The build
Four nodes and two attached tools
The tools hang off the agent; only the trigger, the agent and the output are on the path.
Scroll for all 5 steps →
Read the two tools first. Both are pinned where it matters. The search has one knowledge base fixed, so no phrasing of a question reaches another library. The note tool has its entity and operation fixed, so the agent can write a note and nothing else. Only the query and the note's content are {{ai}} — the parts that are genuinely the agent's job.
Then read the prompt. Four instructions and three constraints, and every one of them is there because of a failure this course has already shown you. Always search before answering, because a model asked about a returns policy will invent one. Do not change any number, because a paraphrase of a policy is a new policy. Say so when the search finds nothing, because retrieval always returns the nearest chunk. Under eighty words, no bullets, no links — because this is a phone screen and the last lesson on messaging said so.
Why each decision is what it is
| Setting | Why |
|---|---|
threshold 0.35 | |
max_iterations 4 | |
memory_type buffer | |
temperature 0.2 | |
add_typing_indicator |
threshold 0.35
- Why
max_iterations 4
- Why
memory_type buffer
- Why
temperature 0.2
- Why
add_typing_indicator
- Why
What breaks — in this build specifically
The 24-hour window will stop this workflow before anything else does. The reply is free-form text, so it only sends if the customer messaged you within the last day. In a support flow that is usually fine — they just messaged you. It stops being fine the moment your agent takes a while, or the workflow pauses, or you try to follow up the next morning. When replies stop arriving and nothing looks broken, this is the first thing to check.
Leaving message_content empty would still “work”, and that is the danger. The output node falls back to any upstream node's output, and failing that to its own default sentence. So a build where the agent errors quietly still sends the customer something reassuring and meaningless. Setting message_content explicitly to the agent's output — as here — makes the dependency real, and the fallback then only fires when it should.
The note tool will be used more than you expect, or not at all. An agent with a tool and no instruction about when to use it ignores it; an agent told to log the question logs every message including “thanks”. The prompt says once, at the end. Read a few real conversations and adjust — this is the setting that tells you whether your prompt is being followed.
A human needs to be able to take over. This build has no escape hatch in it, deliberately, because the escape hatch is not a node — it is a person watching the WhatsApp conversations screen and replying. Before this goes live, somebody has to own that screen. An agent that answers ninety per cent of questions and strands the other ten is worse than no agent.
Build it
- Create the knowledge base first and put one real policy document in it. Everything downstream is only as good as that.
- Build the agent with the search tool only, and no WhatsApp at the ends — a chat trigger and a Text Response will do. Get the answers right where testing is free.
- Add the note tool and check it fires once per conversation rather than once per message.
- Swap the ends for the WhatsApp entry point and output. Message your own number.
- Ask it something the knowledge base does not cover, and confirm it says so rather than inventing. If it invents, the threshold is too low or the prompt line is missing.
- Then leave it overnight and message it again. That is the 24-hour window, met in the only way anyone ever really learns it.
Next: the voice-call agent — the same idea when the customer is on the phone and cannot wait.
Related lessons
Base rates — what a piece of evidence is actually worth
A face-recognition system that is 99.9% accurate and almost entirely wrong, and a number that sent an innocent woman to prison. Both are the same arithmetic, and it is the arithmetic that decides what any piece of evidence is worth.
ReadConfirmation and survivorship — what you never looked for
Two questions about evidence you did not go looking for. One is a rule you have to discover, and one is a pattern in five famous people — and in both, the thing that would have told you the truth is the thing nobody checks.
ReadLoss aversion, sunk cost and regression — what it costs you
Four questions you answer about yourself rather than about a scenario, and your own answers are the finding. Then the pattern that makes praise look useless and criticism look like it works, whatever you actually do.
Read
