Skip to main content

User Intent

A User Intent is an example of a sentence that an end-user could say to the application, and can be defined in Intent Triggers and transitions.

The sections on this page provide information about the various aspects of User Intent:

Concept

A User Intent is an example of a sentence that an end-user could say to the application; it is the underlying motivation someone has when writing or speaking an utterance to the system. User intents normally include different ways of saying or requesting something within the particular scope handled within the Flow.

User Intent can be defined in both Intent Triggers and transitions. The main role of an Intent Trigger is to define what kind of user intents should activate the Flow. Transitions, meanwhile, are connections between the nodes in a Flow; these can (optionally) include Matches to be activated by specific user intents.

Read more about the difference between Triggers vs Transitions.

User Intent Examples

In Teneo, you can add both positive and negative examples of User Intent in triggers and transitions.

  • Positive examples cover inputs that end-users should say to the application in order to obtain information related to the scope of a specific Flow. This means positive examples should trigger the Flow (or transition) to which they belong.
  • Negative examples, on the other hand, specify inputs that should not be covered by the current user intent. This means negative examples should not trigger the Flow (or transition) to which they belong.

Both the positive and the negative examples of User Intent are used in many Studio features, such in drafts TLML Syntax Matches, Suggest Ordering, or when testing your bot with Auto-test.

Some features, such as generating a Class Match, make use only of the positive User Intent examples. When you generate a new Class Match, the class gets generated based on the User Intent Examples, which are used as training data. Once the class is generated, it gets added to the overall machine-learning model of your solution.

See Class Management to see how to add more training data.

note

Negative examples are currently only available in Studio Desktop.

User Intent Triggers

The main role of an Intent Trigger is to tell Teneo what kinds of intents should activate a Flow.

A Flow can have one or more Intent Triggers. Each trigger added to a Flow is an independent trigger, which means that it can have its own defined Matches and After Matches and different placements in the Ordering. Using multiple triggers makes it possible to have various ways to activate a Flow with different degrees of complexity and specificity.

Having multiple Intent Triggers allows you to:

  • Deal with different entry points.
  • Group User Intent Examples separately.
  • Assign different order groups.
  • Configure different After Matches and Matches for each trigger.
note

This page uses the term 'trigger' to refer to User Intent Triggers. These are not to be confused with [Prompt Triggers](/.. /studio/build/flows/prompt-triggers)

Transitions

Transitions link different Flow nodes together and determine the paths a dialogue can follow within a Flow. A Flow node can have one or more transitions coming in and one or more transitions leaving. When more than one transition is leaving the same node, they are tested from left to right; the user can add Matches to define when a transition should be matched.

Transitions are by default not input-consuming; as such, a default transition does not do anything aside from moving the flow of logic along from one node to another, but functionalities can be added to the transition for it to allow for certain behaviors; the user can modify the behavior of a transition by adding User Intent Examples, Matches, or After Matches. This is explained in more detail in the following sections.

transition types

note

If a transition leaving a node already exists, then any new transition added from the same node will by default get the same settings as the already existing transition.

New input or not?

A transition is, by default, set to continue to the next node in the Flow without asking the user for an input. But when it is set to Get input before continuing, the end-user needs to provide an input before continuing to the next Flow node; this is marked in the Flow editor with a Give Response label.

In Studio Desktop, you specify whether a transition should wait for a new input or not with a checkbox in the 'Triggering' section. If a transition has the Get input before continuing checkbox selected, the Flow processing halts until the user has provided an input. Usually, such transitions are placed after output nodes in which the bot asked a question.

2-get input

When ticking the box, the User Intent section will be marked with TODO encouraging the developer to add examples of User Intent; the Match settings should also be defined.

note

The Give Response label doesn't indicate that all transitions leaving the label are input consuming. Therefore, Studio displays a warning icon next to non input consuming transitions when both input-consuming and non-input-consuming transitions exist on a Give Response label for the developer to easily spot this and be able to review the desired behavior.

Ordering

If multiple transitions have the same node as their starting point, you specify the order in which they (or rather, their conditions) should be tested. The order is displayed in the Flow graph as a number on the transition and is displayed from left to right, with the highest order placed on the left and the lowest on the right. You can change the order in the 'Triggering' panel.

5-ordering

tip

When setting up the ordering of the transitions, make sure that the more specific conditions are tested first and the more general ones last. Otherwise, the more specific ones will never be chosen.

