Skip to main content

🠐 Go back to Documentation

Behind the Scenes:
Book a Doctor Appointment Conversation with a NativeChat Chatbot

The bot configuration

We are using the NativeChat sample "Book a doctor" to demonstrate how the Cognitive Flow works.

Cognitive Flow definition

For the "Book an appointment" conversation there are 3 questions steps with 3 entities - doctor, date and time.

It is like 3 slots that need to be filled by the user answering bot's questions.

Natural Language Understanding

For each conversation, the developer must provide example expressions that trigger it. The process of providing examples to the Natural Language Processing (NLP) engine is called Training.

The conversation flow

User triggers a conversation

The user starts interacting with the chatbot. "Book an appointment" is recognized as the trigger expression for this conversation.

The bot starts executing the steps in the same order as they are defined in the Cognitive Flow.

1
2

Bot's response

The aim of the first step is to extract the value of the entity doctor from the user's input.

In order to fill the slot, the bot asks the users which doctor they would like to see.

User responds

The user answers the question.

They may provide information for more than one entity with one expression.

The NLP engine detects that and extracts the structured data - doctor name and date.

3

Bot calculates next action

The bot goes through the process of filling the slot for each detected entity. This includes evaluating the so called reactions - validation, disambiguation etc. - before the slot is filled.

Important

The evaluation of reaction is triggered:

  • for all slots that the user has provided data for
  • every time the user says something
4

Reactions

Acknowledge

When the bot identifies the entity without explicitly asking, it will acknowledge with a special message to the user.

Validate

The bot can validate user input based on various rules, e.g. proper email, regex or even call an external API.

Suggest

If the users are having repetitive conversations, the bot can display their previous answers as suggestions. The users can pick them instead of typing the reply.

Disambiguate

There are cases where a bot can identify multiple values for a given entity, and it will use the message to ask the user which one is correct.

Bot skips the question about date

The bot doesn't have to go through the question step asking for date because the slot is already filled.

5
6

Next bot message

Now when the slots for doctor and date are filled it's time for the bot to execute the next step of the conversation.

It asks the user for the exact time of the appointment. The time slot is the final entity needed.

Final slot gets filled

The user responds to the bot's question and finally the last slot has been filled successfully.

7

Conversation completed

When all the slots are filled the user receives a message from the bot with a wrap-up of all the information gathered in the conversation.