Converse AI

Phrases bot does not understand

Using Retrieve Data, Store Data, Maths, Conditional Check & Start Conversation Modules

Introduction

The automation is an amazing success of modern technology but what happens when a human interaction is needed?
Despite Converse can be really smart, there will always be situations when a "human touch" will be needed.
This tutorial will show you how to create a template which is able to handle wrong/unspecific questions/answers and which will redirect the conversation to another template created ad hoc to start an escalation with a Human.

This is a really powerful method which can be used for automatic escalation, to trigger other templates (other built conversations), or even start a conversation via a messaging service such us Workplace Messenger, Intercom, etc).

What is needed?

In the following tutorial we will need the following modules:

Logic behind this conversation

When a user performs a query the bot cannot understand, a "Parser Failure" event occurs. This event can be used, within the same workplace, as a webhook, which will trigger the bot we are building in this tutorial.

In essence, the Parser Failure is used as a sort of "triggering phrase" and will let us activate the right conversation (template).
Please note, in this tutorial I will be leaving the creation of the webhook at the end.

Let's start!

This template is used for when your bot does not recognize what is being said and will start an escalation after two attempts.

Our first state “startstate” is the state where "retrieve data" and "store data" modules are connected too. As this is used only as "starting point", there is no need to fill any of its fields and can be left blank.

Now add a a "Retrieve Data" module and select the option "Request" at the "Storage Location" field.
The field "Name of the DataStore" is the name which will be given to the database which will contain the number of times that the module itself will be used (the number that the Parser Failure event will trigger the conversation).
In this tutorial I gave it the name "retry failures".

Retrieve Data module settings

Retrieve Data module settings

Now add the "Maths - Add Module" which will be used to count the number of attempts the bot does not recognize what is being said (the number of parser failures which occurred).

In the Add field we are entering 1 and in the field "Number" we will add the output from the Retrieve Data module {{states.startstate.utilities.retrieve_data}}.
This means that we are going to add 1 every time we trigger the conversation.

Add - Maths module settings

Add - Maths module settings

Now we need a place where to store our data, so we are going to add the module "Store Data" to our template.
Select the option "Request" as we did in our previous module and enter the same DataStore name we entered previously (for this tutorial we had chosen "retry failures".
The field "Data to Store" is going to be the output field from our “Maths Add Module": {{states.startstate.maths.add}}

Store Data module settings

Store Data module settings

This is how the template should appear so far

Conditional Checks module settings

Conditional Checks module settings

We will have to add 2 states (one for each condition). In this tutorial we named them "more2" and "fail1" as show below

The structure of the Conditional Check

The structure of the Conditional Check

"fail1" will contain our first retry answer "Sorry, I did not understand. Could you please rephrase?"

"more2" will be an empty state which will be linked to our second "More conditional check".
Now add, below "more2", another "More conditional check".
I named it "condmore2" which is the contraction of conditional more 2.
This is the conditional check which will be involved when the counter of the Store Data module will be higher than 1.
The settings of this Conditional checks are shown below

2nd More Conditional Check settings

2nd More Conditional Check settings

This check will provide 2 different outcome: one if the counter has a value of "2" (named "fail2"), which will trigger the second retry answer and another one which will trigger the escalation (named "fail3").

The state "fail2" will contain only our second retry answer "I'm sorry but I didn't understand. Please rephrase once more."

The state "fail3" will be used only to connect the next module so please leave it blank.

fail2 state settings

fail2 state settings

"fail3" is the state where the “start conversation” module will be linked to.
In this case, we are linking it to a conversation called “escalate” (the name of the template that will handle the escalation).

Please note: Before the start conversation module, add another "Store Data" module, which will be used to reset the counter of the fail attempts.

The "Start Conversation module should be set up as follow:

Start Conversation module settings

Start Conversation module settings

This is how the bot should appear

Our bot!

Our bot!

Almost done!

As stated at the very begging of this tutorial, now it's time to link the bot just created to the Parser Failure event. This can be done by the creation of a webhook.
In order to have a fully functional bot we need to provide exactly the same name we gave to the template just created.
As I named this template "Failed - Human", this exact name will have to be added in the field "URL Or Template Name".
The Type of webhook it will have to be set as "Parser Failure" in order to link the webhook to the right event.

To creat a webhook, from your workspace view, click on "Manage" and select the option "WEBHOOKS" as shown below

Here below a screenshot of the webhook created for this tutorial.

Phrases bot does not understand