There are a couple of useful tricks to make your chatbot the smartest bot in class. ChatBot can remember what intents the customer has visited and also choose a reply randomly from a few options.
Using your chatbot's memory
Sometimes you will want the chatbot to remember what it has already said to the customer. Since the chatbot tracks which intents it has used in each conversation, you can make use of that memory to control the flow of the conversation.
You can add necessary conditions or triggers to your intents to check whether the customer has visited particular intents or not.
As an example, say you want to offer your customers a chance to subscribe to a newsletter. You would likely create intents which contain a prompt for the newsletter, and if they accept, other intents to gather the customer's information, sign them up and say thank you.
In other intents, not directly relating to the newsletter:
- Check if the customer has been offered the newsletter with the rule Has Visited Intent. If so, they don't need to be offered it again.
- If the conversation is coming to an end and the customer Has Not Visited Intent where they are offered the newsletter, now would be a good time to trigger that intent.
- The rule Came from Intent lets you trigger an intent immediately after the customer subscribes to the newsletter, perhaps you have some welcome offers to let them know about.
Applying the rules
In Studio, when creating or editing an intent, you can, for example:
- Click the Add necessary condition button.
- In the Select rule dialog, choose the rule you wish to use.
- Click the state (or last_state for the Came from intent rule) drop-down list, and select the intent you want to check.
- Complete the rest of the intent's details as normal.
Came from intent
The Came from intent rule is stricter than the Has visited intent rule. Has visited intent will check to see if the intent in question was used at any point in the current conversation. Came from intent only checks the most recent previous intent.
Varying the chatbot's responses
If there are intents that the customer might visit several times in the same conversation, you can create alternative replies in those intents. Doing so will keep the conversation fresher and less robotic for the customer, and make you bot just a little smarter.
When completing the then bot replies field for an intent, you can create alternative replies by separating them with the | symbol. When the intent with these replies triggers, the bot will randomly pick one of the replies to use.
If the customer end up in a loop, they won't get the same response every single time.