Skip to main content

Set up and test an AI bot that hands over to an agent

When this is done, an AI conversational bot answers your customers' questions from your knowledge base. When it can't help, or the customer asks for a person, it collects the details you need and hands the conversation to an agent, who sees what the customer and the bot already said.

Customer starts a chat, calls or emails
→ the Conversational bot answers from the knowledge base
→ the customer asks for a person, or the answer isn't in the knowledge base
→ the bot asks for the details you need (for example an order number)
→ the bot leaves through its Agent output and the conversation goes to a queue
→ an agent takes it, with the bot conversation in front of them

It takes about 45 minutes. Roles involved: Administrator (Part 1), Agent (Part 2), Supervisor (Part 3).

The steps are the same for voice, chat and email except where the tabs show the difference. Pick your channel once – the other tabs on the page follow.

Test before customers see it

AI bots can give wrong answers in a convincing way. Test the bot with real questions, read the answers and refine the instructions before you put it on a live channel. See Controlling AI processes.

Before you start​

WhatWhoWhere
Access to AI Administration and to the channel's section of the portalAdministratorRoles
A workflow and a channel for the conversations, with a queue and agents who can take themAdministratorVoice, chat or email first workflow
The questions the bot should answer, with your answersWhoever owns the content–
Voice only: the customer's language is supported for voice botsAdministratorVoice bot languages
Email only: an email template that contains the #BotResponse fieldAdministratorEmail conversational bot response
A phone, a page with your chat widget, or a mailbox to test from, and an agent who can log inTester–

Part 1 – Set it up (Administrator)​

1. Create the knowledge base​

The knowledge base holds the questions and answers the bot uses. Without one, the bot only has its instructions and general knowledge, and its answers can be too generic.

  1. Go to AI Administration › Knowledge Bases and click Create.
  2. Enter a Name, for example Returns FAQ.
  3. Leave Tool name and Tool param name as they are. Finish the sentence in Tool description so it says what the knowledge base covers, for example …Use this when the customer is asking about returns, refunds or delivery times. The bot reads this to decide when to search the knowledge base.
  4. Click Next.
  5. Click Add › Add entry, type a Question and its Answer, and click Add. Repeat for each article. To add many at once, use Add › Bulk import entries with a CSV file.
  6. Click Create.

Expected result: Knowledge base successfully created! and the knowledge base is in the list.

Write each answer as a full sentence that repeats the question – "You can return an item within 30 days of delivery", not "30 days". See Knowledge bases.

2. Write the bot's instructions​

Write the instructions before you open the workflow. They tell the bot its role, its tone, what it must not do, and when to hand over. For example:

You are a support assistant for an online shop. Answer questions about returns, refunds and delivery using only the knowledge base. Keep answers short and polite. If the answer is not in the knowledge base, or the customer asks for a person, use the Agent output.

Expected result: a short text that names the bot's job, the topics it covers and when it hands over. Read Controlling AI processes before you go on – the quality of the instructions decides the quality of the answers.

3. Voice only: create a customer language profile for the bot​

A voice bot needs to know the caller's language, and which services turn speech into text and its answers into speech.

  1. Go to AI Administration › Language Profiles and open the Customer tab.
  2. Click Create customer language profile, enter a name, choose the caller's Language, and click Next.
  3. Under Features, select Voice Bot.
  4. Choose a Speech To Text Provider, a Text To Speech Provider and a Text To Speech Voice Model – the voice of the bot.
  5. Click Create.

Expected result: Language profile successfully created!

See Voice Bot.

4. Add the Conversational bot to the workflow​

To try it without touching a live channel, create a test workflow and a test channel.

  1. Go to Voice › Workflows and open the workflow.
  2. Drag from the output where the bot should take over – for example Start here – and choose Set customer language. Choose the profile from step 3. The node lists Voice Bot under the profile's features.
  3. Drag from its Then output and choose Conversational bot.
  4. Paste your instructions from step 2 into Instructions, and choose the knowledge base from step 1 in Knowledge base.
  5. Under Advanced Configuration, check Used LLM. If the node says the selected model is deprecated, choose another one.

See Conversational bot (voice) and Set customer language.

Expected result: the node shows your instructions and knowledge base. Its Failed output is red: it still has to be connected.

5. Add the handover output​

