Handling a Topic Switch in Teneo

Handling a topic switch in Teneo

During a normal conversation with a friend, you’ll effortlessly move from one topic to another without even thinking about the complexities that may involve. One minute you’re discussing how each other’s work day was, the next you’re talking about politics or the impact of climate change.

Sure, if you go from talking about your new smartphone to talking about how to grow tomatoes in an urban garden, then your friend may struggle to see the link between the topics, but that will not block the conversation and your friend will probably ask about your gardening skills, before going back to the topic of the new smartphone. The same can happen when a customer calls in to get information about your products: while asking about the details of a product, they may jump to asking about your opening hours.

When designing and building your Conversational AI assistant, you want to give your assistant the same opportunities to respond and react to a change of topic during the conversation. When your use cases are deep, multi-step processes that may get interrupted by the user, you will want to design with interruption in mind.

Changing the topic in Teneo

The good news is that in Teneo, changing the conversation topic is always allowed. Because nobody wants to be stuck in an infinite loop of repeated answers where the assistant tries to push the user down that one possible path in a conversation tree. When you build a multi-step flow in Teneo, the option to change topic is the inherent way dialogue is managed. Your users are always allowed to ask any other question they might have in the middle of any process they are in, e.g., it could be that your user realizes that s/he needs additional information to progress, or simply that the triggered intent was actually not what the user had in mind.

Like in the below scenario. If you are interested in purchasing a product, you may have complimentary questions that will help you decide on the appropriate model before submitting the order.

The assistant understands the new question, provides the response to that question, and then returns to the previous topic, at the exact point where the conversation was left off, without losing track of any information that the user had previously provided .

How does Teneo know that the conversation topic has changed?

Technically, the change of topic happens because the user input does not match the requirement on the next transition in the flow. In a multi-step flow in Teneo, the conversation progresses via transitions and a transition that waits for a user input can contain its own set of match requirements that the next user input must match. When those requirements are not met, the Teneo engine understands that it needs to look for a match outside the current flow.

In the scenario above, the user input “what does the plus cost?”, does not fulfill the requirements of the TLML Syntax match on the transition named “Model”.

TransitionWithMatchRequirement

The behavior can be illustrated as below: after Output 1 is returned to the user, the user provides a new input which does not match the requirements on the transition leading away from the output node “Output 1”. When that happens, Teneo Engine takes the user input and starts looking for a matching trigger in the pool of triggers, and, in this case, the trigger match requirements of Flow 2 matches the user input.

FlowInterruption

Revisit the previous conversation topic

When you design and implement the conversations of your Teneo Conversational AI assistant, you have the option to decide if and how many times the user should be taken back to the initial topic after the digression. The behavior is controlled on each output node where you can disable or enable the option Allow output to be revisited and define the number of revisits.

ResumePrompt

When the option to revisit is enabled, what will happen can be illustrated as below: After providing the user with the output from Flow 2, Flow 1 is resumed at the point where the conversation dropped off.

FlowResumption

In general, the recommendation is to allow for the outputs to be revisited when the multi-step process is a business-relevant process. Typically, those processes involve recollection of several pieces of information in order to reach a resolution, and dropping out of these processes unintentionally and losing all provided information would most likely lead to a frustrated user with a bad user experience.

The default number of revisits is 2, which is what our experience tells us is a reasonable number. The number of revisits can be adjusted to different use cases, keeping in mind always that the user should never be kept too long in a loop for no strong reason as this would also go in detriment of the user experience.

Add a Resume Prompt

When you take your user back to the previous conversation topic, it can also be a good idea to add a Resume Prompt to explicitly remind the user of the conversation topic that is being resumed.

Resume Prompts can be added either on the individual output node, which allows you to be very specific in the message, or they can be added on a flow level in which case they need to be a bit more generic. If you do not add any Resume Prompt, it is not a problem – in this case, the regular output text will simply be reused.

OutputResumePrompt

Have a look at the examples below that illustrates the differences in the response that the end user will see when the output is revisited:

Without resume prompt, the regular output text is reused

With a flow resume prompt, the resume prompt is prepended to the regular output text

With an output resume prompt, the resume prompt is the sole output text.

How does Teneo manage this under the hood?

From a conversation perspective, we talk about this as interrupting and resuming a conversation topic. Under the hood, the logic is handled by what is called the flow stack. The flow stack is that engine logic that keeps track of all the flows that are currently active in a conversation, which includes flows that have been paused due to an interruption and should be revisited.

In Tryout, we can see the logic of the flow stack with the icons below:

FlowStackIconsInTryout

In runtime, this means that we can have 2-3-4-5… flows on the stack at the same time, and the engine will deal with the logic by working its way backwards through the flow on the stack, until the stack is again empty.
FlowStack

In this page you can find the full details about the mechanisms of the flow stack: The stack of active flows.

Summary

Naturally flowing conversations with a Conversational AI Assistant should allow for an unexpected change of topic. With Teneo, the possibility is intrinsic to the way the dialogue is managed. On top of that you have the option to decide when and how many times you want to take the user back to a previous conversation topic by enabling the Revisit functionality, and you can make the resumption of the previous conversation topic very smooth by adding Resume Prompts that guide the user back to where the conversation was left off.

What is your experience with changes in the conversation topic when building virtual assistants? Tell us in the comments.

3 Likes