Build an AI Customer Support Assistant That Knows When to Hand Over

A practical design for an AI support assistant: a fast model for routine questions, a stronger one for hard cases, handover to people, and the cost per conversation.

4 min read

use casescustomer supportchatbotclaudegpt

A friendly robot with a headset at a help desk, passing a message card to a person's hand

A support assistant is one of the most useful things you can build with an AI model, and one of the easiest to get wrong. The good ones answer routine questions well, say so when they don't know, and hand the hard cases to a person with the context attached. This guide sets out a design that works and what it costs to run.

The shape of it

  1. Your knowledge in the system prompt: policies, prices, opening hours, the answers to your top questions.
  2. A fast model answers most messages.
  3. Tools let the model look things up: an order's status, a customer's plan.
  4. A rule for handing over to a person, with a short summary for them.
  5. A stronger model for the conversations that need it.

1. Write the knowledge down

The model only knows what you give it. Start a document with:

  • What you sell, who your customers are, and the tone you want.
  • Policies, word for word: refunds, delivery, cancellations.
  • The 30 questions your team answers most, with your best answers.
  • What the assistant must never do: promise refunds, give legal advice, guess an order's status.

Keep this text the same from request to request and put it first. Every message in every conversation starts with it, so it is read from cache at the lower cached price instead of the full input price.

If your knowledge is too large for the prompt (a big help centre, a product catalogue), search it first and send only the relevant articles with each question.

2. Pick a fast model for the routine

Most support messages are simple. A fast, low-priced model answers them well and keeps the reply time short:

RoleTry first
Everyday repliesclaude-haiku-5-5, gpt-6.1-terra or gemini-3.8-flash
Hard cases and complaintsclaude-sonnet-5-5 or gpt-6.2-sol

Stream the reply (stream: true) so the customer sees the answer start at once.

3. Give it tools, not guesses

Never let the model make up an order's status. Give it a tool and let it ask:

python
tools = [{
    "type": "function",
    "function": {
        "name": "get_order",
        "description": "Look up an order by its number",
        "parameters": {
            "type": "object",
            "properties": {"order_number": {"type": "string"}},
            "required": ["order_number"],
        },
    },
}, {
    "type": "function",
    "function": {
        "name": "hand_over",
        "description": "Pass the conversation to a person",
        "parameters": {
            "type": "object",
            "properties": {"reason": {"type": "string"}, "summary": {"type": "string"}},
            "required": ["reason", "summary"],
        },
    },
}]

When the reply contains tool_calls, run the lookup in your code, send the result back as a role: "tool" message, and ask for the next reply. The same tool definitions work with every chat model on API Store. Streaming and tool calls walks through the loop.

4. Decide when to hand over

Write the rules into the system prompt and give the model the hand_over tool above. Good rules:

  • The customer asks for a person.
  • The customer is upset, or has written three times about the same problem.
  • Money is involved beyond your policy: refunds, disputes, chargebacks.
  • The answer isn't in the knowledge you gave it.

The summary argument means your agent starts with "Customer wants a refund for order 4821, delivered damaged, photo attached" instead of reading the whole chat.

5. Move hard conversations up a tier

You can switch model in the middle of a conversation: the messages are the same, only the model string changes. Common triggers are a complaint, a long conversation, or the fast model calling hand_over with "not sure". Sending those few conversations to a stronger model costs little, because they are a small share of the total.

What a conversation costs

A typical support conversation is 4–8 messages. Each request sends the system prompt plus the conversation so far, so input grows with every turn:

  • System prompt and knowledge: say 6,000 tokens, mostly read from cache after the first message.
  • Conversation: a few hundred tokens per turn.
  • Replies: 100–300 output tokens each.

With Claude Haiku 5.5, the cached part is billed at $0.007 per million tokens, new input at $0.07 and replies at $0.35. Multiply out your own numbers, or run a day of real conversations on a test key and read the total on the Usage page.

Give the support assistant its own API key with a daily spending cap, so a loop or a flood of messages can't run up a surprise.

Measure it

Track three things from the first week: the share of conversations resolved without a person, the share handed over, and customer ratings of the bot's answers. Read twenty handed-over conversations a week. Most improvements come from adding a missing answer to the knowledge, not from changing the model.

Also in Tiếng Việt, Español, Português, Bahasa Indonesia