Any way to set a story at the beginning of every training story (or soft-reset a user message)?

I have a story in my bot that is triggered at the start of every conversation; it sets the slots at the beginning of the conversation and uses those slots throughout conversation to provide conditional utterances. I have the story laid out in training data and working properly, but I’m wondering if there was a way to make the model being trained have that story at the start of each of the data-augmented stories to improve performance?

Either that or a way to use the mapping policy along with a returned UserUtteranceReverted() event that doesn’t reset slots, just bot and user messages. I’ve tried several combinations and none has worked because UserUtteranceReverted() undos side effects of a custom action that was a result of a provided intent.

Hi Kevin,

If that story is used at every conversation, the easiest way to add it to each training story is to use a checkpoint. However, This is only good approach if your really need that story added to pretty much every training story. Check out the implementation of the checkpoints here: Stories

Hi @niveK I’m not able to set SlotSet if i use UserUtteranceReverted()

For Ex: return [SlotSet(‘admin’, False),SlotSet(‘firstName’, first_name),SlotSet(‘lastName’, last_name),SlotSet(‘userId’, user_id),SlotSet(‘role’, user_role),UserUtteranceReverted()]

Any help is much apperciated

I’d recommend customizing the SessionStart action, as this is now supported by Rasa out-of-the-box. UserUtteranceReverted() is good for the Mapping Policy since you don’t want those interactions affecting the next action’s prediction. It will clear the user’s message, bot’s response, and any side effects as a result of that interaction, so you probably don’t want to use it for those purposes.

Thank for the reply @niveK is it possible to send me an example to load slot variables at the start of the conversation and maintain through out the session?

The docs I linked for customizing the session start action should cover you there. See the fetch_slots method.

cool! Thank you