How to create your bot without programming skills and connect it to Yandex.Alise


As we wrote in our first article , we at Just AI specialize in artificial intelligence technologies for understanding natural language (NLU). We have our own platform for developing spoken assistants, both text and voice. The platform has developed functionality for solving NLP problems (clustering logs, searching for semantically close phrases, etc.) and its own development language (Just AI DSL). Using DSL, a team of linguistic developers writes chatbots script code, integration modules for communication with external systems, as well as autotests.

In this article we will talk about the tool we created for developing bots for different platforms, including Yandex Dialogues, without DSL and programming skills.

Large projects, such as an autoinformer to support telecom operator's clients or a full-featured voice assistant, can count more than 1000 user grades to be classified, dozens of reference books for extracting entities, and include integration with several external services. Therefore, the development is carried out simultaneously by several linguists and developers, using version control systems and tools for load testing, with the involvement of copywriters and UX-designers.

Initially, we were confident that the complexity of the development approach is what the chatbots developers and businesses need, since creating an intelligent chatboat is a difficult and resource-intensive task. We built a rather complex architecture to close all possible cases, and even made a visual editor in the platform to make it easier for clients to manage the chatbots logic. But quite often in practice we continue to encounter the fact that even a prepared business with an already planned budget for automation, is slow with implementation and does not understand how to properly set up TK and properly plan the introduction of AI in its processes.

We wanted to make it easier for companies to start working with artificial intelligence and at the same time give them a tool to immediately start testing technology. At the same time, it was necessary for the product to be able to understand natural language (regular user requests) and not to respond one-syllablely to typical questions (“I did not understand, repeat your question”). In general, it was necessary to hide our cool enterprise-platform technologies “under the hood” in order to make it easier for Russian business to enter the world of artificial intelligence. In general, it was necessary to make a product for the user, so that you can customize, touch, see how it works. Therefore, the interior of the platform is hidden under the shell of the constructor.

We did it well or not - judge you (links for registration in the designer and for correspondence in the community - at the end of the article). As a result, Aimylogic product appeared - a visual designer where you can assemble an intelligent chatbot that understands natural language from simple blocks: user replicas, bot answers, calls to external systems. Working with Aimylogic does not require DSL knowledge of the main platform, skills of writing the patterns of recognition of intents and autotests.

Case: creating a chatbot for the HR department


Today we consider a fairly simple case: creating a chatbot for HR, which advises employees on the company's internal processes via Telegram, the company's website or Yandex.Alisa, can receive applications (for vacation, LCA, etc.) and send them to the board in Trello.

The whole process can be divided into the following steps:

  1. creating a script for an HR-bot dialogue with an employee of the company;
  2. configuration of the collection of user requests (we will use Trello);
  3. bot testing;
  4. publication of the bot in Telegram, on the website or on Yandex.Alisa.

So, first things first ...

1. Creating a script of communication with employees


Now in Aimylogic there is already a bot template for HR with dialogues about salary projects, vacations, insurance and other issues that the bot will understand right away. Thus, you can use a ready-made script and, if you wish, change it for yourself. We describe how this template was made.

The process of creating a script in Aimylogic comes down to adding blocks and setting transitions between them.

The screenshot above shows that the bot script begins with a greeting. To greet the user and explain what questions he can ask the bot, use the text block. You can add a picture.

After creating the block with the welcome text, we will add the block “Phrases” to our bot, which allows us to train the bot using examples of user requests. In the “Phrases” block, we add separate groups of phrases that correspond to the intentions (intents) of users and fill each of them with examples of queries.

In this example, we will create several groups of phrases:


In groups of phrases, we will define sets of examples based on the actual requests of employees in the HR department. For example, for the group “Corporate DMS Program” these will be requests:


Groups of phrases can be supplemented with examples at any time, which allows you to quickly train a bot during operation.

For each group of phrases we will create our own sequence of actions in the script. For example, for a group of phrases “Application for vacation”, we implement a request for additional data from the user and saving his application in Trello for further processing by an employee of the HR department.

To request data from the user, we will sequentially add blocks to the script with the request for the employee’s full name and the desired vacation dates.



The information entered by the user is saved in the $ Name and $ vacation_date variables and becomes available for further use in the script. For example, to send this data to an external system.

In future versions of Aimylogic to receive data of different types (text, numbers, telephone numbers), corresponding blocks will appear in the system, which automatically check the user's input.

Now we will set up bot integration with Trello, where collected requests from users will be saved.

2. Saving user requests to Trello


Trello provides an API for integration with its tools, but there are services, including free ones, that allow them to be used without wasting time writing integration code. One of these services is IFTTT. The chatbot we created in Aimylogic sends the data to IFTTT and they appear in Trello.

To do this, in IFTTT we will create a Webhook applet that, when receiving an HTTP request from the bot, will place the data from the request body on the board to Trello. In the bot script, add an “HTTP request” block to Aimylogic, which will transfer data to the applet.