Conditional Transitions

When User Intent is added to a transition, the most recent user input must match in order to be able to continue to the next Flow node. Transitions with User Intent are conditional and require the addition of one or more Matches.

Transitions that have a User Intent but no assigned Match will get a yellow 'TODO' label as a reminder. Similarly, when a new transition from an Output node is added, by default, the section is marked with TODO until examples of User Intent and Matches are added.

user intent in transition

If the user input fits the transition's Match requirement, the flow processing will resume along with the transition. If the transition is not set to wait for user input before continuing, the flow processing will not stop and wait for new user input. If this is the case, the most recent user input will be tested against the Match requirement.

It is important to note that the conditionality of a transition is not directly linked to the user input. The transition can be conditional on, for example, variables or scripts (i.e. is weatherLocation set?, is the user logged in?, etc.) as well.

Unconditional Transitions

When no User Intent is included in the transition, it will allow any user input to continue down the transition as it has no Match requirements.

Transitions from any node but an Output node are by default unconditional and do not require to match with User Intent. Therefore, they do not need any defined Matches to continue to the next node in the Flow.

note

A transition with no User Intent but with some Matches allows users to have a conditional transition that is not Auto-tested in Teneo Studio Desktop.

How To

Add User Intent Examples

The step-by-step guides below explain how to add User Intent in triggers and transitions within a Flow.

Trigger

To add a new User Intent trigger at the beginning of the Flow, follow these steps:

  1. In the Flow window, click the Plus icon available in the top of the Flow (next to any existing trigger) and select Add Trigger. Alternatively, use the Add Trigger button available in the top ribbon. Plus icon
  2. Next, select the new trigger in the Flow editor to open the right-side Trigger panel. Should the panel not open when selecting the trigger, click Trigger in the right side of the window to open the panel.
  3. In the Trigger section of the right-side panel, Add name and/or Add description of the trigger.
  4. In the User Intent section of the right-side panel:
    • Add positive/negative examples of User Intent by writing in the text field (Enter an Example); next either click the green + (plus) button or press Enter.
    • Alternatively, automatically generate examples of Intent based on either already existing Intent examples or a description. Only available when LLM Settings are defined for the Account.
    • Include in tests allows the user to exclude/include the examples of User Intent in tests, i.e., Auto-test and Class Performance (also see Class Manager)
  5. Add the desired Matches.
  6. Add any needed After Matches.
  7. In the Triggering section:
    1. Select an Order group.
    2. Open the Trigger Ordering window by using the Ordering icon.
    3. Under Advanced Options, specify:
      • Trigger only once per session Indicates if the trigger should be executed just once per session or may be repeated
      • Test sentences from either Last to first (default) or First to last By default, sentences in the end-user's input are tested "last to first", but this setting allows to set the testing from "first to last" and to test sentences in the same order as they appear in the end-user's input
  8. Under Metadata add any needed Metadata definitions.
  9. Remember to Save the Flow to preserve the changes.
GENERATE USER INTENT

Instead of manually adding User Intent examples, you can generate User Intent examples with Teneo Copilot. Please make sure the LLM Settings are defined in your Account.

Transition

To add User Intent to a transition in Teneo Studio Desktop, follow these steps:

  1. Select the transition in the Flow editor, the right-side Transition panel will open. Should the panel not open when selecting the transition, click Transition in the right-side of the window to open the panel.
  2. Click Add under User Intent.
  3. Add positive/negative examples of User Intent by writing in the text field (Enter an Example). When finished writing an example, either click the green + icon or press Enter.
  4. Do not forget to hit Save.

For more information about settings and options on transitions, please see here.

GENERATE USER INTENT

Instead of manually adding User Intent examples, you can generate User Intent examples with Teneo Copilot. Please make sure the LLM Settings are defined in your Account.

Generate User Intent Examples

note

The option to Generate User Intent examples with Teneo Copilot is only available if LLM Settings are defined for the Account.

To automatically generate examples of User Intent, follow the below steps:

  1. In the open Flow, first select the trigger or transition to open the left-side panel.
  2. In the panel, go to the User Intent section.
  3. Click Generate.
  4. In the pop-up, select if the examples should be generated from existing examples or a description. Specify how many examples should be generated.
  5. Click Generate; alternatively click Cancel to abort.
  6. When the data generation has finished, review the examples in the preview and click Apply to add them to the User Intent.
  7. Remember to Save the Flow to preserve the changes.

