Developing an intelligent Conversational AI Chatbot based on a decision tree

Hi, I am looking for a solution for the following project: I want to create a chatbot based on a decision tree. The user should be recommended the right product from a product catalog on the basis of specific questions (nodes in the decision tree). Every product has constraints.

My first attempt was to define a story for each individual path in the decision tree. Basically it worked well, but it is not intelligent enough because the order of the questions cannot be changed. The user may already answer a question at the beginning that will be asked in the tree much later. The order of the questions should therefore not be fixed. It should also be possible for the user to answer several questions in one text so that questions can be skipped.

So my next thought was “Rasa forms”. The constraints can be specified via the required_slots. The order is no longer fixed. Unfortunately, I have not found a good solution either, because various questions are not necessary on certain paths and do not make any sense. The required_slots would have to be somehow dynamic and I would have to be able to break out of the form-loop at the right moment when a target product fits.

These considerations have been worrying me for days and I don’t see a good solution at the moment. That’s why I’m asking here.

So it should be a conversational AI that intelligently asks as few questions as necessary based on a decision tree and gives the user the product that fits the requirements.

I recommend to do first version with buttons, that keeps user in decision tree path

1 Like

You should look into dynamically updating required slots as described here.

Dynamic Form Behavior

Also on certain paths, when some condition is met and a few slots are not required, in custom validation you could fill them with some default value and this would allow you to break out of the form loop.

Can you elaborate on this? I have the same issue that some slots are not required based on the current slot values

"=I’ve run into similar issues when building conversational AI, and one workaround that worked for me was using dynamic slot filling combined with conditional logic. Instead of strictly following a decision tree, I set up custom validation rules that would auto-fill or skip certain slots based on prior responses. This way, the chatbot could handle different user inputs in a more flexible way without forcing them down a rigid path.

Another thing to keep in mind is making sure the responses sound natural. If your AI-generated chatbot responses seem too robotic, you might want to tweak the text using a humanizer to make the conversation feel more engaging and real.