Conversation Design | DialogFlow ES

When NOT to use follow up intents in DialogFlow

Originally published: May 2017 Updated: July 2020 There are some situations where you shouldn’t use followup intents, because it will not work. The while loop There was a chatbot called the Florist bot that was originally used as an example bot in the Dialogflow documentation (when it was still called API.AI). This is what the flowchart of the Florist bot looked like. In the figure below, the area marked in red is actually a while loop. In theory, the user can just keep indefinitely adding red roses into the bouquet and never say “No, thanks” and exit the loop. This is the “while loop” in software terminology. It is not possible to use followup intents for this conversation flow, since…

Context | DialogFlow ES

Dialogflow Context Lifespan

I have mentioned in many of my articles and videos that I recommend using a context lifespan of 1 in all your intents. I have collected all the related ideas into this single article, and also updated it with my current view as of June 2020. This article is based on a few different articles I had written previously on the topic of context lifespan. Optimal context lifespan in DialogFlow Note: this is a somewhat advanced topic, and certainly a bit opinionated. I wouldn’t recommend beginners get into this article until they have built at least a toy bot and experienced all the features in Dialogflow. Contexts If you are building bots using Dialogflow, you are probably aware of contexts….

DialogFlow ES | Website Bots

Dialogflow Messenger tutorial

In this tutorial, I explain how to add a chatbot to your website using the Dialogflow Messenger integration. What we will be building The video below shows what we will be building in this tutorial. Embed the chat widget into your website Embedding the chat widget into your website is straight-forward. Create your Dialogflow agent Create a new Dialogflow agent, and remove the Welcome event from the Default Welcome Intent. Add a new intent into your agent with the following information (note that it includes the Welcome event). Add the script to your web page Once you create your welcome intent, go to the Integrations pane, and select the Dialogflow Messenger integration. Now copy the script into your clipboard. Paste…

DialogFlow ES | Training

Do I need to hire a developer to build MY chatbot idea?

I recently got an email from a course student: Let me describe my background first. I am an engineer, but not in computer field, so I consider myself technical, but not programmer. With many reasons I choose to change my working field, and I have tried to learn about IT and programming and end up with building a chatbot. Before I took your courses, I enrolled in Javascript + NodeJS courses, then Dialogflow course in Udemy which teaches using Dialogflow with Facebook Messenger by custom integration (REST API approach). As a programming beginner, it was very painful and costed a lot of time. Even after I completed that course I still had no confidence I could build a real thing….

Context | DialogFlow ES

Three types of Dialogflow contexts

You might not have realized this, but there are actually three types of Dialogflow contexts. And I recommend only one of them. Implicit and auto-generated contexts When you use the slot filling feature, which I do not recommend, you are using implicit, auto-generated contexts. (Note: I use auto-generated and system generated interchangeably, they mean the same thing). These contexts are auto-generated because you didn’t create them but they are automatically generated by the system when you define a parameter as being required. They are implicit, because their presence cannot be used to infer candidate intents. Explicit and auto-generated contexts When you use the follow-up intents feature, you will notice that Dialogflow automatically adds an output context to the parent intent…

DialogFlow ES | Knowledge Connector

Dialogflow Knowledge Connector : Pros and Cons

A reader asked me this question recently: Do you think the beta knowledge base within Dialogflow is useful? Or are their better ways in to implement a FAQ bot with Dialogflow? There are two types of FAQ chatbots you can create in Dialogflow. 1 You can use the knowledge connector feature (beta) 2 You can use regular intents Knowledge Connector example I recently created a knowledge connector bot and integrated it with Telegram. This is what it looks like: A few things to note: I used Telegram because of the ease of integration. You can use any channel integration and get similar results. There are multiple results per user query. In the screenshot above, there are 3 results In Dialogflow,…

DialogFlow ES | Integrations

How to integrate Telegram with Dialogflow

In this tutorial, I explain how to integrate your Dialogflow bot with the Telegram chat app. Why I prefer Telegram when creating tutorials I usually prefer to use Telegram for creating tutorials and demos. There are a few reasons for this: The process of creating the bot inside Telegram is quick since you can do it by sending messages to a designated “BotFather” account Telegram has only a single access token, so the integration steps are fewer Telegram supports a few rich responses such as buttons Hyperlinks in the text response of Dialogflow are automatically converted to clickable links inside the Telegram chat window Telegram supports multiple responses per message (for example, the 1-click web demo doesn’t support this) How…

DialogFlow ES | Slot Filling

A Guide to Dialogflow Slot Filling

When I first started consulting in Dialogflow, I noticed a pattern. A lot of clients who came to me had made a complete mess of their chatbots, and all of them were using the slot filling (required parameters) feature. When you use required parameters in Dialogflow, you are telling Dialogflow – “please ensure that this parameter is actually collected from the user”. When you mark a parameter as required, it will trigger slot filling – and Dialogflow will keep prompting the user until they provide the input. As of this writing (Feb 2020), there isn’t any way to limit the maximum number of retries. I don’t recommend that people use slot filling in their Dialogflow chatbots. It makes your bot…

DialogFlow ES | NodeJS | Webhooks

Deploy NodeJS Webhook to Google Cloud

This tutorial was a series of posts which was first published in October 2017. There have been many updates in Google Cloud after this tutorial was first created, so it may not be the best learning resource for this topic. A couple of things to note: almost certainly, the interface will look different today and the screenshots may not be up to date whenever I ask you to click on a certain link, it is understood that you are already logged in to your Google account (that is, many of these links take you directly to specific feature pages inside the Google Cloud Console) If you would like me to update this tutorial, please leave a comment below. If I…

DialogFlow ES | Firebase

Dialogflow Firebase Tutorial

This tutorial was originally published in November 2017, so it is actually more than 2 years old. Cloud Firestore was still in beta when I published it (now it is out of beta). In that time, a lot of things have changed in Firebase, so this may not be the best resource for learning this topic. I have consolidated the old tutorial into a single page and left the contents mostly as they were. Obviously this article is due for an update but I am not sure how many people are interested. If I get at least 10 comments requesting me to update this tutorial, I will do it. 🙂 Introduction This guide will explain how you can use Firebase…

Conversation Design | DialogFlow ES

How to debug your Dialogflow bot

I recently got feedback from a reader. He was answering a question about a tool which Dialogflow should have but doesn’t. Debugging of dialog flow , which is very important tool that should be there Now, I don’t think you can “debug” Dialogflow by setting breakpoints the same way you would when writing code, at least not yet. But there are a few things you should learn about when you try to debug your Dialogflow bot. Learn the basics The first step is to learn Dialogflow itself systematically. It is a very good example of investing some additional time up front, and saving yourself hours/days/weeks in the future. In my view, the best way to learn Dialogflow systematically is to go…

DialogFlow ES | Natural Language Generation

Client Question: Can I use GPT2 for my Dialogflow bot?

Recently, one of my clients asked me if it is possible to use GPT2 for his Dialogflow bot. Short answer: probably not. Natural Language Generation (NLG) GPT2 is a machine learning model (and associated code) which can automatically write text. Here is the official definition: The text is grammatically correct, too. Often you will find it hard to distinguish between something written by GPT2 and human-generated prose if you don’t know anything about the subject. 🙂 Two types of chatbots There are primarily two types of chatbots. Task led bots – the kind of bots that you usually create in Dialogflow. Here, there is a specific task that the user wants to do, and your bot will help and guide…