The new examples are highlighted with a yellow border for easy recognizability.

Edit User Intent Trigger

To edit a User Intent trigger in Studio Desktop, follow these steps:

  1. First, select the trigger in the Flow editor to open the right-side panel Should the panel not open when selecting the trigger, click Trigger in the right-side of the window to open the panel.
  2. In the User Intent section of the right-side panel either:
    • Edit a positive/negative example of User Intent by either:
      • Double-clicking the example to edit, or
      • Selecting the example and clicking the pencil button
      • When done editing, press Enter
    • Delete a positive/negative example of User Intent by selecting the example and clicking the red cross in the top of the list.
    • Automatically Generate examples of Intent based on either already existing Intent examples or a description _Only available when LLM Settings are defined for the Account.
    • Filter examples by using the text filter (Filter Examples) available below the list of positive/negative examples
    • Include in tests allows to exclude/include the examples of User Intent in tests, i.e., Auto-test and Class Performance (also see Class Manager)
  3. Edit the desired Matches or After Matches
  4. In the Triggering section:
    1. Select an Order group.
    2. Open the Trigger Ordering window by using the Ordering icon.
    3. Under Advanced Options, specify:
      • Trigger only once per session Indicates if the trigger should be executed just once per session or may be repeated.
      • Test sentences from either Last to first (default) or First to last
        By default, sentences in the end-user's input are tested "last to first", but this setting allows to set the testing from "first to last" and to test sentences in the same order as they appear in the end-user's input.
  5. Under Metadata edit any Metadata definitions.
  6. Remember to Save the Flow to preserve the changes.

Delete User Intent Trigger

To delete an Intent Trigger, follow these steps:

  1. Select the Intent Trigger in the Flow editor.
  2. In the top ribbon, click Delete.
  3. Remember to Save the Flow to preserve the changes.
warning

A Flow needs to have at least one User Intent trigger and Teneo Studio will prevent save if the deletion of a User Intent trigger leaves the Flow without any trigger.

Draw Transitions

Draw transition automatically

The transition is automatically drawn in the Flow editor by following these steps:

  1. In the Flow editor, click the Plus where the new node(s) should be connected.
  2. Select the relevant node or element in the popup menu; an overview of all Flow nodes and elements is Flows.
  3. The new node is added, remember to Save the Flow to preserve the changes.

Alternatively, follow the below steps:

  1. In the Flow editor, select the node from which the new node should be connected (the new node will be added after the selected node).
  2. Click the corresponding button in the top ribbon's Add Node area.
  3. The new node is added, remember to Save the Flow to preserve the changes.

Draw transition manually

To manually draw a transition, follow the below steps:

  1. In the Flow editor, click anywhere in the white area to de-select any previously selected node.
  2. Click the corresponding button in the top ribbon's Add Node area.
  3. The new node is added.
  4. Now, manually by clicking one Flow node and maintaining the mouse button pressed, draw the transition to the following node.
  5. Remember to Save the Flow to preserve the changes.

UI

Triggers

d_trigger-in-flow

New User Intent triggers can be added in the ribbon bar or by clicking on the Plus icon at the beginning of the Flow.

Selecting a trigger opens the configuration panel for that trigger, displaying the various options for configuring the trigger.

Transitions

1-transitions in flow

Transitions will look different depending on their configuration. In this image you can see some examples of how transitions look with a Match, with User Intent, and without either (unconditional transition).

d_transition-in-flow

Selecting a transition in the Flow editor opens the right-side Transition configuration panel in the Flow window, where the user will find the following properties:

  • Transition section:
    • Add name: give the transition a name; the name is displayed in the Flow editor
    • Add description: add a short description of the transition
    • Change start: allows to change the starting point of the transition by selecting another node in the Flow from the dropdown menu
    • Change end: allows to change the ending point of the transition by selecting another node in the Flow from the dropdown menu
  • User Intent allows to write examples of User Intent
    Adding User Intent and examples indicate that the transition is conditional on intents and the Match section will be marked with TODO until Matches are defined
  • Match allows to add Match types to the transition
  • After Match allows to add Match requirement to the transition
  • Triggering section:
    • Get input before continuing: if ticket, the end-user must provide an input before the Flow process continues to the next node; User Intent will become available, the TODO label becomes visible, and the user should provide examples and define Matches
    • Order: if multiple transitions start from the same node, specify in which order they (or rather their Matches) have to be evaluated
    • Advanced Options:
      • Match only once per session: indicates if the transition should be executed just once per session or if it may be repeated
      • Match only the selected sentence) (only available when Get input before continuing is not selected): allows the user to select which part of the existing input will be used when testing the Matches and executing the After Matches of the transition
      • Test sentence from: "Last to first"/"First to last": by default, sentences in the end-user's input are tested "Last to first", but this setting allows the user to set the testing from "First to last" (testing sentences in the same order as they appear in the end-user's input).
  • Metadata allows the user to define Metadata at node level

