Adding a structured conversation

Let's add a structured conversation flow to your AI Agent.

Now that your AI Agent has become proficient at handling different topics of discussion, let's see how we can add a more structured type of conversation in the mix.

For an AI Agent that is mainly focussed on process-handling, we recommend using the prebuilt process-handling AI Agent.

We now want to add the possibility for users to book an appointment through our AI Agent.

To do this, we will need to :

1 - Add the AppointmentBooking as a new topic of discussion. These steps are covered in the dedicated tutorial. Click the link for a refresher, and follow all the outlined steps 👉🏻

2 - Create a dedicated conversation to further handle the AppointmentBooking process.

3 - Link the AppointmentBooking topic of discussion to the AppointmentBooking process conversation.

See it in action

Add a structured conversation thanks to OpenDialog's unique model

Step-by-step guide

What you need before you start building

In order to make the best of adding a structured conversation to your AI Agent, we advise to have a good understanding of the process and its steps, before getting stuck in.

Ask yourself:

  • What is the process I am trying to design and what are it's steps?

  • Is it a linear process or are there any forks in the road, that will require me to use conditions?

Creating a dedicated conversation

This is a good time to remind ourselves of the OpenDialog Model:

The OpenDialog model breaks down the wider context of AI Agent interactions into a manageable structure:

  • Scenarios: The overall structure that defines your AI agent’s conversations. It is where you specify how your AI Agent can interact with a user and what should happen as a result. Scenarios are represented in dark navy blue in the OpenDialog design setup.

  • Conversations: The high-level parts of a scenario, often tied to specific user goals or states. Conversations are represented in highlight blue in the OpenDialog design setup.

  • Scenes: Smaller units within conversations, handling specific parts, substages or states of the conversation. Scenes are represented in mauve grey in the OpenDialog design setup.

  • Turns: Represent the back-and-forth exchanges between the user and the AI Agent. Turns are represented in a teal colour in the OpenDialog design setup.

  • Intents: Represent the intention behind the user’s input or the AI agent’s response. They are represented in yellow in OpenDialog.

In OpenDialog, you can choose to handle topics of discussion in a few different manners:

  • Free-form conversations: The AI Agent invites the user to ask any question that comes to mind at any given time, which we covered in the previous sections.

  • Structured process conversations: The AI agent follows a predefined script, inviting the user to take specific steps towards the completion of a process.

  • Hybrid: The AI agent will use a mixture of both free-form and structured conversations as part of the user experience.

In order to set up a structured conversation handling the multiple steps of a process conversation, you need to set up a new conversation specifically dedicated to this process.

Adding steps to the process

Now you will need to add the different steps of your process. Each step is represented in a scene.

Each scene has a clear goal. At each scene (or step) the user can complete the goal and move forward or they can abandon the process and they will move back to the Topic Conversation.

We recommend setting up a template scene for the first step of your process that you can then duplicate for the next couple of steps.

A scene for a process conversation contains the following components:

  • The introduction turn - led by an APP intent which is the starting turn of the scene

  • The expected user requests - represented in respective response turns each - led by primary USER intents

  • Supporting turns - led by secondary USER intents (including Help, TalktoHuman, NoMatch, etc.)

A template scene with it's different turn components

Setting up the introduction turn

In OpenDialog, a turn contains the interactions between the bot and the user for a specific action. The first turn will welcome the user to the booking process.

In the introduction turn, which is an application-led turn, we now need to create the application intent that will contain the message, welcoming the user to this step of the process.

Setting up the primary user request turns

Next, we’ll handle potential user requests as a result of what the AI Agent is asking in the introduction turn. Typically, these responses include primary intents (e.g., "Yes" or "No") or secondary intents (e.g., "Help" or unrelated queries).

To do so, we will create a turn by a potential user request.

In our example, we will need a 'Confirm' turn and a 'Cancel' turn to harbour the primary interactions.

Setting up secondary user request turns

With secondary requests you can go as detailed and broad as you want - however there is a set of supporting intents we recommend setting up as a best practice:

  • TalktoHuman - TalktoHuman

  • Help - Help

  • No-match - intent.core.TurnNoMatch

  • Further questions - Question

To set these up - follow the steps described above in the 'Create a user intent' section, and we will use the intent names as described above.

Progressing the conversation after a user request

Once the intents have been set up, we will now need to tell the conversation engine what to do next.

There are a few options here for you to consider:

  • Progress to the next step in the process by transitioning to the next scene. For instance, after confirming readiness, the user might proceed to a "Provide Availability" scene.

  • Set up a contextual response, for example to handle no-matches. In this case, the provided responses will nudge the user into using one of the primary responses instead and help them progress the conversation.

  • End the conversation, and take the user back to the top of the scenario

If you have not yet created the next set of scenes, we recommend doing this after having created a full scene with all the supporting user turns and intents, so you can duplicate it as the basis for the next scenes. You can then come back later to this specific user intent to set up the Transition.

Summary

By following these steps, you’ve built the foundation for a structured conversation in OpenDialog. You now have:

  • A clear starting scene with an app-intent introduction.

  • Logical user response handling through turns and intents.

  • Transitions to additional scenes for progressing through the process.

This template can now be expanded or duplicated to build out more complex processes. Remember, testing is your friend—use the tools provided to ensure a seamless experience for your users. 🎉

Linking the dedicated conversation to the topic of discussion

Wait a minute! Now that the process is in place, we still need to link it up to our topic of discussion. Let's have a look at how to do that

That's it - your are all set. Now, when the BookAppointment topic will be matched through semantic classification, the AI Agent will transition to the BookAppointment process rather than providing a one-off response.

Last updated