What is Intent Chaining? Why is it Important in Bot Building?

Sep 24, 2019 | Blog

Share this post

What is Intent Chaining? Why is it Important in Bot Building?

Today, customer service stands as a key differentiator between brands. And companies are using chatbots to optimize CX and offer better, quicker, and more intuitive services to their customers. Gartner predicts that by 2020, 85 percent of all customer engagement will happen via chatbots.

To infuse the element of intuitiveness into chatbot conversations, we need to identify the user intent through the bot. Intent recognition thus plays a critical role in polishing and optimizing all conversations that happen between users and chatbots. Before we delve deep into intent chaining, let’s look at what intent identification means and the various concepts it involves.

Intent Identification

The first step in planning a chatbot platform is identifying customer needs- what they’d like to accomplish through the bot, and defining what you want your chatbot to service. When a customer interacts with a chatbot, the bot should be able to determine the correct intent from a list of utterances. The intents you identify and program into the chatbot will determine the dialog flow you need to create.

Intent: An intent is a goal or purpose behind a user’s input to a chatbot.

An entity represents a term or an object in the user’s input that provides clarity over the context for a particular intent.

Intent identification should be integrated into chatbots, considering the evolution of conversations over time. Without proper intent programming, a chatbot will not evolve as per the future requirements and will stay stuck. The chatbot might become less usable in the future when it lacks proper intent identification. When a bot developer adds intents in a chatbot depending on the current and not projected future requirements, the bot might become unstable, give abnormal answers, or respond with repeated intents.

Here’s an example that illustrates this condition:

When we try to build a bot that controls home appliances, below are the possible user utterances.

Turn Off the lights in the living room.

Turn Off the lights in the bedroom.

Turn Off the Television in the living room.

Turn Off the air conditioner in the living room.

Turn on the bed lamp in the living room.

In the above list of utterances, we can create intents depending on the state mentioned such as On or Off, or we can do the same in the context of the said room.

Thus, in this situation, we can create intents such as Turn On and Turn OFF, or according to the area (such as the living room, bedroom, etc). Our decision for intent identification should consider possible future requirements.

Now that we’ve established what intents are, let’s talk about another vital concept in coding and programming- Modularity. It involves building the application in several modules. It is a well-known best practice’ to avoid code repetition, which can be achieved using modules that can be minimally changed for reuse. This practice reduces the amount of coding effort and code volume. We encourage you to religiously follow this coding practice for better and efficient code. Modularity comes into play at the prospect of code repetition, a possibility when chatbot building intents.

Let’s consider an example of intent repetition. Let’s say we are building a doctor’s appointment bot. We now have multiple requirements to check and reflect in our chatbot.

Check doctor’s availability,

Register a doctor,

Register a patient before booking an appointment.

This is not a comprehensive but simplistic list of intents. But, even in this minimal version, you can spot repetition: registering a doctor and registering a patient. Registration can be deemed as one module, which can be reused for both cases with some minor differences in the backend code.

Once we spot such repetitive occurrences, we can plan to eliminate them and reduce the chances of instability in our bot so that it works as expected, efficiently. Before looking at intent chaining, a vital concept in chatbots programming, let’s look at a specific class of intents that lays the groundwork for an intent chaining to happen.

Coherent Intents:

Coherent intents are nothing but intents that appear independent but actually rely on each other beneath the surface. In the case of the doctor’s appointment bot, we had different intents such as appointment scheduling, patient registration, etc. Scheduling an appointment and registering a patient seems two different intents externally. But, look closer, and you realize that for scheduling an appointment, we would first need to check whether or not a patient is registered. This is precisely why these two intents can be termed as coherent intents.

Intent Chaining:

Intent chaining helps us make our chatbot smarter by adding a pinch of complexity so it can successfully tackle the real-world use cases.

While fulfilling an intent, a chatbot might need some extra information from the user, for which it might need to shift to another (coherent) intent, get the desired result, and restart executing the previous intent from where it left off. The key idea here is to maintain the state of the bot where it needs to be while switching between intents. This is called Intent Chaining in Bot.

Intent chaining can happen within two scenarios:

  • Shifting an intent before completing the current intent.
  • Shifting an intent after completing the current intent.

Here’s how Intent Chaining works:

While booking an appointment through the doctor appointment chatbot, the patient will first check the availability of the doctor and then attempt to schedule an appointment. When this happens, in the backend, the system will check whether the patient is registered or not. If they are, the appointment slot will be booked.

If not, the intent chaining helps us achieve both tasks without losing the state. Here, when the patient tries to book an appointment, they provide their preferred date, time, etc. In the end, the chatbot will internally check the patient’s registration status. In case the patient is not registered, the backend system saves the previous state in an object and shifts the intent to the patient registration module to first allow them to complete the registration process. After that, the chatbot will check the saved state object and fulfill the said task, which is booking an appointment with the doctor.

Let’s understand this concept through a second scenario:

Let’s consider an instance where a user wants to book a hotel. To accomplish this task, the user provides the necessary information such as the location, date, time of travel, etc. Even in this case, intent chaining helps us provide a better customer experience. As the user tries to confirm the booking through the booking intent, the bot stores all the provided information in an object and prompts the user to book a cab without asking the destination or the time. Here, the bot reuses information from the previous object, prompts the source station, and confirms the cab booking. Here, intent chaining helps us achieve hotel booking and cab booking immediately without prompting the user to submit the same information again.

This is precisely how intent chaining helps us improve the customer experience offered through a chatbot. Without intent chaining, we just might be using contact forms over and over again, without leveraging technology at its full potential.

Similar blog post