How to improve your chatbot in 3 simple steps

I have tested hundreds of chatbots and came to realize a key factor to why they fail in user experience. You may be thinking it has to do with the the chatbots purpose or the lack of powerful AI, but thats not usually the case. Actually, many of the chatbots have a very good purpose, and do solve a real problem or pain. 

The main reason these chatbots fail is because of a key element developers miss - Users are expecting to chat with your chatbot, not fill a form.  I will use a Weather Bot called Weabo as an example throughout this post. Lets take a look at the following conversation:

Screen Shot 2017-04-14 at 17.38.30.png

The above conversation usually occurs when your conversation logic looks something like this:

function generate_response(message, current_state) {
  ...
  if (current_state == "zipcode.get") {
    response = "This is not a valid Zipcode. Please try again";
    if (is_valid_zipcode(message)) {
      save_user_zipcode(message);
      response = get_weather(message);
    }
  }
  ...
  return response
}

As much as we would hope so, users don't always follow the conversation flows we as bot developers have designed and expected. For most users this might even be the first time talking to a chatbot. They don’t understand the complexity of NLP/NLU and how fragile a bots understanding can be. So you can’t blame them for doing what they’re supposed to do - simple chat. Thats why you shouldn’t assume specific and strict user input because in many cases the user will be stuck in a infinite loop, lose patience and dump your chatbot. 

Here are 3 steps you can take to significantly improve your conversational experience without much work:

1. Provide small talk context understanding

In my opinion, every chatbot should standardize itself to understand and respond to basic small talk. You don't need to be an NLP or Machine expert to supply small talk to you chatbot. Just get familiarized with one of the many great 3rd party solutions out there such as Api.ai, Wit.ai, Lex, etc… These solutions offer simple out of the box solutions for small talk. So for example if the user asked “What can you do”, you can easily catch that via 3rd party APIs and provide the appropriate response. Check out Api.ai’s solution for small talk which I personally recommend and have found very useful - CLICK HERE.

To summarize thus far, supply small talk understanding for anything from a basic “hello” or “thank you”, to specific questions such as “what can you do?” In my opinion, this shouldn’t take you more than a days work. More strongly, once you’re obligated to provide answers to questions such as “what can you do?”, this will push you to really tighten your bots purpose and understand whats unique about it.

2. Keep your conversation flow logic loose

Conversation states are crucial to any chatbot so if you’re going in that direction - good job. However,  don’t build your flow logic such that you’re expecting a specific and strict answer from users, because thats where you can seriously fail. Instead, loosen your logic and accept the fact that users might decide to deviate from the flow you’ve built.

All you have to do, is reverse your current logic. If you’re expecting a Zip code as input at some conversation state, match the current state with the appropriate response only if you’ve first identified that there’s a valid Zip code in the users input. Otherwise, treat the current user input as a stateless message, ignore the users current state and respond accordingly. Also, take into consideration the retrieved intent from the 3rd party you've decided to integrate. Lets look at a refined example of the flow chart above:

function generate_response(message, current_state, intent) {
  ...
  if (intent == "smalltalk.name.get") {
    response = "My name is Weabo :)";
  } else if (intent == "smalltalk.help") {
    response = "Sure! You can type 'What is the weather in X?'"
  } else if (intent == "weather.get") {
    response = get_weather(message)
  } else if (is_valid_zipcode(message)) {
    if (current_state == "zipcode.get") {
      save_user_zipcode(message);
      response = get_weather(message);
    }
  }
  ...
  return response
}

After implementing this logic, the conversation example above would look like this:

Screen Shot 2017-04-14 at 17.37.50.png

To summarize, try to first understand the intent/meaning of every incoming message, and only in the right cases, match them with users current states and respond accordingly.

3. Redirect unknown intents to what you do know

Lastly, I want to talk focus on unknown intents. Unknown intents are messages that the chatbot did not understand or knows how to respond to. I have identified that between 70%-80% of all users input falls into unknown intents. There are hundreds of blog posts I can write regarding how to improve your bots logic in this case, but for now I’ll focus on one - redirect the user to what your bot can understand. Think of the conversation as a pinball game. The user shoots a ball and your mission is to make sure the ball doesn’t enter the drains. In order to achieve that, is to provide hints and responses of what your bot can understand. For example: “I might understand this in the future. For now, I can tell you the weather. Try this: whats the weather in new york”.

Most users just want to understand your chatbots limits, what it can do, but mostly what it can’t do. The more you assist your users in understanding what your bot can’t do, the less users input will fall into the unknown intents category.

Summary

There is still so much you can do to improve your chatbots conversational experience. Whats important to understand, is the simplicity of significantly improving your chatbots user experience. More importantly, users want to chat, but mostly understand your chatbots abilities and how to improve their relationship with it. Treat the conversational interface as you would treat any basic human to human conversation, and forget what you’ve learned about web/app interfaces.

Last note: If you’re not planning to provide basic free text understanding, consider moving to persistent menus/quick replies. Its better to limit the users expectations at first, rather than to disappoint them.

I hope this post helped you in some way and thank you for taking the time to read it. Feel free to drop a comment if you have any thoughts!