Having every intent in every state. Thoughts?

vui-design

#1

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??


#2

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.


#3

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.


#4

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


#5

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ā€¦


#6

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.


#7

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.


#8

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.


#9

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