paint-brush
The 3 main components of a DialogFlow agentby@mgazar
1,815 reads
1,815 reads

The 3 main components of a DialogFlow agent

by Mostafa GazarJanuary 27th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

DialogFlow was founded back in 2010 and got acquired by Google in 2016. The beauty of DialogFlow, is that we can use it to build an agent and then integrate it with voice or text across multiple services. Services like Amazon Alexa, Google Assistant, Facebook Messenger, Twitter, etc…

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - The 3 main components of a DialogFlow agent
Mostafa Gazar HackerNoon profile picture

Intents, contexts and entities are the 3 main components of any DialogFlow agent

DialogFlow was founded back in 2010 and got acquired by Google in 2016. The beauty of DialogFlow, is that we can use it to build an agent and then integrate it with voice or text across multiple services. Services like Amazon Alexa, Google Assistant, Facebook Messenger, Twitter, etc…

Supported integrations

1. Intents

An intent represents a mapping between what a user says and what action our app need to take. Usually we would have more than one intent in an agent.

Think of this as a decision tree and we need to map a user's phrase to a specific outcome/response.

There is also this concept of a fallback intent, in case the agent did not know how to respond to something.

2. Contexts

Contexts guide the conversation because they tell us what we know at any given point.

Let us imagine a conversation flow like:

  1. Search for jobs in Wellington
  2. Order them by date

The second conversation item (intent), can have an input context (like search criteria). We can also ask the user to provide the missing input context to be able to correctly trigger the intent.

3. Entities

They are the values in user says like location, date, etc…

DialogFlow has some pre-defined entities like address, city, etc…, these are called system entities. There are also the entities we define in our agent, which are called developer entities.

Finally, we would most probably also need a backend that goes with our agent. Which we could either implement and host it on our own or use Firebase Cloud Functions (just like Amazon Lambdas) for that.

Final thoughts

Back in the early days of personal computers, users had to interact with the console. A black screen with few to no options to choose from.

Then came visual interfaces. It became more obvious what a piece of software “can do”.

Now we are moving to a sort of ambiguous form of interacting with our machines again, using voice. It is ambiguous because we cannot yet just speak naturally with it and it can be tricky to figure out what it is capable of doing.

If you enjoyed reading this story, please 👏 and share it to help others find it! You can also follow me on Twitter to get notified when I publish a new story.