Home / DialogFlow ES / Do this when Dialogflow ES matches the wrong intent
Debugging | DialogFlow ES | Tools

Do this when Dialogflow ES matches the wrong intent

Website Name Change

I have changed the name of this website from Mining Business Data to BotFlo. I am offering a 60% off discount on both my Dialogflow ES and Dialogflow CX courses till April 20th 2021 for people who can help me spread the word about my new website.

Is your Dialogflow bot triggering the wrong intent?

I see questions such as these on forums sometimes:

In this article, I explain a few things you can do when you need some help figuring out why your Dialogflow agent is behaving like that.

This article only applies to Dialogflow ES bot and not for CX bots.

Understand Candidate Intents

The concept of candidate intents is a very powerful one in Dialogflow ES bots.

What is a candidate intent?

It is easier to understand candidate intents by understanding non-candidate intents.

If an intent cannot match at a given step in the conversation because it has an input context which is not active at that point, it cannot be a candidate. Every other intent in your agent is a candidate intent at that step.

This has three implications:

Using an input context for an intent reduces the number of candidates available for selection

Reducing the number of candidate intents at each step can improve the accuracy of your Dialogflow bot by giving the Machine Learning algorithm fewer ways to make a poor prediction

When you say that Dialogflow selects the wrong intent, what you are usually saying is that out of all the candidate intents, Dialogflow selected either a surplus intent or a fallback intent rather than selecting the target intent.

Use the candidate explorer to verify which intent is being mapped

I have created a free tool called the Candidate Explorer. It allows you to see which intents are candidate intents at each step.

In turn, you can see if the candidate intents at a given step match what you expect.


Learn more about the Candidate Explorer and download the tool

Use the Dialogflow Viewer and get the text output of the agent

Are you still unable to figure out why Dialogflow is detecting the wrong intent?

Maybe you are thinking of asking your question on some online forum?

So you need to manually describe your agent details as you prepare your question. Normally, this would be quite time consuming, and more importantly, might leave out some important detail. In fact, in my opinion, the sheer tedium of this step is why a lot of Dialogflow questions go unanswered on StackOverflow.

There are effectively two ways in which you can show all the details about your agent when asking questions.

You can take a screenshot of the full intent, and add it into your question like here

This is harder to read and follow on StackOverflow

Or you can manually type it out like the one here.

Much easier to read, but is more time consuming for you, plus you might leave out some information

The Dialogflow Viewer converts your agent into a text format that you can copy and paste quite easily into the text editor.

Learn more about the Dialogflow Viewer tool

Leave a comment

Finally, if you don’t get an answer on any of the forums, paste your Dialogflow Viewer output into the comments section below and ask your question. If it is NLU-logic related (and not about your webhook code), I will try and answer your question myself.

All comments are moderated, so don’t be worried if your comment doesn’t show up right away.

Similar Posts


  1. Hi Aravind!
    Is it possible to acces a Follow-up intent from the main dialogue, and not from the tree itself?
    1) Intent: What do you want?
    1.1) Intent: Wants info for Black Tea
    1.2) Intent: Wants info for Green Tea
    1.3) Intent: Want to order Tea

    If a persons says “I want to order tea”, they could access intent 1.3 directly without having to go through intent 1 first.