1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Train – NLP Optimization
  5. Bot Intelligence
  6. Interruption Handling and Context Switching Between Intents

Interruption Handling and Context Switching Between Intents

Natural conversations often tend to go beyond linear intent resolution paths defined in the bots. Ideally, a user would allow the bot to take a user intent to its logical conclusion before initiating another, but that’s not always the case. Consider the following conversation for example:

It includes an entity value for the bot to proceed with the current intent, while also presenting a new user requirement or intent.

Kore.ai enables developers to handle such interruptions in intent flows by providing a whole range of options to define the task-switching experience. The Hold and Resume options, as the options are referred to as, can be set up at the bot, task, and node levels to ensure the configurations are layered to suit your various business requirements. You can also add conditional exceptions between tasks with the ability to pass contextual data between them.

The following sections describe the various Hold & Resume configurations, the hierarchy of the setups at bot, task, and node levels and also how to define conditional exceptions and pass data between them.

You can configure the Hold & Resume options from Natural Language -> Intelligence -> Manage Interruptions

Hold and Resume

The Hold & Resume options allow you to select if and how a user can switch to another task and whether to get back to the previous tasks later. The platform provides several options for Hold and Resume under the following three categories:

  • Allow Hold and Resume: Provides options for you to choose for holding a task and options to resume it later.
  • Do not Allow Hold and Resume: Stops new tasks from interrupting the current task. The bot doesn’t keep the interruption task in the FollowIntents array.
  • Allow the End User to Select the Behavior: Seeks end user confirmation to switch to a new task and provides several resume options for you to pick from.

Below is the list of available choices along with their descriptions.

Allow Hold and Resume

Following are the options, descriptions, and examples under Allow Hold and Resume

Hold the current task and resume back once the new task is completed

This option lets the bot to switch to a new intent as soon as it is detected irrespective of the current intent flow while providing further choices for you to define how to resume the on-hold task later. When you select this option, the Resume Options section appears for you to select. Refer to Resume Options section below for descriptions.

Discard the current task and switch to new

When you select this option, the bot discards the current task and switches to a new task soon after it encounters another intent. The bot sends a message to notify the user before switching to the new task. You can customize the message by clicking Manage Response.

Switch to new task without any notification to user and discard current task

When you select this option, the bot discards the current task and switches to a new task soon after it encounters another intent. The bot doesn’t notify the user about the switch and the doesn’t resume the current task later.

Continue with the current task and add new task to the follow-up task list

When you select this option, the bot continues on the current task even if it encounters a new intent. It, however, adds the new intent to the Follow-up intents array. Refer to Follow-up Intents section below for more information.

Do not Hold and Resume

When you select this option, the bot level Hold & Resume is turned off. However, the developers may override this behavior for selected tasks, linked dialogs (exceptions) or node level. Refer to the Hold and Resume Hierarchy section below for more information.

Allow the End User to Select the Behavior

When you select this option, the bot presents the end user with a confirmation message asking if the user would like to switch to a new task. The bot switches to the new task only if the end user chooses to do so. You can customize the confirmation message sent to the user by clicking the Manage Response link next to the option.

You need to define a Resume Option that the bot should take if the user decides to switch the task.

Resume Options

Option Description
Get confirmation with the user before resuming an on-hold task After executing the new task, the bot gives Yes or No options to the user to return to the last on-hold task. You can write a custom message for the user by clicking the Manage Response link next to the option.

Example:

User: Hi
Bot: Hello!
User: Can you book me a flight for tomorrow?
Bot: From which city are you flying?
User: Los Angeles
Bot: Where to?
User: By the way, what’s the weather forecast for tomorrow?
Bot: Please enter the name of the city for the forecast.
User: Los Angeles
Bot: Weather Forecast for Los Angeles
Date: March 15
Temperature: 25 C
Condition: Mostly Sunny
Bot: Should I continue with the task 'Book Flight'?
User: Yes
Bot: Enter the name of the destination airport
Notify the user with a message that the on hold task is being resumed Notifies the user with a message and resumes the last task that’s kept on hold without user confirmation.