Creating an applet


In the IFTTT interface we create a new applet (My Applets -> New applet) and set the trigger of the applet (by clicking on + this ). In the search that appears, type “webhook” and select the trigger found under the name “Webhooks”.

Click on “Receive a web request” and set the name of the trigger event (we write it in Latin without spaces in the “Event Name” field). Click on “Create trigger”.

Now we configure the action that will occur when the bot sends a request for an applet from the script that we just configured - click on “ that ” in the applet.

Configure IFTTT integration with Trello


After clicking on “ that ”, the search again appears in the IFTTT. We are looking for Trello there and log in to this service.

After issuing permissions to access the account in Trello, select the action “Create a card” in IFTTT.

Next, we indicate the board on which the cards will appear, in the “Title” field, we indicate “Value1” - this is a variable from the request body from the bot in which the essence of the employee’s request will be transmitted (“<Employee name> wants to go on vacation < vacation period> ").
Click on “Create Action” when everything is set up as we need. Next - “Finish”.
Now, whenever a bot sends an HTTP request to the webbook we have configured, IFTTT will take the “Value1” variable from this request and automatically add a card with that name to Trello.

Getting a Webhook Address in IFTTT


Perhaps this is the most non-trivial part of integration.

Click on the “Search” menu at the top of the IFTTT page. Next, look for the search “webhook”. Click on the found Webhooks. Next, click “Settings”.

A page will open with a URL. This is not the webhuk address yet! You need to copy this URL and open it in a new browser tab.


The webpage test page opens. Here you can fill in the name of the trigger event (the one we invented when creating the applet in the “Creating an applet” section) and the value of the variable “Value1”. Now if you click on “Test it”, then a card will be added to Trello with the value of the variable “Value1” in the header.


Now copy the resulting URL of the webhuk (in the last line, above the button “Test it”) - this is the address of the webhuk , which we should use in the HTTP request in the bot.

Configure HTTP Request in Aimylogic


Add a block with an HTTP request to the script when we have already collected data from the user (in the $ Name and $ vacation_date variables).

In the settings of the HTTP request, we set the URL as the URL that we received from IFTTT as the URL.


Put the value of the variable “Value1” in the request body — form the text with the $ Name variable in which the user name is stored, as well as the $ vacation_date variable in which the vacation dates are stored. That is, it should turn out like this:

{ "value1" : "$Name     $vacation_date" } 

Now, when executing this request, the bot will substitute the values ​​of $ Name and $ vacation_date in the request body and send the request to the IFTTT applet. That, in turn, will create a card on the Trello board.

3. Testing the bot


Having prepared a dialogue script, you can immediately check it in Aimylogic by clicking on the “Test” button. A widget will appear on the screen where you can chat with the bot. The widget supports text input as well as using buttons, if they are provided by the script. For example, in Alice, it is customary to offer the user buttons as prompts in order to familiarize him with the capabilities of the skill.

At this stage, you can debug the dialogue and check how correct and understandable it is, without using additional prototyping tools.

Please note that, thanks to NLU technologies (including matching synonyms, normal word forms, their vector representations and syntactic query structures), the bot will understand not only phrases that coincide with examples, but also close to them in meaning. If this does not happen, you can add training to the bot by expanding the list of relevant examples.

Now chatbot is able to communicate with the employee and save the data in Trello. It remains to place the bot in the desired channel.

4. Publishing chatbot


With the help of Aimylogic created bot can be placed in one or more channels. At the moment, in Aimylogic are available: chat widget for the site, Telegram or voice assistant Yandex. Alice.

Soon we will add new channels: VK, Facebook, Slack and others. Everywhere the scenario of HR-bot behavior will be almost the same, and applications from all channels will get onto the Trello board.


Depending on the selected channel, Aimylogic will automatically generate a script to insert on the website or the webhook address to be specified in Yandex.Dialogs. To use Telegram, you only need to specify the token of your Telegram bot obtained from BotFather.

In Aimylogic all channels connected to the bot and their statuses are displayed.

And where can I test?


We open Aimylogic in beta mode. Honestly, it is still “raw”, but you can test it and try different cases: create dialogue scripts in different channels, experiment with connecting external systems, build FAQ bots with an understanding of the natural language.

The release of the next version will include directories of named entities, which will significantly expand the capabilities of the product.

We started doing Aimylogic, trying to make it easier for users to create simple bots on our platform, while retaining access to its main functionality - NLU, easy integration with external systems and channels. We will further develop the product, improving its UX, prokidyvaya new useful features from the main platform. We will welcome feedback and suggestions.

You can test the platform here: app.aimylogic.com

You can talk with us or other developers in the telegram channel . Or simply type the phrase "Aimylogic" in the Telegram search.

Source: https://habr.com/ru/post/412557/


All Articles