Give Response

When multiple transitions leave a single node and if one or more of them are input consuming, a Give Response label is displayed for all the transitions.

give response transition

note

If a Give Response isn't shown, add it by clicking the Plus icon, and selecting Continue with > Transaction element and lastly Response.

Practical Examples

Populating a Trigger

In this example, we are working with a solution built for a fictional coffee shop, where users can order coffees. In this trigger, we want to capture and understand the user's intent around which coffees are served.

It is important to recognize that there can be several ways of expressing the same intent. For example, 'What coffee do you sell?' or 'Which coffees do you serve?'. To make the trigger match on user input, we need to add a Match requirement. This Match is essentially a criterion that needs to be met for an input to be matched.

Create a trigger by following these steps:

  1. Add a new Intent trigger and give it a name like: Tell me about your coffee by selecting 'Add name' on top of the trigger configuration panel.
  2. In the User Intent section, enter this example in the 'Enter an Example' field: What kind of coffee do you have?, then hit the 'plus' icon beside it or hit Enter. Alternatively, paste it straight into the Positive Examples section.
info

You might have noticed the 'TODO' label above the Match section. This means that the trigger does not contain a defined Match requirement yet. So, let's start with populating the trigger with example inputs and adding a Match.

Now, we will generate a match based on User Intent for the trigger:

  1. Copy the examples below:
Do you have brewed coffee
Do you serve macchiato
Do you have cappuccino
Tell me about the coffees you have
Tell me about your coffee
What coffee do you serve?
What kinds of coffees do you serve?
What kinds of drinks do you sell
Which coffees are offered by Longberry Baristas?
Which drinks do you have?
Which sorts of coffees do you have
  1. Next, right-click the empty area in the learning example area and paste the inputs (alternatively, you can click the tab labeled 'Positive' and hit Ctrl+V to paste them).
  2. Optionally, automatically generate more examples by following the steps in Generate User Intent Examples.
  3. Finally, add a Match. Click on the 'Generate' button under the 'Match' section. This will automatically generate a Match based on the examples.
  4. Make sure to save the Flow.
  5. You can now test your bot in Tryout to ensure the trigger works.

When you generate a new Class Match, the Class gets generated based on the training data that you assigned for the User Intent. Once the Class is generated, it gets added to the overall machine learning model of your solution. However, if you want to expand your Class with additional training data, you have to do so in the Class Manager.

The positive examples are also used for Auto-test for when you want to automatically test your bot.

Using Transitions

Sometimes your bot will need some additional information from the user before it can provide a final answer. In this example, we will branch into two transitions after an output prompt and match one depending on the user response.

We will use the following example, where the bot provides information about a product to the user, and then the bot needs a confirmation from the user before it proceeds to make a reservation:

User: I want to buy a coffee mug.

Bot: Our official coffee mug is only available for purchase in our store. Would you like me to reserve a mug for you?

User: Yes.

Bot: I have reserved a coffee mug for you.

or

User: I want to buy a coffee mug.

Bot: Our official coffee mug is only available for purchase in our store. Would you like me to reserve a mug for you?

User: No.

Bot: Ok, I will not reserve a coffee mug for you.

To achieve this, do the following:

  • Create a new Flow.
  • Populate a User Intent trigger for the Flow.
  • Add an output response in the form of a question.
  • Create a 'yes' transition if the user replies with 'yes'.
  • Add output response for the 'yes' scenario.
  • Create a 'no' transition if the user replies with 'no'.
  • Add output response text for the 'no' scenario.
  • Save and test the flow.

This example only covers the communication with the user. To actually reserve a coffee mug, we would have to integrate with a service; we will leave that part out for now.

note

