How to create a bot

icon picker
Creating a Bot with Speech Recognition

In this step-by-step instruction, you will learn how to create a small
@Agent
for an online store. The
@Agent
will answer frequently asked questions regarding online ordering, product delivery, etc.

Creating Intents

First of all, you need to create
@Intent
s.
On the
@Platform
,
@Intent
s are represented as sets of
@Training Phrase
s.
We suggest that you use to create
@Intent
s for your test bot.
Register on the
@Platform
or log in to an existing account using the link . You will be directed to the
@Project
s tab. Learn more about registration and authorization: . ​
image.png
Let's create
@Intent
s. To do this, go to the
@Resourses Tab
by clicking Resources on the upper panel. ​
image.png
You will see a section with
@Intent
s. Learn more about the tab: . ​
image.png
To add a new
@Intent
, click +Create new. ​
image.png
Let's add an
@Intent
about discounts, sales, and special offers.
In the Name field, enter the name of the
@Intent
“Discounts and Sales”. The names of the
@Intent
s should be concise and clearly reflect their essence. You can find all the names in the attached . ​
image.png
Add the
@Training Phrase
s for the
@Intent
in the Requests field. The
@Training Phrase
s for each
@Intent
are also included in the attached . You can copy them from the table and paste them into the field. ​
image.png
When creating the
@Training Phrase
s, consider the various ways the
@Bot User
may express a specific intention, or
@Intent
, and make the
@Training Phrase
s as diverse as possible.
Important: To ensure the most successful recognition, the
@Training Phrase
s should contain at least 10
@Training Phrase
s for each
@Intent
.
After adding the
@Intent
name and
@Training Phrase
s, save the
@Intent
by clicking the Create button. ​
image.png
In addition to the main
@Intent
s, it is also necessary to add
@Intent
s for Small Talk. Small Talk represents topics that are unrelated to the main theme of the
@Agent
's
@Intent
s. This includes, for example, gratitude, greetings, farewells. Small Talk makes communication with the
@Agent
more lively and pleasant.
@Intent
s for Small Talk can also be found in the .
Similarly, add all the other
@Intent
s from the . Next, let’s proceed to building the actual
@Script
of the
@Agent
.

Creating an Agent Script

