Class 8: How to create a Context


Creating different contexts and categories will allow you to show different set of responses and scripts based on the previous messages received. The chatbot will take into account the history and current context of the conversation before providing a response.

There are two ways you can configure the context of a bot. Based on the number of interactions the conversation is on, or based on the content of the messages your chatbot has received.

Based on interactions

You can trigger scripts based on the number of interactions of a conversarion. For example if you need to direct the conversation towards some goal such as qualify a potential client, or get some important information from the user you can trigger a specific script after the chatbot has passively responded questions.

Go to DataBase> Context and activate Context.

Scroll down to ACTIVATE COMPONENTS AND SCRIPTS and select the script you want to load after a specific number of interactions.

Save our changes. Now your chatbot will now trigger specific scripts after a number of interactions.

Based on inactivity

You can trigger scripts based on a given time of inactivity from your users. For example if you want to request feedback or you want to offer an additional product or service.

You can select to trigger a script after 30 minutes, 1, 6, 12 and 24 hours of inactivity from the user. Available channels for this function are WhatsApp, Facebook and WeChat.

Based on Context

Creating Context categories is a good way to increase the complexity of your chatbot in case you need to provide similar information on different products or services.

For example, let's imagine we have trained a chatbot for a car dealership. The responses of the chatbot should vary depending on the car brand and model a client is interested in.

In this case you can create a new context for your models, and when a user asks about a specific model, you can load the context for that model and respond only about that model.

Creating a new Context

To create a context navigate to DataBase > Context. In this section you will find all settings related to setting and triggering specific actions for certain contexts.

Scroll to Create new Context Category, enter your new context name and press Add.

You can create as many contexts as you want. In the case of a car dealership, creating a context for each model is a good idea. In case you are a Marketing Agency, if you provide CPC Campaign services and Website Development, create a context for each of your services.

Creating a new context will take you to the "Tag" section. Here you can tag your current responses to trigger the context you just created.

By tagging a message, you are telling the chatbot that the context of the conversation has changed and it should favour responses of that context. For example, your user starts a conversation with the chatbot, asks some general questions about your business and then starts asking specific questions about a product or service.

This is a good oportunity to change the context of the conversation towards answers that are only related to that product.

Let's take the car dealership example. To tag questions to trigger the "Audi" context mark your current answers by searching them on the table and pressing "Tag". In this case only the questions about "Audi" cars will trigger the new context.

Now navigate to DataBase> Responses. Here you will find your current response templates. A new navigation bar will appear on top with all your context categories. You can switch between your categories here and train your chatbot for the contexts you have created.

Click on your context to start adding responses for that context. This will take you to a similar page but with your context highlighted on the navigation bar.

This page will load the new set of response templates for your context. Start adding new messages for the context "Audi" and save.

For example you can add: "What colors do you have", "what is the warranty" or "what is the base price". You will have similar questions for your other models so loading a specific set of responses for Audi is a good choice.

Edit a Context

To edit a context go to DataBase > Context. A list of your current contexts will appear. Press the tag icon to add more triggers for that context or the trash icon to delete it.

You can use context categories to increase the complexity of your chatbot, and to categorize your responses depending on a context a user has triggered.

Would you like to know more?

Get more information