TwoStageFallbackPolicy with Retrieval Actions

Hello so I have a bot that I am using and one of the major features is that the bot is able to answer FAQs about multiple topics. However I am trying to implement the TwoStageFallbackPolicy in order to allow the user to clarify what question they are trying to ask whenever the intents of the Retrieval Action is similar. For example, if a user were to ask a question along the lines of “tell me about your policy”, I would want the bot to ask for clarification in terms of something like “did you mean security policy, privacy policy, or refund policy”. After playing with TwoStageFallbackPolicy some I have not been able to achieve this because it seems the fallback actions do not get triggered since the bot is highly confident that the intent is an faq (> 0.9 in most cases). I’m wondering if there is a way to trigger the fallback actions based on the confidence of the response being selected (for cases like these the confidence may be somewhere around 0.5) instead of the faq intent. Thanks!

Welcome to the Rasa forum.

TwoStageFallback is setup to handle intent confusion which you aren’t encountering in your example question with your existing intents. Do you have separate intents for security, policy & refund policy?

We have an example TwoStageFallback action along the lines of what you’re describing in our rasa-demo. The action code is here but it will only be invoked if the intent confidence level for user utterance drops below the NLU threshold.

I don’t have separate intents for each policy they are all falling under one intent of “respond_faq” and are selected using retrieval actions.

However in this case if the user doesn’t type out a full question I want to use TwoStageFallback to clarify the user’s intent to make sure the bot is answering the question the user is trying to ask. I guess I’m wondering if it is possible to use TwoStageFallback on the intent of the retrieval action itself rather than simply the intent of what the user is saying.

Sorry, I missed the fact that you are using Retrieval Actions in your original question. Currently, you can’t use TwoStageFallback with retrieval intents. There is an open issue, #4826 regarding this.