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.
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
| What | Who | Where |
|---|---|---|
| Access to AI Administration and to the channel's section of the portal | Administrator | Roles |
| A workflow and a channel for the conversations, with a queue and agents who can take them | Administrator | Voice, chat or email first workflow |
| The questions the bot should answer, with your answers | Whoever owns the content | – |
| Voice only: the customer's language is supported for voice bots | Administrator | Voice bot languages |
Email only: an email template that contains the #BotResponse field | Administrator | Email conversational bot response |
| A phone, a page with your chat widget, or a mailbox to test from, and an agent who can log in | Tester | – |
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.
- Go to AI Administration › Knowledge Bases and click Create.
- Enter a Name, for example Returns FAQ.
- 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.
- Click Next.
- 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.
- 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
- Voice
- Chat
A voice bot needs to know the caller's language, and which services turn speech into text and its answers into speech.
- Go to AI Administration › Language Profiles and open the Customer tab.
- Click Create customer language profile, enter a name, choose the caller's Language, and click Next.
- Under Features, select Voice Bot.
- Choose a Speech To Text Provider, a Text To Speech Provider and a Text To Speech Voice Model – the voice of the bot.
- Click Create.
Expected result: Language profile successfully created!
See Voice Bot.
Not needed for chat. Go on to step 4.
Not needed for email. Go on to step 4.
4. Add the Conversational bot to the workflow
To try it without touching a live channel, create a test workflow and a test channel.
- Voice
- Chat
- Go to Voice › Workflows and open the workflow.
- 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.
- Drag from its Then output and choose Conversational bot.
- Paste your instructions from step 2 into Instructions, and choose the knowledge base from step 1 in Knowledge base.
- Under Advanced Configuration, check Used LLM. If the node says the selected model is deprecated, choose another one.
- Go to Chat › Workflows and open the workflow.
- Drag from the output where the bot should take over – for example Start here – and choose Conversational bot.
- Paste your instructions from step 2 into Instructions, and choose the knowledge base from step 1 in Knowledge base.
- Under Advanced Configuration, check Used LLM. If the node says the selected model is deprecated, choose another one.
- Go to Email › Workflows and open the workflow.
- Drag from the output where the bot should take over – for example Start here – and choose Conversational bot.
- Paste your instructions from step 2 into Instructions, and choose the knowledge base from step 1 in Knowledge base.
- Choose the Email template with the
#BotResponsefield. - Turn on Enable draft mode for the first tests. The bot then writes a draft instead of answering the customer, and the Email draft created output sends it to an agent to check and send.
- Optionally, set a Knowledge base confidence threshold. Answers below it leave through Low confidence.
- Under Advanced Configuration, check Used LLM. If the node says the selected model is deprecated, choose another one.
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.
- In the bot node, under Node Output, click Add Output.
- Enter a short Name, for example Agent. This is the label on the node.
- 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.
- 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
- Drag from the Agent output and choose Queue. Set the Routing mode and add an Attribute requirement that your agents have.
- Connect the bot's Failed output too – to the same Queue, so the customer still reaches a person if the bot fails.
- Connect the queue's Agent Disconnected output, for example to End conversation.
- 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.
- 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
- Voice
- Chat
- Call the channel's number and ask a question from the knowledge base.
- Ask something the knowledge base doesn't cover, or ask for a person.
- 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.
- Open a page with your chat widget and start a chat.
- Ask a question from the knowledge base.
- Ask something the knowledge base doesn't cover, or ask for a person.
- Give the order number when the bot asks for it.
Expected result: the bot answers the first question from the knowledge base. For the second, it asks for the order number, then the chat goes to the queue.
- Send an email to the channel's address with a question from the knowledge base.
- Send another one that the knowledge base doesn't cover.
Expected result: with draft mode on, both emails reach the queue with the bot's draft answer. With draft mode off, the customer gets the first answer directly, and the second email goes to the queue.
8. Take the conversation
- Log in to the Agent application as an agent with the queue's attribute, and set your state to Available.
- Accept the task when it arrives.
- 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
- In the portal, go to Realtime Reports › Bots and find your Conversational bot node. It's only listed if it was used today.
- Look at Completed, Failed and Abandoned.
- Go to Historical Reports › Conversations, find the test conversation and click the eye icon.
- 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 this | You should see |
|---|---|---|
| 1 | Ask a question that's in the knowledge base | An answer based on the article |
| 2 | Ask something that isn't in it | The bot doesn't make up an answer; it offers a person or hands over |
| 3 | Ask for a person | The bot asks for the details in Data collection, then the conversation reaches the queue |
| 4 | Take the task as the agent | The conversation reaches the agent; for chat, with the earlier messages from the bot |
| 5 | Open Realtime Reports › Bots | The bot node is listed with your test conversations |
| 6 | Open the decision trace of an answer | A Knowledge Base Search step with the article it used |
If it doesn't work
| Symptom | Likely cause | Fix |
|---|---|---|
| Save is disabled | An output of the bot or the queue isn't connected | Step 6 |
| The bot answers from general knowledge instead of your articles | No knowledge base on the node, or the Tool description doesn't say what the knowledge base covers | Steps 1 and 4. Also consider Enforce Knowledge Base search under Advanced Configuration |
| The bot never hands over | The output's Description doesn't match what customers say, or the instructions don't mention it | Step 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 output | Two outputs match, and the higher one wins | Reorder or sharpen the outputs |
| The bot doesn't ask for the order number | The variable isn't Required, or its description is unclear | Step 5 |
| Voice: the bot doesn't understand the caller, or speaks the wrong language | No Set customer language with Voice Bot before the bot | Steps 3 and 4 |
| Email: customers don't get answers | Draft mode is on, or answers fall below the confidence threshold | Step 4 |
| The bot isn't in the bot report | It wasn't used today | Test again, then check |
Related
Was this page helpful?