Creating Chatbot using DialogFlow | HCLTech

Build a lifelike conversational AI chatbot with Dialogflow

This blog delves into the process of creating chatbots by leveraging DialogFlow, a service provided by Google Cloud Platform, which allows to build extremely functional and customizable chatbots.
5 minutes read
Ashutosh Rusiya


Ashutosh Rusiya
Software Developer
5 minutes read
Build a lifelike conversational AI chatbot with Dialogflow

What is a chatbot?

A is a computer program that utilizes AI and (NLP) to understand end-user questions and give automatic responses, just like a human conversation.

Google DialogFlow

DialogFlow is a service offered by Google Cloud Platform (GCP) that revolutionizes customer interaction by facilitating the creation of virtual agents known as chatbots. It is a highly sought-after tool for enhancing customer communication, enabling seamless conversations between customers and service providers through text or voice. It is also a versatile tool — DialogFlow can be deployed within many popular platforms and services, including Skype, Amazon Alexa, Twitter, Hangouts Chat and many others. Furthermore, it can be effortlessly deployed within one’s own application or website.

Other than the ability to smoothly integrate with various platforms, DialogFlow excels in its conversational/NLP capabilities and has demonstrated its user-friendliness for non-technical personnel by supporting more than 20 languages.



Chatbots provide numerous advantages to businesses from financial benefits to improving customer satisfaction of your clients.



Benefits of chatbot

In today's age of increasing personalization in customer communication, chatbots leverage user data and insights to create tailored experiences that effectively meet the evolving demands of the customer. Other benefits include:

  1. Ability to analyze and monitor data
  2. Easy accessibility
  3. 24/7 availability
  4. Reduce customer waiting time
  5. Easy deployment and maintenance
  6. Save customer service cost
  7. No mood swings

DialogFlow workflow

The following diagram shows the basic flow for intent matching and responding to the end user.

DialogFlow workflow


A chatbot acts as an agent that can receive a query from a user, act on it and send a response. You can even give your agent a name. When creating an agent, you can name it, choose the preferred language and time zone and even connect it with available Google projects.



An agent is made up of intents that entail providing some actions or questions that the user might ask the agent. In short, there are various ways a user can express the same query, but they should all fall under one single intent.

For instance, a user can ask the agent to book a hotel in two ways:

  1. ‘Book a hotel for me’
  2. ‘I need a good hotel’

We want to be certain that both inquiries come under one intent. A user can create more than one intent and those intents will be part of a particular process or subject. It is advised to create separate instances for any particular service.

By default, a welcome intent is available to handle some basic questions or greetings from the user, but it can also be modified.


Training phrases

Once the intent is created, it is essential to instruct the agent in understanding a range of questions the user can ask and their corresponding answers. Under training phrases, ensuring the provision for user expression is needed. Though it is not required that you input every possible question, it is imperative to train the agent by providing some possible paraphrased versions of the questions relevant to business requirements.

The below list displays numerous ways a user can ask a single question:

  1. Book a hotel for me
  2. I need a hotel
  3. I want to book a hotel near Vagator beach in Goa
  4. Show me some hotels near Vagator beach in Goa



This is the chatbot’s response related to the question of intent. The user will get responses according to the answers that align with the answers provided to the agent in the training phrase.

For example, if the expressions trigger ‘Book a hotel for me,’ the chatbot can respond by saying, “Sure, for how many people?” Multiple responses can also be provided for a particular query, but it is not feasible to predict the response generated by our agent.



Entities are types of information relevant to intent parameters. Custom or system entities facilitate the identification of the type of data provided by the user. Custom entity types are specific to requirements. The agent seeks any specific keyword or requirement that is declared as an entity. The entity modifies user intent in the chatbot, providing more personalization and accuracy in responses to user searches.

Dialogflow already contains a wide range of built-in entities, also called system entities — for example, sys.geo-city, and many more. Hence, they can be simply entered in the training phrase and Dialogflow identifies them automatically.



Context is used to call one intent from another intent and to show the request type of the user. If an input context is set in intent, DialogFlow will scan through all the intents that have the same context as an output context. The flow of a conversation can be controlled with the help of input and output context.

For example, if an agent asks for the user’s name, the name would be the output context of the same intent and it would be the input context of another intent.


Prebuilt agents and Smalltalk

In addition to the elements mentioned above, DialogFlow offers a range of prebuilt agents, which are very helpful to cover some of the most basic conversational topics.

Furthermore, for any agent, ‘Smalltalk’ intent can also be activated, which enables the chatbot to become more personalized.


DialogFlow has made it very easy to build extremely functional and fully customizable chatbots as per the requisites of the organization. The purpose of this blog was to provide a high-level overview of the process for building a chatbot with DialogFlow and explore its functionality and use cases.


Share On