A question about Rasa's story structure

Hi. I’m new to Rasa so might have missed something. I have a question about Rasa’s stories structure. The stories in the Rasa example after running rasa init looks something like:

happy path

  • greet
    • utter_greet
  • mood_great
    • utter_happy

sad path 1

  • greet
    • utter_greet
  • mood_unhappy
    • utter_cheer_up
    • utter_did_that_help
  • affirm
    • utter_happy

sad path 2

  • greet
    • utter_greet
  • mood_unhappy
    • utter_cheer_up
    • utter_did_that_help
  • deny
    • utter_goodbye

The way the stories seem to be structured is that if there is ever more than one way for a user to answer the chatbot, then that requires a new story.

For example there is the happy_path which uses the mood_great intent to accept user input that is positive eg. I am great, I’m good, etc.

Then there is the sad_path which uses the mood_unhappy intent to accept user input that is negative eg. sad, awful, etc.

I was wondering why it wouldn’t be better to compress the three stories and just have a single mood intent that can accept all different types of mood eg. good and bad. And then depending on the mood, responding with the appropriate utterance. I was wondering if this was the point of the actions.py file where I can handle user input and responses.

Thanks

Hi @Jmg007.

It is indeed possible to handle different moods with a single story and a custom action. The rasa init project is meant to be as simple as possible, however, and thus does not use custom actions.

Furthermore, imagine the user replies to the question “How are you?” with “Who are you?”. You want to be able to collect new stories via Rasa X and thus let your bot learn from such unexpected responses. This is especially helpful for more complex dialogues.

It is also possible to use a mixture of hard-coded “happy paths” and learned “sad paths” via Forms. Also, check out our new response selector model: Integrate response retrieval models in assistants built with Rasa