Back to Top

How to create your First agent in DialogFlow?

First time in my blog, I come with something different article topic and is DialogFlow. In this article, I am going to show you how to create API.ai based dialog flow without coding.

In this article, I am not going to write any programming or logic on the DialogFlow. What I am actually going to do is to show you how DialogFlow handles all the NLP via backend.

Introduction to DialogFlow

Dialogflow is a natural language processing tool and it was created in 2010. Natural language processing is an entire field of Artificial Intelligence. It is also called as API.AI. It was small startup and Google noticed it and come over with partnership and after that Google released it’s paid version.

Dialogflow is available as free and paid version. Paid version has more features. Basically, It is like create an action in Google Assistant.

Dialogflow takes any normal conversation text and extract computer understandable information from it and process that information to generate the output.

Why DialogFlow?

You can build your own chatbot application using dialogflow so one of the simplest use cases of dialogflow is to create a chatbot or you can create a to use existing application with language processing.

Dialogflow is a buzzword in the machine learning and how they deal with the things. Dialogflow is the concept of intelligence agent which has the ability to act rationally. It is flexible and able to learn and make appropriate choices.

How dialogFlow works?

There are examples of what users input would be, you write on those examples and using those it learns so that if I said something in the future, it would try and match that to an already given example and that’s where the whole machine learning comes into the play. This is an idea of an intelligent agent.

Sometimes it is not quite an intelligent agent because if you say something and it doesn’t understand so next time you say the exact same thing then you will get the exact same answer so there is no artificial intelligence learning, everything is hardcoded there from the developer.

How you can implement Dialogflow?

Here I am going to tell you the technical architecture of Dialogflow.

Basically, You can use Node JS for server-side action on Google Package. It also provides SDKs for Android, PHP and bunch of others ones too but at the moment most people are using Node JS because there is a significant amount of other packages that help in the chatbox. The backend is recently integrated using Google firebase. Previously, there was a Heroku for backend but now you can build your backend directly in DialogFlow.

Components of DialogFlow:

There are three main components :

1.Intents:

This is the first component of DialogFlow. An Intent is how agent determines what to do with the input.

There are two types of intents:

1.Normal intents: It is normal intents to establish context to process conversation
2.Fallback intents: It is useful when it doesn’t know something and handle those types of inputs.Fallback intents are used to handle an unmatched input

2.Contexts

Each intent has a context associated with it, both input and output context. Context is used to guide the situation. Each intent has zero to many inputs and output context.

3.Entities

Entities are nothing but just values which you can use for generating a response. All the values dialogflow picks up stored in the context and are accessible anytime.

How to use DialogFlow?

Let’s get started to use:

First of all, Go to https://dialogflow.com/ and sign up if you don’t have an account.After signup, Click on the “Create Agent” button

Enter the agent name and click on Create button to proceed.Dialogflow will create the agent for you. An agent is a project in a simple manner. Here, I have entered the agent name as “SupportRequest”. After that, it will redirect to next page which will ask for intents.

This screen display two presets intents “Default Welcome Intent” and “Default Fallback Intent”. You can enter if require more else click on “create” button and it will show below screen:

In the left column, You can see the tabs for Intents and Entities.Intents are the actions triggered by certain keywords which are defined by the author and entities are the group of objects that fall under the certain category.

Let’s add entities.Entities are just like nouns that algorithms understand. Click on the tab “Entities” and you will get the below screen”

Here, Enter the name of the entity and click on create. Next, You will get the below screen where you need to enter entities and output:

Here, You need to enter what require to tell to a user. For Example, When user type “hi” so what will be the answer?. It will be “Hi”, “Hello”, “How are you?” etc so these are the entities.

But how to identify that user request to be responded with the high response is an intent. Intents will be your object of the context which will identify which kind of response you require to generate.

Next, we will go to intents section and note that already intents are there, a default fallback intent which is triggered at everytime user say something and if application doesn’t understand and a default welcome intent which is triggered if the user says something like “Hi” and respond something similar.

DialogFlow uses machine learning to identify the phrases that trigger the intent. So, that’s it your bot is ready to respond. You just need to add intents and entities to work your bot.

Now, Let me show you a plugin which provides basic interaction by default and it is called small talk.so go down to your screen and click on “Small Talk”.

You will get the above screen. Just click on the enable switch. Just doing this, it makes your bot look very smart and you don’t need to create anything for basic interaction.

This is a very simple dialogFlow agent that takes user parameters and put them into text response with a DialogFlow. Here, I have just built a chat UI but if you want it working in the actual interface, you have to go into “Fulfillment”

In this screen, You have to enable the webhook.

Once, your entire bot is ready, you can actually deploy it where your user actually interact with and for that, you need to go to “integration”

A user can interact with a bot in many different ways like facebook messengers, slack, twitter, skype etc. You can create any app within 5 minutes.

So, Go and create your DialogFlow based app. You can create a lot of entities here. At last, DialogFlow is a very powerful tool to build AI based application very easily.Thanks for reading. I hope you are going to use DialogFlow after reading this article.

Write your queries on below comment section. Also, let me know if you are interested in more articles of DialogFlow.

Comments (1)

  1. Tetrapackerl says:

    Thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How To Change Database PREFIX in WordPress

Posted on 6 years ago

Bhumi

The Readers’ Poll – July 2013

Posted on 5 years ago

Bhumi

MySQL FULLTEXT Index and Search

Posted on 3 years ago

Bhumi

How to use CONST keyword in PHP

Posted on 6 years ago

Bhumi