Context | DialogFlow

Extending context duration in Dialogflow

As you might know, Dialogflow contexts expire within 10 minutes (or 20 minutes, depending on who you ask). In any case, there is a time limit for all contexts and they expire after that time. Sometimes, people need to extend the context duration for long running chat scenarios. This is what someone asked me in a comment: Yeah i do have undeterministic values for my context variables. I’m writing a Chatbot for my master thesis. I do have different courses – the user is able to get information about it. I use the context variables to track about which course he is now talking about and which intents i have to use (intends that are shared among courses). If the…

Conversation Design | DialogFlow

Can you solve the CIA puzzle?

No, not the Central Intelligence Agency. I mean Candidate Intent Ambiguity 🙂 A puzzle A while back, a coaching student of mine was facing an interesting problem. Agent ZIP file Can you figure out what the problem is? Download the agent ZIP file here and try and see if you can figure out the issue. The solution Want to understand what is going on here? Check out the Candidate Intent Ambiguity chapter in my Dialogflow Conversation Design course. Summary The Candidate Intent Ambiguity is one of the main reasons why your user’s phrases get mapped to an intent which is different from what you expected. (In contrast, it doesn’t have anything to do with the problem of the user’s phrase…

Conversation Design | DialogFlow

Reader Question: How to add a specific response when the chatbot fails in general?

This is the question I got on my Drift bot: Hello Aravind, I want to add one specific response when chatbot fails in general. Is there a way to do that? Well, that’s a fairly easy one. Assuming, of course, that I understand the question fully 🙂 You need to use the Default fallback intent for this purpose. This would also be a good article to talk about Contextual Fallback intents, because a lot of people seem to miss this feature. Default Fallback Intent vs Contextual Fallback Intent Did you know that you can create fallback intents which have input contexts? First, go to the Intents list view and click on the vertical ellipsis. Then, click on the Create Fallback Intent….

Conversation Design | DialogFlow

Entry vs Non-entry intents

In a previous series, I talked about the C = T + F + S formula for analyzing your Dialogflow chatbot. As a quick reminder: C = Candidate intents T = Target intents F = Fallback intents S = Surplus Intents An intent without an input context is always a candidate If you remember from previous discussions, an intent which doesn’t have an input context set is always a candidate intent at every step in the conversation. Let us call these entry intents. (E) An intent which does have an input context set is only a candidate if that context is active at that point in the conversation. Let us call these non-entry intents. (N) Breaking down surplus intents into…

DialogFlow | Training

Reader Question: Do you really need to add more training phrases?

I got this question via my blog comments: I think the reader brings up some very interesting questions. But the issue may not actually be due to “too few training phrases”. Here is a step by step process you can use to answer these kind of questions: 1 Avoid features which make your bot hard to analyze I provide a list of these “better to avoid” features in this article. 2 Identify the candidate intents As you are about to type out a message to your bot, make a list of the intents which are candidates at that step. (Tip: Don’t have too many candidates) 3 Identify the target and surplus intents Minimize the surplus intents, and identify the target…

Bot Frameworks | DialogFlow

Exporting your Dialogflow agent to RASA NLU

Recently I had a coaching call with a client where I explained to him why RASA was a poor choice for substituting a Dialogflow bot he was trying to build. I had taken a quick look at RASA a few months back, so I had some idea what you could and couldn’t do in it. After I went and took a closer look, I realized that I was actually overestimating RASA’s capabilities. As it stands now, you will probably want to avoid migrating your Dialogflow agent to RASA because it will not work as well, especially if you used ideas from my site to create a bunch of conversational turns. Why, you ask? Dialogflow has the notion of an explicit…

Conversation Design | DialogFlow

The CTFS framework for analyzing Dialogflow chatbots

I recently published a series of YouTube videos which explain the basics of a framework called CTFS. You can use it to better understand the behavior of your Dialogflow chatbot.  It might be more useful if you watched the videos alongside the related blog posts. What is the CTFS framework? In the videos, I propose using the following 4 types of intents to study your chatbot conversation – candidate intents, target intents, fallback intents (similar to actual fallback intents) and surplus intents. Once you understand the basic idea behind these different types of intents, you can use the following formula: C = T + F + S where C is the number of candidate intents, T is the number…

DialogFlow | Machine Learning

Dialogflow Machine Learning Algorithm

I get some variant of this question quite often from readers or coaching clients: What type of machine learning is happening within the black box? Any ideas? While the short answer is “No, I don’t since Dialogflow isn’t open source as of date”, this doesn’t mean you cannot try and reverse engineer and get as much understanding as you can by using a special tool which already exists inside Dialogflow: the score coming back in the JSON response. Here are a few things which can help you understand what is going on. I have also added the relevant thumbnail from my Dialogflow Conversation Design for those who might be interested in pursuing this further. The candidate list Imagine this. You have designed a…


Why you need to add an input context to (nearly) all your intents

On my website there is a SupportBot. Since I have hooked it up to Chatbase, I can create funnels for different conversation paths. Coaching Funnel Here is a possible path that the user could take. In this case, the funnel tells me how many people (out of those who start chatting) are interested in coaching services. For the purposes of this discussion, the last step in the funnel could be any action that you might want the user to take. Here is my question: How can you be confident that the percentage (here 3.6%) is a reasonably accurate representation for the number of people who reach the end of the funnel? False positives First, we should consider false positives. This…


Some tips for choosing the correct entities in Dialogflow

Recently, on the Dialogflow Product forum, there was this question: There is also a reply by a Google employee, which you should go and read. There are two interesting things about this question: The asker is effectively trying to fit their entire chatbot into a single intent The asker thinks that everything should be an entity (which is probably a direct consequence of point 1) But I was more interested in why someone would think that the entire sentence is full of candidates for entities. In my opinion, you should actually try to use an entity only when you absolutely need to. So how can you decide what should and shouldn’t be an entity? Here are some ideas. Learn about…


Dialogflow Tip: Intent mapping with missing parameters

Did you know that Dialogflow will allow an intent to be mapped even if the entity you specify is missing? For example, suppose you create an agent with a single intent with exactly one userSays: “I want to book a ticket to @sys.geo-city” Even if you added the geo-city entity in template mode, there will be occasions when Dialogflow will map a phrase such as “I want to book a ticket to Kovai” As it happens, Kovai is a proper city in south India but it usually goes by the name Coimbatore. However, the name Kovai is very common in colloquial use. Notice what happens inside the Dialogflow console: You can notice three things: The intent did get mapped The…


How to make sure a Dialogflow intent is ignored

I recently got this question on my YouTube channel: Without knowing the full details of the question, I suppose this person has set a lifespan which is more than 1 (the default option in Dialogflow is 5). Ideally, you always set a context lifespan of 1 for all your contexts to avoid these kinds of issues. Also, if you would like an intent to be ignored, you need to set an input context for that intent. In theory, an intent is always a selection candidate if you have not added an input context. So an important step in creating intents which can be “ignored” is to add an input context to that intent.