Back to Blog

How to handle the Unknown: What to do when your chatbot fails?

People are not perfect, the same goes for chatbots. Even though you spent a decent amount of time on designing, testing and you are using advanced Deep Learning techniques, your bot will fail. Make sure to prepare your bot with a decent fallback and set up an environment so that you can learn from these failures. In this article we will show you:

Best Practices: handling the unknown

Chatbot Fallback

What do you, as a person, do when you are prompted with a question that you don’t know the answer to? Well, those steps are quite similar to the process of chatbot.

1. Acknowledge failure

As your parents told you not lie, you will be honest and acknowledge the “failure”. Same goes for your bot. When your bot has no clear answer to question you can start with acknowledging the failure with something like “Sorry, I didn’t quite get that”.

2. Propose a solution or workaround

Now, we’ve acknowledged the failure but there is no solution at all. So our bot is definitely not helpful. Always try to propose a solution. 3 Common solutions that will be discussed in the next section are:

3. Gather and process feedback

Now, we’ve proposed a solution but still, how do we know if that answer is satisfying? Simply ask for it. A question like “Was I able to help”, followed by a thumbs up or thumbs down button can do the job.

This is a great opportunity to learn how you can improve your bot. Read more about it in our article about The Feedback Flow.

3 Ways to handle the Unknown

Allright, that’s that part. Now we can start building actual solution for our bot to handle the Unknown. You can use one or a combination of the following techniques to handle situations that are not known to your chatbot. It all depends on your case and available resources and agents.

1. Rephrase and show topics

A simple solution is to ask the user to rephrase their question. Even though this solution seems simple, it can be very effective. In addition to rephrasing you can also show topics within Quick Replies.

Rephrase or show topics

2. Handover

A second solution is to hand the conversation over to a human agent. Agents are very good at understanding complicated questions and answering those out of the box. Acknowledging failure is optional in this scenario. It’s does not add any value and there will be a person following up anyway.

Two common handoff scenarios to consider are:

Following up with livechat or creating tickets in a CRM all depends on your existing process and available resources and tools that you are using like Hubspot, Salesforce or Freshdesk.

Zapier is a great tool that you can use to connect your bot with many other solutions. Read more about how you can improve your chatbot by using Zapier.

Chatbot handover when unknown

3. Extract topics

A third solution is trying to extract topics that the bot is trained for. When the bot is not able to recognize a topic we can still hand the conversation off to a human colleague.

To set this one op we’ll first need to transfer the input of the user into a parameter. You can do that with an Action with the following code that will create a parameter with the name “query”. The value of this param will be equal to the input of the user.

async payload => {
  return {
    params: {
      ...payload.params,
      query: [{
        value: payload.query
      }]
    }
  }
}

With our new param in place we can follow up with Conditions to see if there are topics or words that we recognize. If there are topics that we recognize we can show the user how the bot is able to help him with that topic.

Extract topics when unknown
Get StartedContact us