You can customize the notification message by clicking the Manage Response link next to the option.

Example:

User: Hi
Bot: Hello!
User: Can you book me a flight for tomorrow?
Bot: From which city are you flying?
User: Los Angeles
Bot: Where to?
User: By the way, what’s the weather forecast for tomorrow?
Bot: Please enter the name of the city for the forecast.
User: Los Angeles
Bot: Weather Forecast for Los Angeles
Date: March 15
Temperature: 25 C
Condition: Mostly Sunny
Bot: Resuming interrupted task Book Flight
Bot: Enter the name the of the destination airport
Resume the on hold task without any specific message to the user Directly resumes the last task that’s kept on hold soon after the current task is executed.

Example:

User: Hi
Bot: Hello!
User: Can you book me a flight for tomorrow?
Bot: From which city are you flying?
User: Los Angeles
Bot: Where to?
User: By the way, what’s the weather forecast for tomorrow?
Bot: Please enter the name of the city for the forecast.
User: Los Angeles
Bot: Weather Forecast for Los Angeles
Date: March 15
Temperature: 25 C
Condition: Mostly Sunny
Bot: Enter the name the of the destination airport
Always resume the on hold task without any specific message to the user if the task is ended in a single response Sometimes, the switched over tasks end with a single bot response. For example, in the weather forecast example above, if the user had directly entered “By the way, what’s the weather forecast for LA tomorrow?”, the bot would’ve merely responded with the forecast, with no further steps.
In such cases, if you select this option, the bot switches back to the task on hold without any confirmation or notification, regardless of the option you’ve chosen.

Note: The switching happens directly, without any notification to the end user.

On Hold Quantity

You need to select the number of tasks that you want to keep on hold at once in the On Hold Quantity field. When you select a number, the bot keeps a maximum of those many tasks on hold regardless of any option you choose above. For example, if you specify the On Hold Quantity as 1 and if a third intent comes into play, the bot wouldn’t allow the new task to be initiated regardless of Hold and Resume options.

Note: Tasks always resume in the reverse chronological order. So, if you kept task 2 on hold after task 1, task 2 resumes before task 1.

Hold and Resume Hierarchy

Apart from defining the generic Hold and Resume options at the bot level, developers can customize these options at Dialog task or Dialog node level. When you set up the Hold and Resume options in more than one levels, the order of precedence of the settings works as follows:

Node Level Hold and Resume Settings

You can customize the Hold and Resume settings at a node level. If you customize the settings for a node, the configurations here take the highest precedence.

To customize the Hold and Resume settings for a node:

  1. Open the Dialog task and then hover over the node whose settings you want to change.
  2. Click the gear icon and then click the instance icon.
  3. On the Instance Properties panel, click Advanced Controls.
  4. Under Hold & Resume, select Customize for this node and make the necessary configurations.

Dialog Level Hold and Resume Settings

The Dialog level Hold and Resume customizations have higher priority over Bot level settings but rank lower than the Node level customizations or any exceptions.

To customize the Hold and Resume settings for a Dialog:

  1. Open the Dialog task whose settings you want to customize.
  2. On the top right-hand corner of the Dialog Builder, click the icon and then click Manage Interruption Behavior.
  3. Under Hold & Resume, select Customize for this task and make the necessary configurations.
Note: If you do not customize Hold & Resume settings at Node or Task level, the bot level settings come into play.

Linked Task Exceptions at Dialog Level

To facilitate exceptions in switching between specific tasks, you can utilize the Linked Tasks Exceptions in Dialog Tasks. When you link a Dialog task to another, you can define customized Hold and Resume properties to transition to that particular task. Additionally, you can write one or more conditional expressions using any entity values or context to ensure the Hold and Resume rules come in to effect only if those conditions are met.

As a part of defining the exceptions, you can also define entity pre-assignments and post-assignments.

