Conversation Pause and starts where we left off

Hi,

I am facing one issue. I created some single liner FAQs stories and some large stories. So, if user is doing conversation based on the large story and in the middle of the story if user ask any other FAQ question (single liner story) then in this case bot should respond answer to the FAQ question and continue conversation of the main story.

Single liner story:

What is Rasa

  • about_rasa
    • utter_about_rasa

Multi liner story

  • greet
    • utter_greet
  • about_universe
    • utter_universe
  • name_of_galaxy
    • utter_name_of_galaxy
  • name_natural_satellite
    • utter_which_planet
  • planet_name
    • utter_name_of_natural_satellite

But in case user do conversation mention below in this way then how can I handle this case? User asked about Rasa in the middle of the story. and I don’t know at which step user can ask.

Multi liner story conversation:

User - Hi

Bot - Hi, How can I help you?

User - Do you know about universe?

Bot - yes I know about it.

User - what is the name of our galaxy

Bot - Milky way

User - Name of the natural satellite

Bot - Of which Planet?

User - What is Rasa?

Bot - Rasa is awesome

Bot - Of which Planet you want to know about natural satellite

User - Earth

Bot - It’s Moon

Thanks and Regards

Harsh

@akelad Hey, Can you please help us with this?

You can use MappingPolicy combined with a custom action for this.

Set up a trigger for each FAQ intent to execute a custom action called, say, action_handle_faq. You can then respond with an utterance depending on the specific FAQ intent followed by repeating the last thing you asked. Then, you will need to apply a UserUtteranceReverted event so that the MappingPolicy step is forgotten and the prediction proceeds as though the FAQ step never happened.

Also explore our new Response Selector component that makes handling these scenarios more elegant.

The other option, of course, would be to write enough stories with the FAQ intents cropping up at random times so that the model learns to predict these things from that. If the above option doesn’t work out for you because deciding the follow up questions is non-trivial from the context, I’d suggest this option.

Hi @msamogh,

Thanks for the reply.

So, should I write same story with different combinations because user can ask at any level.

Thanks and Regards Harsh

hi @kapoorh

I guess the Implementation should be changed here.Take a look at your story

  • name_natural_satellite
    • utter_which_planet
  • planet_name
    • utter_name_of_natural_satellite

This doesn’t look right

When the user asks a question like

User - Name of the natural satellite

the bot should need to get an entity/slot like name of the planet (eg: Earth) to proceed further.So this scenario comes under rasa slot filling for that make use of rasa forms.

Now you can write some stories to handle such FAQ intents in between slot filling intents

I hope it helps

Hi Anand,

you are right, I gave an example only. I have some some stories but my major concern if in the middle of any story user ask different question then bot should reply answer of that question and just after bot should ask to the user the same question where left off.

Thanks and Regards Harsh

Well Just create a form action class (eg:form_satelite_name). Make planet_name as the slot you want to capture.

Now for story

  • name_natural_satellite
    • form_satelite_name
    • form {“name”:“form_satelite_name”}
  • about_rasa
    • utter_about_rasa
    • form_satelite_name
    • form {“name”:“form_satelite_name”}
    • form {“name”: null}

What the above story does is as follows

User - Name of the natural satellite

Bot - Of which Planet?

User - What is Rasa?

Bot - Rasa is awesome

Bot - Of which Planet?

User - Earth

Bot - It’s Moon

Now you can see that after about rasa the bot immediately resumes with the form action and ask you regarding the satellite question

You can write stories for each of those edge cases or come up with a some custom logic inside your form action class if you don’t want to write stories for all the cases.

I hope it’s clear

Thanks for the reply Anand!! But we don’t know when the user will ask a different question at which point of the story. And it can any question. So we can’t write all stories of with all combinations. I think I should write an action for each and every FAQs. And in the same action there must be some logic to get the previous intent and related to which story.

I don’t know whether I am right or not, and will it achievable?

Thanks and Regards

Harsh

Hi @kapoorh,

Extremely sorry for the delay. Yes writing all such combination can be hard.This is something the @Rasa should look into.

The best approach is to store the name of your form in a slot for example

form_name = 'form_satelite_name’

The tracker will only give value to form_name when you are within that form because after the execution of forms we reset all our slots which includes the form_name as well.So you can leverage this characteristics of rasa to come up with a custom logic .To handle out_of_scope or other intents within a form actions without writing much of stories.I hope you got this.

and coming to your question

And in the same action there must be some logic to get the previous intent and related to which story.

This completes destroy the whole idea of using a AI based conversation agent since you are writing so much of custom decisions here.This may seem easy at the beginning but when scaling can cause so serious issues.

I hope it helped

Regards

Anand

1 Like

Thanks Anand!! I will try the same use cases with FormPolicy.

If I face any issue then will let you know.

Thanks and Regards Harsh