Dialogflow Tutorial for Beginners (2024)
Do you want to create a chatbot with Google’s natural language platform?
With Dialogflow, you can understand questions your users ask and automatically reply to it.
But it takes some time to fully understand how Dialogflow works and all the possibilities it provides.
That’s why I’ve created this Dialogflow tutorial for you.
I take you through all the features of Dialogflow step-by-step so you can create your first chatbot.
- What is Dialogflow?
- What is the pricing of Dialogflow?
- Create your first Dialogflow agent
- Use Dialogflow Small Talk
- Understand the user with Dialogflow Intents
- Capture information with Dialogflow Entities
Let’s dive in!
What is Dialogflow?
Dialogflow is the natural language understanding platform of Google that you can use to create chatbots.
With Dialogflow, you have one system for creating your chatbot and then you can automatically put it on multiple channels, such as:
- Your website
- Facebook Messenger
- WhatsApp (using Twilio)
And much more.
One of the reasons so many people use Dialogflow, is because of their Natural Language Processing (NLP), which is extremely good.
What is the pricing of Dialogflow?
Dialogflow provides two applications:
- Dialogflow Essentials (also called Dialogflow ES)
- Dialogflow Customer Experience (also called Dialogflow CX)
Dialogflow ES is the standard version of Dialogflow that is the most used one. You basically only need Dialogflow CX if you are going to build really extensive and difficult chatbots.
Dialogflow ES is free as long as you stay under the 180 requests per minute. This means that you can send 324,000 text messages per month and don’t have to pay anything.
If you go above the 180 requests per minute, you need to pay $0.002 per request. Also, if you want audio input or output, you need to pay extra:
If you want to make a more advanced chatbot and want to use Dialogflow CX, you pay $20 per 100 chat sessions. Also, if you wanto to use audio input or output, you pay $45 per 100 voice sessions:
But again, you probably don’t need Dialogflow CX to build your chatbot 😉
How to create your first Dialogflow agent
Now let’s start and create our first Dialogflow agent.
By the way, an “agent” in Dialogflow is the the same as one chatbot.
So head over to the Dialogflow console and log in with your Google Account (create one if you don’t have it already).
Once you are logged in, you can click on Create Agent:
Here, you can fill in the name of your agent, set the language and click on Create:
Dialogflow will now load for a few seconds and creates the agent for you.
Before we move on, we need to change on setting. Go to your Agent’s settings, click on ML Settings and check the Agent validation:
If you enable this, Dialogflow will automatically track errors with your agent, which could be useful to have in the future.
How to use Small Talk in Dialogflow
Once you’ve created your first Dialogflow agent, we can start by using Small Talk in Dialogflow.
Small Talk is a feature in Dialogflow that you can use to respond to everyday questions, such as:
- Who are you?
- How old are you?
Check the video below on how you can set up Small Talk in Dialogflow:
Understand the user with Dialogflow Intents
Small Talk allows you to answer simple questions.
But if you want to really understand the user, we need to use Dialogflow intents.
An intent is an action a user wants to do or a question a user has.
For example, they want to:
- Order a pizza
- Book an appointment
- Want more information about your company
And in Dialogflow, you already have two default intents:
- Default Welcome Intent
- Default Fallback Intent
The Default Welcome Intent is for understanding greetings, such as “hey”, “hi” and “hello”.
And the Default Fallback Intent is triggered when the chatbot doesn’t know an answer to a question.
Let’s see how Dialogflow intents work and how you can create them yourself:
Capture information with Dialogflow Entities
Now that we can understand the user, it is time to capture specific information users are telling us.
And we can do that by using Dialogflow entities.
Entities are facts in a sentence, that refer to the who, what, when and where.
For example, an entity can refer to the topping of a pizza or the day of an appointment.
Let’s take this sentence as an example:
I want to order a veggie pizza.
If we would not use entities, Dialogflow would think that the user wants a normal pizza, instead of a veggie pizza.
Gladly, we can train Dialogflow to understand these facts in a sentence, called entities.
Check out the video below to set up your first entities in Dialogflow:
Publish your agent on multiple channels
Now that you’ve build your Dialogflow agent, it’s time to put it on multiple channels.
And because we are using Dialogflow, it’s pretty easy to do this.
Let’s see how we can add Dialogflow to:
- Our website
- Facebook Messenger
Add Dialogflow to your website (Dialogflow Messenger)
With Dialogflow Messenger, you can easily add your Dialogflow agent to your websites.
Also, you can customize the widget to your branding, such as changing the colours and title of your widget:
Connect Dialogflow to Facebook Messenger
Connect Dialogflow to Telegram
Connect Dialogflow to Slack
Now It's Your Turn
And that’s how you create your first chatbot with Dialogflow and put it on multiple channels.
Now I have a question for you:
Do you already use Dialogflow? And what problems do you have when building your Dialogflow agent?
Let me know by leaving a comment below.
P.S. If you have any questions, feel free to ask them in the comments 🙂