Recognizing actions from middle of story

I have a bot that has multiple topical tracks for a user to experience. Each track is independent of each other. When the user wants to leave one track for another, I want the bot to remember where it stopped and be able to resume from that point, should the user come back.

Using slots and custom actions, I have managed to store the last bot utterance on the current track when the user switches to a new track. This last bot utterance is then retrieved when the user comes back to the track.

I can get the bot to display the correct utterance. However, I am having issues getting the bot to recognize which part of the story it should continue from.

My stories look something like this:

  • story: Track 1


      - intent: start_track_1
      - action: utter_track_1_1
      - intent: affirm 
      - action: utter_track_1_2
      - intent: affirm 
      - action: utter_track_1_3 
      - intent: affirm
  • story: Track 2


      - intent: start_track_2
      - action: utter_track_2_1
      - intent: affirm 
      - action: utter_track_2_2
      - intent: affirm 
      - action: utter_track_2_3 
      - intent: affirm


So for example, if the user is in the middle of track 1, at utter_track_1_2, and leaves to start track 2 instead. I will store utter_track_1_2 in a slot, start on track 2. In the middle of track 2, when the user leaves to resume track_1, I will check the slot and display the stored utterance (utter_track_1_2 in this case). The user can then select to continue using the affirm intent.

The issue comes about after the user uses the affirm intent and the next bot utterance comes from an entirely different location (e.g. utter_track_1_47 instead).

It seems that maybe using a generic intent (affirm) is throwing the bot off, as well as having it start in the middle of a story. I’ve been trying various combinations of Augmentation as well as max_history in the config.yml but haven’t been able to pin down something that works.

Sample policy section of config.yml: ’ policies:

  • name: AugmentedMemoizationPolicy max_history: 3
  • name: RulePolicy check_for_contradictions: true
  • name: TEDPolicy epochs: 100 max_history: 3 ’ I hope someone will be able to shed some light on this.

I’m using RASA open source 2.2.10.

I’d like to understand why your assistant needs tracks here before I give you advice. Why are these tracks needed? Are you asking questions like a quiz? Is there a reason why a form wouldn’t work here?

The tracks are different topics that the bot has, each guiding the user down different stories. They do utilize forms to ask the user questions when needed.

Each track can be 100s of steps long. The idea is that the user can proceed down one track, and via our custom front-end, access another track halfway through. The bot is supposed to remember where the user stopped in one track when they start another track, so that they can resume from that step when they come back.

If this can’t be done via the normal rasa framework, the alternative seems to be to create separate bots for each track, which has it’s own complications and issues.