The following steps focus purely on transitions and expects that you have created a new Flow and populated a trigger.

Add Answer Texts to the Output

We will populate an output node with answer texts. In this case, the output node will be used to give the user information about the coffee mug and then ask a yes or no question, rather than just give a definitive answer.

  1. Select the output node to open the output configuration panel.
  2. Add an output name and enter a name, like Ask the user if they want to reserve a mug for in-store purchase.
  3. Add an answer to the output node, like Our official coffee mug is only available for purchase in our store. Would you like me to reserve a mug for you?

Add Two Transitions

In this point of the Flow, we expect the user is going to say either 'yes' or 'no'. Depending on what is said, the bot should react differently. Let us start with adding these transitions.

  1. Located under the output node Ask the user if they want to reserve a mug for in-store purchase, click on the Plus icon, followed up with 'Fork To' and 'Multiple complete transactions'. You will now have the option to select the number of times the output should be forked.
  2. Enter '2' and click on confirm. Notice that two new paths are shown for the user to take. These will now be edited to cover the 'yes' and 'no' options.
Add a Language Object Match for 'Yes'

Now we need to make sure that one of the paths only matches when the user says 'yes' or 'no'. To achieve this, we need to add a Language Object Match. Simply put, it checks if a user input matches a certain pattern. They can be generated from a set of examples or you can specify them directly. Let's generate one from a set of example inputs.

  1. Open the transition configuration panel by selecting the transition labelled '1'.
  2. Give the transition the name User says 'Yes'.This increases the readability of the flow and makes debugging easier.
  3. In the examples panel, paste the following examples:
Yes
Indeed
Yep

  1. Finally, click on the 'Generate' button under 'Match' section, this will automatically generate the best Match requirement based on the example specification.

After a few seconds, the match field will get the value (%YES.PHR). This is the 'Match' for 'Language Objects' that was generated, which recognizes various phrases (hence the suffix .PHR) that mean 'yes', like 'by all means', 'absolutely' and 'yup'.

tip

Triggers and transitions can contain one or more match requirements. It is also possible to mix the Match Types depending on what the use case requires.

Add an answer text for 'Yes'

The last step to complete the 'yes' branch is to specify how your bot should respond when the user says 'yes'. The output node below the 'User says Yes' should be selected:

  1. Give the output a descriptive name like: I have reserved a coffee mug for you.
  2. Finally, add the answer text: I have reserved our official coffee mug for you.
Add a Language Object Match for 'No'

Now, we will specify what should happen when the user says 'no'. We'll follow the same steps as when adding the first branch:

  1. Select the transition labelled '2'.
  2. Give the transition the name User says 'No'.
  3. Add a few example inputs in the examples panel:
No
Never
Nope

  1. Finally, click on the 'Generate' button under 'Match' section. This will automatically generate the best Match based on the example specification.
Add an answer text for 'No'

Now we need to make sure that the reply 'no' is recognized by the Flow.

  1. Select the Output node below the transition.
  2. Give it the name: Ok, I will not reserve a coffee mug for you.
  3. We can reuse the name of the output node as our answer text.
  4. Finally, save your Flow by clicking 'Save' in the top left or use the shortcut Ctrl+S.

Tips and Tricks

Transition with Match

Just like triggers, transitions can also have a Match requirement to evaluate if the input of a user meets the criteria to follow a transition. You can either hand-craft the Match yourself or let Teneo automatically create it for you from a set of test data, after which you can edit the Match.

Let's say that you want to capture extras together with a coffee order:

coffee extras

The TLML Syntax for the 'Milk and sugar' branch may look like this:

tlml syntax

For syntax conditions in transitions, it is usually enough to focus on the crucial content-bearing keywords. This way, less important words that might exist in the user's input are ignored.

You can also use Groovy code in the condition field. The code should be enclosed in curly brackets, e.g. {userAge > 12} (which requires the value of the variable userAge to be greater than 12 to determine if the user may drink coffee). Language conditions that consist of Groovy code are often used in transitions that continue without user input.

Fallback transitions

In cases where you have nodes with multiple leaving transitions, keep in mind when you design your Flow what should happen if the user enters unexpected input.

For example, if the Flow contains a yes or no question to the user, you will need a transition for the 'yes' path and another for the 'no' path. However, what if the user says something completely different? Consider adding an unconditional transition after the conditional ones to create a path for dealing with any unexpected inputs.