Additional questions based on previous questions

Hi,

I’m trying to build a chatbot that gets the information from a database. I would like to implement follow up questions where user can ask bot additional details based on the previous query.

For example:

Query 1: Who is topper in the class?

Query 2: How many marks did he score? – Here he should be mapped to the response from previous query.

This is a simple example, but my response can have multiple values in the answer as well.

@ramyanarwa Right, mean you want that based on previous question - you want to get the answers for one particular conversations such as:

User: Who is the topper in XYZ class? Bot: Alice is the topper in class? User: How much marks Alice got in? Bot: Alice scored 100% in class in the following subjects (name…)

Is that right?

You can use the Form with the FormValidation I guess because slots stored the values in InMemoryTracker Store. As you fill the slot he will check with the database to fetch the values. You need to write the custom code for the same.

Tips: Please rasa doc is updated as per new rasa 3 and for previous 2…x the documentation is different. Do select before seeing the doc for forms.

@nik202 In the second question if user asks like blow:

User: Who is the topper in XYZ class? Bot: Alice is the topper in class? User: How much marks did he get? Bot: Alice scored 100% in class in the following subjects (name…)

If name is given I can map the entity but if the name is not given is there a way to do it?

And if there are multiple names in place of Alice how to proceed on this?

@ramyanarwa you can your Duckling or Lookup table to name entities and you also need to train the model based on such examples, like to entities in same question or even three.

Then it not make any sense, it should go to fallback action such as “can you provide the name of the student” etc. and when the right input i.e name then form will trigger again.