top of page
Writer's pictureAhamed Basha

How to Build Chatbots with Google Dialogflow

Updated: Aug 5

Overview

A Chatbot is an AI based application which stimulates conversation. It uses Natural Language Processing (NLP) to understand, build and generate responses. Chatbots are important as they enhance customer experience, help improve user engagement, task automation, data collection and are extensively used in various fields. With this, we will look into the steps to build a chatbot using dialogflow.


How to Build Chatbots with Google Dialogflow
How to Build Chatbots with Google Dialogflow

Two types of DialogFlow Virtual Agent Services:

  • Dialogflow ES: Standard agent type solution for simple and small scale applications.

  • Dialogflow CX: Advanced agent type solution for large and complex applications.


We will be using the Dialogflow ES in this guide for the demo.


Set up a Google DialogFlow Project


Step 1 - Make sure you create a project or have an existing project in the Google Cloud Console. Head to Google Cloud Manage Resources.


Google Cloud Manager

Step 2 - Give a Project Name you want and Click on Create


Creating Project

Step 3 - You should see a notification once it is successfully created. Click on "Select Project"


select project

Now you should be able to see your Project Dashboard.


project dashboard

Let's Get started!


Step 1 - Head to Dialogflow & Sign-in with Google


Google dialogflow

Step 2 - Click on Create Agent


creating agent in google dialogflow

What are Agents?

It is a virtual agent that is responsible to handle concurrent conversations with users in a Google Dialogflow Chatbot.


Step 3 - Give any Agent Name you wish


  1. I'm using "InterviewScheduler" as my Agent Name

  2. Select the Project ID we created before in Google Cloud Console.

  3. Click on Create


Note - It will take some time (7sec to 10sec) to Create an Agent.


select agent name in google dialogflow

Now this is how your screen should look like:


Now this is how your screen should look like:

What are Intents?

Intents are the Intensions of the users for having a conversation with the chatbot.


Example:

Default Welcome Intent - It is a Welcoming Intent which welcomes user to start a conversation.


Step 4 - Creating an Intent


Creating an Intent

Give an Intent name of your choice, I have given Interview Scheduler, Then Click on Training Phrases to train the chatbot.


giving intent name

Step 5 - Creating Training Phrases


Add a phrase of your choice like shown in below GIF and give an entity @sys.date-time which is relevant to it.


Example:

  • Schedule a meeting on Monday 10 AM

  • I would like to have an interview on Tuesday 6 PM

  • Set an Interview on Wednesday 4 PM


Creating Training Phrases

After Adding the Training Phrases, your screen should look like this:


After Adding the Training Phrases, your screen should look like this

What are Entities?

Entity is a type of an Intent on how and what to respond with the right context in the conversation with the users.


Example: Date, Time, Email and you can also create custom entities of your choice.


Step 6 - Add an Action and Parameters for the Entity


Example - When and What time would you like to Schedule the Interview?


Note: This marks as a mandatory check whenever the bot is triggered to schedule the interview.


Add an Action and Parameters for the Entity

Step 7 - Add Responses

Example:

  • Thank you for scheduling the interview

  • Thank you, Your Interview is Scheduled on $date-time


Note - The $date-time replaces the user given date and time because it is an entity.


Adding Responses

Hurray, Now you have Successfully Created a Chatbot using Google Dialogflow


Let's see it in Action:


Google Dialogflow Chatbot

Now you can also Integrate your Dialogflow Chatbot in your Web Applications

Step 1 - Head to Integrations


Head to Integrations

Step 2 - Select Web Demo in Text Based


Select Web Demo in Text Based

Step 3 - Click Enable


Enable Demo Link

Step 4 - Integration Methods


  • Method 1 - Simply click the URL to Web Demo and test the agent with your chatbot.

  • Method 2 - Embed the iframe to your website by copying the code below and make custom web applications.


Integration Methods

Here's how it looks when you visit the URL for the Web Demo:


Interview Scheduler Google Dialogflow Chatbot

Congratulations, Now You have learnt How to build a chatbot with dialogflow.


Conclusion:

  • Chatbots are extensively used in E-Commerce, Healthcare, Banking and Finance, Travel and Hospitality, Education, Human Resources, Telecommunications and more.

  • This way it helps automate tasks and enable business to grow and gather valuable insights with a cost effective solutions.


FAQs:

1. Is Dialogflow ES free to use?

Yes, Dialogflow ES is free to use with a valid and active Project ID in the Google Cloud Console.


2. Can I Integrate Google Dialogflow with other applications?

Yes, You have multiple integration options wiz.


3. Difference between Intents and Entity?

Intents are the building blocks of a conversations while Entity is a type of Intent like date, time, location etc.


Example:

  • Intent - HotelReservation

  • Entity - Taj Hotel, Chennai


References:

You can also checkout the reference links for more detailed information on Google Dialogflow.

207 views0 comments

Коментари


bottom of page