The
@Intent
s are ready, now you need to create the
@Agent
and its
@Script
.
Go to
@Projects Tab
by clicking Dashboard button on the upper panel. ​
image.png
Create a new
@Agent
, as described in the article .
Go to
@BotBuilder
by clicking the DESIGN button. ​
image.png
Add an
@NLU
@Slot
by clicking the + button after the
@Start
@Slot
and selecting the desired type from the dropdown list. The
@NLU
@Slot
analyzes the semantic content of the
@Bot user’s Message
and determines which
@Intent
it belongs to. ​
image.png
In the NAME field, enter the name of the
@Slot
and set the CONFIDENCE THRESHOLD value to 30. ​
image.png
The
@Confidence Threshold
value determines the
@Agent
's recognition of the
@Bot user’s Message
. Each
@Request
is assigned a confidence value (ranging from 0 to 1), indicating the
@Agent
's certainty regarding the association of the
@Request
with a specific
@Intent
.
If the confidence value, when converted to a percentage, is higher than the set
@Confidence Threshold
, the
@Agent
proceeds to the branch following the corresponding
@Intent
. If the confidence value is lower than the
@Confidence Threshold
, the
@Agent
goes to the
@fallback
@Subslot
. In this case the
@Bot User
should be prompted to rephrase the question.
After the
@NLU
@Slot
, you need to add
@Intent
s.
When creating the
@NLU
@Slot
, two
@intent
@Subslot
s and one
@fallback
@Subslot
are automatically created. ​
image.png
Replace the
@Intent
s in these
@intent
@Subslot
s with the desired ones by double-clicking on them and selecting a new
@Intent
from the dropdown list in the Intent field. ​
image.png
You can clear the Name field so that, after saving the
@Slot
, the name of the
@Intent
will be displayed in the
@Script Tree
, simplifying navigation through the
@Agent
's
@Script
.
image.png
Save the
@Subslot
by clicking the Save button. ​
image.png
After replacing the
@Intent
s in the automatically created
@Subslot
s, create a new
@Subslot
by clicking the + button. ​
image.png
Select the type of the
@Subslot
from the dropdown list. ​
image.png
Select the desired
@Intent
from the dropdown list in the Intent field and save the
@Subslot
by clicking the Create button. ​
image.png
Similarly, add all the previously created
@Intent
s to the
@Agent
@Script
.
As a result, the
@Script
appear as follows: ​
image.png
Next, after each
@Intent
, you need to add the
@Agent
’s response to the
@Intent
.
To do this, after each of the
@intent
@Subslot
s, you need to add
@Text
@Slot
s by clicking + and selecting the required
@Slot
type from the drop-down list. ​
image.png
Add the corresponding answer from the to the TEXT LIST field: ​
image.png
We recommend leaving the NAME field empty. So, when looking at the
@Script Tree
, you can see the contents of the
@Text
@Slot
s.
If the text response to the
@Intent
turns out to be long (longer than 4 lines), we recommend dividing it into several
@Slot
s, focusing on the semantic content. This will make the message easier to read. In our example, the response to the Order Tracking
@Intent
contains 7 lines.
Divide it into two
@Text
@Slot
s, adding one
@Text
@Slot
after the other. ​
image.png
Do the same with the Pickup
@Intent
. ​
image.png
If desired, you can add several text response options so that the
@Agent
responds differently each time (the response option is selected randomly by the
@Agent
). This way the
@Agent
will be more “alive” and animated.
Each new answer option is entered into the TEXT LIST field by pressing Enter twice. Add answer options for the
@fallback
@Subslot
: “I did not understand you. Please ask your question in different words.” and “Unfortunately, I don't understand what you mean. Ask your question differently.” ​
image.png
In the same way, add several answer options for Small Talk
@Intent
s.
After adding responses to
@Intent
s, you need to add
@Wait For Reaction
@Slot
s. This
@Slot
is designed to wait for the
@Bot User
to send a message (). Thus, after receiving an answer to the
@Intent
, the
@Bot User
can ask another question, the
@Conversation
will return to the start of the
@Script
, and the User’s question will be processed by the NLU Slot.
image.png

Agent training and testing

After creating the
@Agent
@Script
, you need to train the
@Agent
and test its
@Script
.
To train the
@Agent
, click the TRAIN button located in the upper right corner of
@BotBuilder
. It will initiate the
@Script Validation
process. If the
@Script
meets the , the
@Agent
will be trained. Otherwise, the
@Script Validation
will fail and an error text will appear in the lower right corner. Read more:
image.png
If errors are detected in the
@Script
, identify problem areas using the guidelines outlined in the article and fix the errors. After this, train the
@Agent
again.
After successful
@Agent
Training, open the
@Debug Widget
by clicking the Debug button. ​
image.png
Ask the agent some questions in accordance with the created
@Intent
s. Try formulating the questions in different ways using synonyms.
During testing in the
@Script
, the
@Slot
in which we are currently located is highlighted. This allows us to track which specific
@Intent
the
@Agent
attributed the
@Bot user’s Message
to.
For the most effective testing, we recommend reading the article .
To choose an appropriate Confidence threshold, refer to the article .
You can retrain the
@Agent
directly from the Analytics tab. More details:
After editing the
@Training Phrase
s of the
@Intent
s, don’t forget to train the
@Agent
again.
Communicate with the
@Agent
, going through all the steps of the
@Script
, while checking that there are no errors in the texts and the logic of the
@Script
is correct.
If you find errors, fix them, remembering to retrain the
@Agent
after each change so that it takes effect. If everything is correct, congratulations, your
@Agent
is ready!
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.