Your First Flow

Now that you have created a solution for your bot, it's time to add your first dialog. In Teneo, all dialogs are designed as flows. Flows contain the logic needed to resolve a specific question of the user. They can be simple (e.g. a flow that answers the question "What kind of coffee do you have?") or complex (for example, a flow that helps the user order a coffee beverage), but they always represent some kind of pre-defined conversational pattern.

Throughout these pages, we will create a bot for Longberry Baristas, a very hip (yet fictitious) coffee bar. We will start with a simple flow to handle the following conversation:

User: What kind of coffee do you have?
Bot: We offer a variety of handcrafted coffee drinks - from espressos to macchiatos to flat whites and more.

To achieve this we will do the following:

  • Create a folder in which we can store our flow.
  • Add a new flow.
  • Provide example inputs to recognize the user's intent.
  • Generate a match requirement based on the provided example inputs.
  • Add an answer text.
  • Save and test our flow.

The result will look like this:
End result of your first flow

Before you continue, make sure you are logged in to Studio and have opened the solution you created earlier.

Create a 'Flows' folder

Flows are stored in folders. In the 'Explore' section on the left, you see several folders with flows that came out of the box. These flows make sure your bot will understand and respond to greetings, meta-requests (e.g. 'Can you repeat that?'), feedback (e.g. 'You are great') and conversational small talk (e.g. 'How are you?'). Since you are the owner of this solution, you can change the answers in these flows if you wish.

We will store our flows in a separate folder, so let's create that first.

  1. Make sure none of the folders on the left are selected, by clicking in the gray area below the folders in the 'Explore' section.
  2. Click the 'Folder' icon in the 'New' group located on the Ribbon bar.
  3. Give your folder a name, for example, Flows and hit Enter.

You can add as many folders and subfolders as you like and you can structure them any way you like. This is particularly handy for bots that handle multiple domains.

Create your first flow

Now that we have a folder in which we can store our work, we can create our first flow:

  1. Select the folder in which you want to store your flow.
  2. Click the 'Flow' button in the 'New' group in the Ribbon. A new window will open (the flow window).
  3. Enter the name of the flow in the Name field, e.g. User asks about coffees we offer.
  4. Click on the left-pointing arrow in the top left corner of the window. This takes you to the main flow page.

As you can see, flows are represented graphically in Teneo. Simple flows just contain a trigger that recognizes the user's intent (the blue box at the top) and an output that contains the bot's answer (the purple box at the bottom). More complex flows contain more elements like multiple triggers, scripts, different outputs, etc. We're going to start with a simple flow, so you will only need to populate the trigger and the output that you see in the flow graph.

Populate the trigger

Triggers are used to recognize inputs from the user that express a similar intent. In this trigger, we want to capture and understand the user's intent around which coffee Longberry Baristas serve. 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 requirement is essentially a criterion that needs to be met for an input to be matched.

  1. Select the trigger and the trigger configuration panel will open to the right.
  2. Give the trigger a name like: Tell me about your coffee by selecting 'Add name' on top of the trigger configuration panel.
  3. In the pane that appears, 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.

You might have noticed that the trigger has a yellow 'TODO' label on it, 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 requirement. Hovering over the 'TODO' label will give you more info on what's missing.

Now, you can repeat the step above to add more examples one by one, but you can also paste multiple examples in one go:

  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 called 'Positive' and hit Ctrl+V to paste them).
  2. Finally, add a match requirement. Click on the 'Generate' button under the 'Match Requirements' section, this will automatically generate a match requirement based on the example specification.

When you generate a new class match requirement, the class gets generated based on the training data that you assigned in the examples panel. 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. You will learn more about the class manager on a later page.

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

Add an answer text

Next, we will need to set the bot's answer in the flow. There are many options to define the bot's response. For now, we will focus on the answer text only.

  1. Select the purple box that is marked Answer 1 (the Output node) and the output configuration panel will open to the right.
  2. Give the output a name like: We offer a variety of handcrafted coffee drinks...
  3. In the text box replace the text Answer 1 with We offer a variety of handcrafted coffee drinks - from espressos to macchiatos to flat whites and more.

Save your flow

Now that we have added everything needed to our first flow, it's time to save it:

  1. Click 'Save' in the top left or use the shortcut Ctrl+S.
  2. In the popup that appears you can leave a short description that will appear in the flow's version history, then click OK.

Adding a description will help you remember the changes you did and will show up in the Flow's version history.

Done! Congratulations! You have created your first flow.

Test your flow

Now it's time to test your work inside Teneo Studio.

  1. Minimize or close the flow you just created.
  2. If the 'Try Out' panel is not visible, make it appear by clicking the 'Try Out' button on the right side of the window.
  3. In this case, you can test your flow by trying out the following examples:
    • What kind of coffee do you have?
    • Which drinks do you serve?

As you can see, both inputs will trigger your flow. Teneo not only recognizes the exact learning examples you entered but also different variations that express a similar intent.

Summary

You have just created your first flow, so you have already seen a few important concepts in Teneo:

  • Flows, which contain the logic to resolve a specific question of the user.
  • Folders, where you can store your flows and language objects.
  • Triggers, to recognize the user input or intent.
  • Match Requirements, to set a criterion that the user input must match.
  • Outputs, to provide the bot's response.
  • Try Out, which you use to test your flows.

Test yourself

Try adding another flow where the user can ask which sizes the Longberry Baristas serve coffee in. The bot should return with the three available sizes we have, small, medium, and large.

What's next?

Now that we have created our first flow it's time to learn more about transitions.

Was this page helpful?