Remembering the context

How to implement the chatbot that will remember the context even if it was diverted? Is there any sample GitHub code? eg.

User : I want pizza.

Bot : Happy to serve! What kind of pizza?

User : Are you human?

Bot : No, I am a chatbot. But, What kind of Pizza?

In your example right now the “No, I am a chatbot. But what kind of pizza?” is a single response from the assistant. You could choose to split them up into two seperate actions. You could then imagine a conversation something like this;

User : I want pizza.
Bot : Happy to serve! 
Bot: What kind of pizza would you like?
User : Are you human?
Bot : No, I am a chatbot. 
Bot: What kind of pizza would you like?

This way our TEDPolicy might be able to learn to handle this logic on your behalf.

That said, this is one way of dealing with the issue in general. But you might also be able to use Rasa forms here.

It also deserves mentioning that in Rasa 2.0 we might offer another way of dealing with this with the introduction of RulePolicies. Since this is still in alpha right now I’ll not expand on it now but it might be good to keep in the back of your mind.

1 Like

Thanks Vincent. Glad to see the response from you and that is really helpful. I will try using forms and get back here.

What about using ResponseSelector for this option?

Here is the reference :slight_smile: