Need understanding of skill order/fallback

Hi all,

I’m about to jump into some skill development, but I want to make sure I understand how the “order” or fallback works. This question stems from the fact that with Wolfram Alpha and DuckDuckGo enabled, I can’t tell which one it’s going to use.

For instance “Who is George Washington?” gets a response from both Wolfram Alpha and DuckDuckGo, but uses the DuckDuckGo response.

If I were to build a third fallback instance, how does Mycroft prioritize?

Also, can a fallback be “de-prioritized” to only run if no answer is found to the query?

Thanks!

Hi there,

It’s a good question, and there’s actually two pieces here - Fallbacks, and the Common Query Framework

With each of the Common Frameworks (Common Query, Common Play, and Common IoT) a Skill using that system reports its confidence that it can answer/fulfill a particular query. This is what DDG and Wolfram are doing. They both go look for an answer and report back through the Query Skill how confident they are that they’re correct. The most confident then gets to answer.

So you can create another Skill and register it as a Common Query Skill, then it will also be asked to report how confident it is that it can answer questions. We have some new documentation to get you started on these types of Skills here:
https://mycroft-ai.gitbook.io/docs/skill-development/skill-types/common-query-framework

Getting back to Fallbacks - the Common Query System is a special type of Fallback Skill, however you can have a general fallback. All Fallbacks are assigned a priority level (from 1 to 100+) that determines the order in which they’re checked. So a Fallback with priority 8, will get to try and answer a question before a Fallback with a priority of 28. If it believes it has successfully answered, it will return True and no other Fallback Skills are called upon. If it doesn’t have an answer the Skill returns False and the next Skill in the queue gets a turn.

There’s some more docs here to get you started if you think a general Fallback is the way to go.
https://mycroft-ai.gitbook.io/docs/skill-development/skill-types/fallback-skill

Hopefully that clears it up a little, but if not please let us know. Interested to hear what you have in mind for your Skill too :slight_smile:

3 Likes

That cleared things up very well, exactly what I needed. Thank you!

1 Like