Having every intent in every state. Thoughts?



I believe that having every intent in every state gives the developer a chance to provide the user more details about their interaction. Even if the user is not supposed to activate an intent on a specific state of the skill, the developer would know exactly what the user said and infer the action he/she was trying to accomplish. With this information the developer can return a more specific phrase to the user and not a generic Unhandled intent kind of phrase.

Is this considered good or bad practice??


This is a super interesting topic, thank you @Jesus_Mazzei for bringing this up! :+1:

You’re right, adding every single intent to any state would potentially provide a more contextual experience. Especially for things like HelpIntent, I believe there should be a contextual response for every part of the user interaction.

Overall, voice experiences should be more horizontal than tree-based, a user should always be able to shift the gears of a conversation to a different topic and not be stuck in a specific state.

I think there are different ways to handle it, all with their own pros and cons:

  • Have as few states as possible and use Unhandled only if input from the user is absolutely required
  • Don’t use Unhandled at all and allow user to move out of the state by triggering an intent that’s not inside it
  • Add every intent to every state, with potentially a lot of redirects like toStatelessIntent
  • Work with the intentsToSkipUnhandled config a lot

Your idea to add every intent to every state has kind of grown on me while I was writing this. It might be some extra work, but it definitely makes each state easy to read and look through what happens when.


Thanks for your input @jan.

I am taking the every intent on every state approach because i felt it was appropriate for my case. I am developing a trivia skill, in this skill the user can get his/her score any moment they like and the trivia works for rounds, for example 3 questions per round.

If the user asks for their score before starting the round, i respond something like “You score is N, you should play a trivia round to improve it!”

If the user asks for their score during a trivia round, i respond something like “Your score is N, you can answer the question or ask to hear the question again…”

Doing this i get to respond phrases better adapted to the context and not a generic phrase for every score request.

Probably with a lot of refactoring and a better handling of the framework i can do this with less code. i’ll keep working on it and i will write about my experience with this approach.

Thank you.


I also like the idea! Like you said, it gives more context to the response.


The obvious(?) problem with ‘every intent in every state’ is scalability. As your app gets more complicated (more states and intents) your config grows exponentially. i.e. O(n^2). That’s not nice.

So much of the design wisdom running around these days is based around the fact that mostly everyone is writing bog-simple apps. Yes, they are wide and not deep.

But the INTERESTING apps in the future are going to have depth.
They are going to be state-driven and not intent-driven. (i.e. The Dialogflow GUI approach is an absolute dead-end in my opinion…)
Consider a travel app where I can book all my flight and accommodation by voice while I drive home, or whatever - Very deep. Perhaps not even very wide at the welcome state.

There aren’t great solutions around to handle this complexity yet. But the complexity is coming. It must, or all this voice stuff will become another false start…


I agree with @PeterNann 's point. My app has ~11 states and ~30 intents last count. This approach is not scalable or appropriate in my case.

In your case @Jesus_Mazzei, I would leave the intent that checks the score stateless and check the request for the previous state and respond with some logic based on that.

I do have states that need to respond differently and do different things with yes or no responses, so typically I do have those in just about every state. Leaving them stateless and adding logic to respond by state would then become more cumbersome than adding to each state.

So I guess my view boils down to you can’t say “put every intent in every state” for everything, but rather evaluate your situation and handle as best as possible for scalablity and maintenance.


Great discussion, thank you all for sharing your thoughts and experiences on that! :smiley:

I personally think not every state should have handlers for every intent, only:

  • The handlers for the direct answers the user can give to the state’s prompt
  • State-specific help and unhandled handlers
  • Maybe handlers for the previous state’s direct answers, so the user can correct themself (Voice app: “Alright, you chose Italian white bread. Which topping do you want?” User: “I said Italian herb!”)
  • ‘Gobal’ intent handlers for navigation commands like “Go back”, “Repeat”, “Start over” (using intentsToSkipUnhandled like @jan mentioned)

Apart from the scalability issue, one other reason for not specifically handling all the intents is robustness: The NLus are not quite perfect, and in case of a mismatch between utterance and intent it’s better to handle that with “Please answer with your preferred bread type!” than with executing a specific handler that might take the user to a different place in the voice app.


Wow, thank you all for your replies.

You are definetly right @PeterNann. I did now think about scalability. My app won’t probably get much bigger and i completely missed the scalability issue. Mea culpa. I will definetly look into improving my code or, if my approach fits this small app, i’ll keep in mind that it might create serious issues for bigger apps.

Thank you @natrixx and @Florian for your suggestions. I will take them into account.

Thank you all for your support.


So, i know this is an old post BUT, i just got my first skill submitted for certification and along with some corrections(of course it would not pass at once), The Amazon Review Team send us the following recommendation

Consider providing users the ability to invoke any of the intents available at any point in the skill.

So basically they do recommend to have this, every intent on every state. I am not doing it now because the deadline was like a week ago so, you know… but something to think about.

Best Regards