Outputs are how the bot leaves the conversation. Add one for the handover to an agent.

  1. In the bot node, under Node Output, click Add Output.
  2. Enter a short Name, for example Agent. This is the label on the node.
  3. In Description, say when the bot should use it, for example The customer asks to talk to a person, or the answer is not in the knowledge base.
  4. Optionally, under Data collection, type a variable name, for example orderNumber, and click Add. Give it a Description the bot can follow (The customer's order number, if they have one), tick Required if the bot must get it before it hands over, and choose the Type.

Expected result: the node has a new output named Agent, in red until it's connected. Variable names are saved in lower case.

If you add more outputs, the bot checks them from the top: if two match, it uses the higher one. See the outputs in Conversational bot.

6. Send the handover to a queue and save​

  1. Drag from the Agent output and choose Queue. Set the Routing mode and add an Attribute requirement that your agents have.
  2. Connect the bot's Failed output too – to the same Queue, so the customer still reaches a person if the bot fails.
  3. Connect the queue's Agent Disconnected output, for example to End conversation.
  4. Email only: connect the node's other outputs too. With draft mode on, Email Draft Created replaces Email Sent – send it to the queue. If you set a confidence threshold, send Low confidence to the queue as well.
  5. Click Save.

Expected result: Workflow successfully updated! If Save is disabled, an output isn't connected – look for a warning triangle on a node. See Saving a workflow.

If the bot should look up data or run tasks in your systems, such as an order status, add Bot tools later and select them in the node's Integrations.

Part 2 – Talk to the bot and take over (Agent)​

7. Test the bot as a customer​

  1. Call the channel's number and ask a question from the knowledge base.
  2. Ask something the knowledge base doesn't cover, or ask for a person.
  3. Give the order number when the bot asks for it.

Expected result: the bot answers the first question from the knowledge base, in the profile's voice. For the second, it asks for the order number, then the call goes to the queue.

8. Take the conversation​

  1. Log in to the Agent application as an agent with the queue's attribute, and set your state to Available.
  2. Accept the task when it arrives.
  3. Continue the conversation. In a chat, read what the customer and the bot already said first.

Expected result: for chat, the task shows the earlier messages with the bot, so the customer doesn't have to repeat themselves. For email in draft mode, the bot's draft is ready to check, edit and send.

See Respond to chats, Handling inbound calls and Respond to emails.

Part 3 – See how the bot did (Supervisor)​

9. Check the bot report and the decision trace​

  1. In the portal, go to Realtime Reports › Bots and find your Conversational bot node. It's only listed if it was used today.
  2. Look at Completed, Failed and Abandoned.
  3. Go to Historical Reports › Conversations, find the test conversation and click the eye icon.
  4. Click one of the bot's messages, labelled AI.

Expected result: the report counts your test conversations. The decision trace lists what the bot did for that answer – the Knowledge Base Search with the articles it found, and the prompts it used – with how long each step took.

See Bot reports and Conversational bot decision trace.

Check that it works​

#Do thisYou should see
1Ask a question that's in the knowledge baseAn answer based on the article
2Ask something that isn't in itThe bot doesn't make up an answer; it offers a person or hands over
3Ask for a personThe bot asks for the details in Data collection, then the conversation reaches the queue
4Take the task as the agentThe conversation reaches the agent; for chat, with the earlier messages from the bot
5Open Realtime Reports › BotsThe bot node is listed with your test conversations
6Open the decision trace of an answerA Knowledge Base Search step with the article it used

If it doesn't work​

SymptomLikely causeFix
Save is disabledAn output of the bot or the queue isn't connectedStep 6
The bot answers from general knowledge instead of your articlesNo knowledge base on the node, or the Tool description doesn't say what the knowledge base coversSteps 1 and 4. Also consider Enforce Knowledge Base search under Advanced Configuration
The bot never hands overThe output's Description doesn't match what customers say, or the instructions don't mention itStep 5 – describe the situation in plain words, and refer to the output in the instructions
The bot hands over too early, or through the wrong outputTwo outputs match, and the higher one winsReorder or sharpen the outputs
The bot doesn't ask for the order numberThe variable isn't Required, or its description is unclearStep 5
Voice: the bot doesn't understand the caller, or speaks the wrong languageNo Set customer language with Voice Bot before the botSteps 3 and 4
Email: customers don't get answersDraft mode is on, or answers fall below the confidence thresholdStep 4
The bot isn't in the bot reportIt wasn't used todayTest again, then check