Using pre-assignments, you can map the parameters in the current context that need to be pre-populated in the next intent. You can pass the current context values to the entities present in the linked task or define custom variables to pass the current context values

Using post-assignments, you can map the context values in the linked task back to the main task from where the linked task was invoked. You can pass the linked task context values to the entities present in the main task or define custom variables to pass the linked task context values.

Note: Post-assignment will be applicable only when the main task is resumed.

Adding Exceptions

Follow these steps to add exceptions to transition to a specific task:

  1. Open the Dialog task whose settings you want to customize.
  2. On the top right-hand corner of the Dialog Builder, click the icon and then click Manage Interruption Behavior.
  3. On the Manage Interruption Behavior page, click the Add button next to Exceptions.
  4. On the Add Interruption Exception page, from the Tasks drop-down list, select a task to link to.
  5. Define the Hold and Resume settings from the list of options below and click Save.

The Manage Interruption Behavior page opens with the name of the task listed under Exceptions. You can optionally add conditional expressions within which the transition should take place.

To do so, follow these steps:

  1. Click the name of the task under Exceptions.
  2. Under Precondition, click Add If Condition.
  3. Select Entity or Context options based on which you want to define the condition.
  4. Depending on your choice, select an Entity or write a Context.
  5. Select a connector from the list of options: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, or less than.
  6. Under the value column enter a comparative value.
  7. To add more conditions, click Add If, and repeat steps 1-6. You can add any number of conditions. When you write multiple conditions, all the specified conditions must be met for the Hold and Resume settings to take effect.

Important Notes:

  • Using exceptions, you can link the same target task to a source task multiple times by defining different preconditions. When you do so, the bot executes the exceptions in the order they are defined.
  • When none of the preconditions meet an exception, the bot adds the intent to the Follow-up Intents array.
  • The bot evaluates the preconditions only when it encounters a user intent and tries to determine whether to execute it or not. It doesn’t evaluate the preconditions when developers initiate the linked task through transitions or when the end user chooses to run the task at the end of the dialog.

Parameter Mapping

To add entity pre-assignments, follow these steps after you enter conditional expressions for an exception:

  1. On the Precondition window, under Entity pre-assignment, you can see the list of entities available in the on-hold task.
  2. Enter a direct value or a context reference next to an entity for which you want to pass a value.
  3. To pass values to a variable, click Add Key/Value and enter a variable name a value.

To add entity post-assignments, follow these steps after you enter conditional expressions for an exception:

  1. On the Precondition window, under Entity post-assignment, you can see the list of entities in the current task.
  2. Enter a direct value or a context reference next to an entity for which you want to pass a value.
  3. To pass values to a variable, click Add Key/Value and enter a variable name a value.
Note: Post-assignment will be applicable only when the main task is resumed.

Follow-up Intents

Follow-up intents refer to intents that came up in user conversations during the execution of another task, but the bot hasn’t attended to. As a part of Dialog task execution, the bot captures all unattended interruptions and make them accessible to the bot in the FollowupIntents array. However, the bot doesn’t capture Follow-up Intents if you select the Do not Hold and Resume option at the node, task, or bot level, whichever is applicable to the task flow.

You can enable the Dialog task to present all the Follow-up tasks to the user at the end of the dialog so they can choose to execute any of them. To do so, follow these steps:

    1. Open the Dialog task whose settings you want to customize.
    2. On the top right-hand corner of the Dialog Builder, click the icon and then click Dialog Settings.
    3. The Follow-up Task sections shows the following options:

      • Yes, at the end of this dialog ask the user to select and perform a task from ‘Follow-up task’ list: Select this option to show all the unattended intents to the user at the end of the dialog. To customize the message sent to the user, click Manager Response next to the option.
      • No, ‘Follow-up task’ list will be handled as part of the node connections: This is the default option. If this option is active, the bot doesn’t present the Follow-up intents to the users at the end of the dialog. However, a developer can access this using the FollowupIntents array.
Was this article helpful to you? Yes No