Entering a story from a middle-point

Hi,

Is it possible to enter a story from a middle-point?

For example:
(1) User: “Offer me something healthy to drink”
(2) Rasa: “Water are very healthy”
(3) User: “Yes, I know, but I don’t like water”
(4) Rasa: “May I offer you something else?”
and so on…

So far, it’s just a straight-forward story/intent usage of Rasa.

Now, let’s assume that our backend replied (2) back to the user instead of Rasa, e.g. with some rule-based engine or so, and let’s assume that the user indeed replied back with (3).
Can we ask Rasa to take it from here, and respond with same behavior as (4)?
Can we somehow “inject” the conversation history to Rasa and resume the story from that middle-point?

Thanks ahead,
Newt Team

Hi there!

This can in theory be done - you can modify the events of the tracker in an action. However, I’d ask why you want to do this. If you’d like to create rule-based behaviour, you can use rules. Or, you can utter specific messages using dispatcher.

If you can tell me more about your use case, I’d be happy to help you figure out how to do this with the tools Rasa provides.

Hi Felicia,

Thanks for your reply.
The use case is as following -
Rasa is applied as a bot engine by our backend.
In other words, the end-user communicates with our backend, which in turn communicates with Rasa bot.
In many cases, our backend just act as a transparent middleman, passing messages between Rasa and the users.
However, in some cases, our backend communicates with the user by other means, and in some point in the conversation, would like to switch for Rasa engine.

We guess we shall modify the events of the tracker in such cases, right?

Thanks,
Newt Team

Hi Shahar,

If you feel that this backend acting as a middleman is necessary, then yes, you’ll need to modify the tracker. Though I would urge you again to try and implement the functions of the backend in Rasa itself and do away with the middleman. I think this will be easier and also avoid any unexpected behaviour from using the tracker in an unintended way.

If you’d like help with trying to implement the backend in Rasa itself, please let me know!

Hi Felicia,

Excellent, got it.
We’ll do some re-thinking, according to your recommendation.

Thanks,
Newt Team.

1 Like

Sounds good, do let me know if you get stuck.