I want to be able to query my knowledge base after a form, using each sequentially collected slot as an attribute that filters the single query to the knowledge base that is made at the end of it.
Right now, I basically have a form action, in whose altered submit method I am trying to call ActionQueryKnowledgeBase at the end, with little success.
Is a FormAction even the best way to go about the situation? What would be the best methodology here?
In general, if you want to use the KnowledgeBaseAction for just one kind of query, you can most likely do the same in a custom action in an easier way. The KnowledgeBaseAction requires some special kind of slots otherwise it will not work. It might to too much work to set it up if you just want to use if for one type of query. So if you just have one type of query, I would recommend using a custom action to query your database.
Bot Q: “What is colour of the tshirt you want?”
User A: “blue”
Bot Q: “Great! And what brand are you looking for?”
User A: “Rasa”
Bot A: Queries the knowledge base and returns all Tshirts that are blue and of the brand Rasa.
If I were to do a custom action for this then, what would you say it would look like, in general? Do you have an example?
If you want to do this in between a form, you can do this querying in a custom action to ask for slot,
use case: you collect the hotel name in which the user wants to make a booking and now you want to collect the information of room type. Along with asking “what type of room you prefer” you can query available hotel rooms in that particular hotel and respond with " we provide bookings for deluxe suite, premium suite, etc…"
and if you are doing the querying after filling all slots, you can write a custom action to query after form filling