Introduction to Dialogflow: Creating Your First Agent
Dialogflow is a platform for creating "smart" chatbots. By smart, I mean conversational bots that can recognize both human text and voice and generate their own responses based on a neural network.

The platform is free. There are Enterprise plans where you only pay for the resources you use. But for starters, the free version will be more than enough. To register at dialogflow.com, you'll need a Google account since the service belongs to this company.
Dialogflow allows you to create chatbots for multiple messengers and platforms simultaneously. It supports Facebook Messenger, Telegram, Viber, Skype, Google Assistant, and many others. You can also create a chatbot with a web interface and easily integrate it into a website.

The simplest integration of Dialogflow is with Telegram, so let's look at this option in practice and understand how everything works.
The first thing you need to do is create a so-called agent. A Dialogflow agent is a program (service) that receives phrases from users and generates responses to them. After that, it connects with bots in messengers with which it has integration and passes the response to them. And the bots output information to end users in messengers.
In our example, we'll have just one agent and one bot for now.
So, let's create a new agent. To do this, click on "Create new agent" in the upper right corner. In the window, give the agent a name (purely technical, the user won't see it). Then, select the language the agent will work with and the time zone.
The rest of the settings can be left as is. Nothing else is needed at this stage.

Click "Create". The agent is ready!
The next step is creating a chatbot in Telegram. This is what we'll connect our agent to. To do this, open Telegram messenger, find a bot called BotFather in the search bar, and launch it. This is a special system bot that is the "father" of all other bots in Telegram.

Launch it by clicking the "Start" button. Enter the /newbot command. We'll be asked for the name of the future robot. Users will see this name, so come up with something meaningful. For example, "John Smith". The name won't be unique.
Now we'll be asked to create a unique identifier for the bot. A short name (strictly in Latin letters) that ends with the suffix "_bot" or "bot". Finally, BotFather will generate a token, which is a unique key of random characters that we'll need when integrating the robot with the agent. Copy and save the token somewhere.
Almost done. The final (but optional) stage is the bot description that will be available to Telegram users. Adding a description is simple. Enter the /mybots command, select the desired bot from the list, and click on "Edit bot". There you can add a detailed description of the robot, picture, title.
Saved? Now click the "Bot Settings" button and select "Inline Mode". Here you need to click Turn on so the bot can see user messages. Click "Back to Settings", go to "Group Privacy" and click "Turn off". We disabled privacy for groups, this way we allow seeing all messages in groups.
This completes the chatbot setup.
Let's return to Dialogflow and proceed with integrating the agent with the bot. In the main menu (left), find the "Integrations" section, find Telegram, and activate the toggle button.

In the "Telegram token" window that appears, paste the token generated by BotFather and click "Start".
That's it, your agent is integrated with the chatbot. Try to find the chatbot in Telegram using the search bar and write something to it. It's not very smart yet and can only react to the word "Hello" and a few other greeting variations. Experiment, this is just the beginning. Step by step, we'll make the bot smarter.
If you're interested in the Dialogflow platform — give feedback (in the comments, for example) and in the following articles, we'll work on expanding the bot's functionality. We'll give the chatbot intelligence, teach it to react to different phrases not in a template way, but more or less close to a real person. That's why we chose Dialogflow in the first place.
To not miss updates, subscribe to the Telegram channel, where I publish all the most interesting things related to chatbots and Dialogflow.
Good luck and I'm waiting for your comments!