How to build a customer support AI agent, step by step
The eight steps we follow to build a customer support AI agent: scope, content, retrieval, instructions, actions, handover, testing and a narrow launch.
By Sohail Hussain7 November 20266 min read
To build a customer support AI agent, pick the ten to twenty questions that make up most of your support volume, fix the content that answers them, set up retrieval so the agent reads the right passage for each question, write instructions that keep it to that content, add actions one at a time, design the handover to a person, test it against a few hundred real past conversations, and launch to a slice of your traffic. Expect four to ten weeks for one channel and one or two actions. Most of that time goes into content and testing, not the model.
These are the steps we follow in our AI agents and chatbots projects. Before you start, check whether you need a custom build at all. If your answers already live in a help centre on Intercom, Zendesk or similar, their built-in AI may be enough; website chatbot: build vs buy sets out when it is. And if you are still deciding whether you need an agent or a chatbot, start with AI agents for business.
How do you scope the agent?
Step 1: Choose the questions it will handle
Export the last three months of support conversations from email, chat and WhatsApp. Group them by topic. A spreadsheet and an afternoon is enough; a model can do the first pass of tagging if there are thousands.
You will usually find that a small number of topics make up most of the volume: order status, delivery times, returns, opening hours, pricing, how to do one thing in the product. Mark each topic as one of three:
- The agent can answer it from content or a system lookup.
- The agent can start it, collecting details, then hand over.
- A person should take it from the first message: complaints, refunds outside policy, anything legal or medical.
Scope the first version to the first group. Which conversations should an AI handle has the full list we use.
Step 2: Fix and gather the content
The agent will be exactly as accurate as the content it reads. For each topic in scope, find the page, policy or data that answers it. Then look for problems: two pages that disagree on the return window, a PDF price list from last year, an answer that lives only in one support person's head.
Fix them now. Give each source an owner and a review date. This step often takes longer than any technical work, and it improves the answers your human team gives too.
How do you build it?
Step 3: Set up retrieval over the content
For a few dozen pages, you can send everything in the prompt and use prompt caching so you only pay full price for it once every few minutes. For more than that, use retrieval: split the content into chunks, index them, and on each question fetch the few most relevant chunks for the model to read. RAG explained covers how this works and when it is worth it.
Check retrieval on its own before you look at answers. Take fifty real customer questions and confirm the right passage comes back in the top few results. If it does not, the model cannot answer correctly however good it is. The RAG chunk size calculator helps you choose chunk settings for your document lengths.
Step 4: Write the instructions
The system prompt sets the agent's job. Keep it short and specific. A starting structure:
You are the support assistant for [Company]. You help customers with
[list of topics in scope].
Answer only from the passages provided with each question and from the
results of your tools. If they do not contain the answer, say you do not
have that information and offer to connect the customer with the team.
Never discuss: [restricted topics]. For these, hand over immediately.
Before changing any booking or order, state exactly what you will do and
wait for the customer to confirm.
Keep replies under 80 words. Use the customer's language.
Every token in the system prompt is paid for on every message, so length matters at volume. The system prompt checker flags long prompts and shows what they cost per call.
Step 5: Add actions one at a time
Add actions one at a time, and start with one that only reads: order status, booking lookup, delivery tracking. A read-only action cannot damage anything, and it is usually the most-asked question anyway.
Actions that change records (rescheduling, cancelling, updating an address) come next, each with three safeguards. The agent confirms with the customer before acting. Your code checks the request before running it: the order belongs to this customer, the new slot is within opening hours, the amount is within limits. And every action is logged with its inputs and result. AI agent security covers permissions in more depth.
How do you make it safe to launch?
Step 6: Design the handover
Decide the triggers: the customer asks for a person, the agent cannot find the answer, the topic is restricted, the customer is upset, the same question comes back twice. Decide where the conversation lands: your help desk, a shared WhatsApp inbox, a Slack channel. Pass the whole transcript and a short summary, so the customer does not repeat themselves.
Plan for out of hours. The agent should say when a person will reply, collect what the team needs, and never promise a callback nobody will make. Human handover sets out the rules in detail.
Step 7: Test against real past conversations
Run it against two to three hundred real past conversations, anonymised, plus cases your history does not contain: questions with no answer in your content, off-topic requests, attempts to make it ignore its instructions, angry customers. For each, write down what a correct outcome looks like: the key facts, the action, or a handover. Score every run.
Read the failures and sort them: missing content, retrieval missed the passage, unclear instruction, or a model limit. Fix, then re-run the whole set, because a fix in one place often breaks another. How to test an AI agent before launch describes the method in full.
Step 8: Launch narrowly and review the logs
Narrowly. Pick one channel, or route only out-of-hours conversations, or a share of website visitors, for the first two weeks. Tell customers they are talking to an AI and show how to reach a person.
Then read the conversations. In the first month, read a sample every week: the ones it handed over, the ones where the customer left without a resolution, and a random handful it resolved. Each failure becomes a content fix and a new test case. What a month of AI agent logs taught us shows what to look for.
Which model should run it?
As of October 2026, a small model handles most support turns well and costs very little: Claude Haiku 5.5 and GPT-6 Luna are both listed at US$0.10 per million input tokens and US$0.50 per million output tokens. A mid-tier model such as Claude Sonnet 5.5 or GPT-6.1 Sol, at US$2 and US$10, is worth routing to for questions that need reasoning over several passages. Current prices are on each provider's pricing page, for example Anthropic's. OpenAI vs Claude vs Gemini compares the three providers, and the AI API cost calculator turns your volumes into a monthly bill on each model.
Once the agent is live, compare its deflected tickets against what it costs to run with the chatbot ROI calculator. That number, measured rather than estimated, tells you whether to add the next action.
Was this guide useful?