RASA 2.0 Stories do not continue after form is handled

Hello RASA heroes,

I migrated my forms from RASA 1.X to RASA 2.0 and they are working now (YEAH!). However, now my stories do not continue properly after. An example story can be seen below:

steps:
  - intent: intent1
  - action: action1
  - action: action2
  - action: form
  - active_loop: form
  - slot_was_set:
    - requested_slot: slot1
  - slot_was_set:
    - slot1: 12AB
  - slot_was_set:
    - slot1: 12AB
  - slot_was_set:
    - requested_slot: slot2
  - slot_was_set:
    - slot2: 3SX
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action3
  - intent: affirm
  - action: utter_confirm

Everything works fine up until and including action3. However, when I then type “Yes” (this is recognized as affirm intent with a 99% probability) the bot just goes to the next line instead of uttering.

Any ideas on why this is happening? I thank you in advance!

Hi @fabrice-toussaint

Your story looks good to me. You would expect that after affirm the bot uses utter_confirm.

You can check if there is something in rules.yml or a different story that might confuse the bot.

What do you get back if you run the bot in the terminal with rasa shell --debug?

Apparently it predicts action_listen instead of continuing the story. Do you have any idea why this happens?

EDIT: I think it might have something to do with max_history of Memoization Policy.

Hi @fabrice-toussaint

I see at the first line: rasa.core.policies.rule_policy - There is no applicable rule.

Did you activate the RulePolicy in config.yml?

For example like this in config.yml:

policies:
   - name: MemoizationPolicy
   - name: RulePolicy
   - name: TEDPolicy
     max_history: 5
     epochs: 100

If after - action: action3 followed by - intent: affirm always - action: utter_confirm must be used by the bot, you can include this in rules.yml.

For example like this in rules.yml:

- rule: Use after action3 + affirm always -> utter_confirm
  steps:
  - action: action3
  - intent: affirm
  - action: utter_confirm

You can also do this in stories.yml. I always use the following principle: If the bot has to do it in 100% of the cases, I include it in rules.yml. If it is an exception, I include it in stories.yml.

See the documentation:

Does this suggestion work for you?

Thank you again @Johan1us, this is very helpful and I will implement it! I do have the policies included as you mentioned (the RulePolicy was activated). When I increased my max_history it worked fine but I am going to change it as you mentioned by including it in the rules.yml!