Story is not following according to slot_was_set

We have created stories where the actions are different for the same intents which are executed based on the slot_was_set (slots). First time in the session, it followed the story properly, but the next time, it was not following the relevant story.

- story: story | affirm part
  steps:
  - intent: intent1
  - slot_was_set:
    - is_authenticated: true
    - is_activated: Y
    - slot1: true
    - slot2: true
    - slot3: true
    - slot4: true
    - slot5: false
    - slot6: false
    - slot7: true
    - slot8: category1
    - slot9: categ2
  - action: utter_utterance1
  - intent: affirm
  - action: action_one
  - intent: affirm
  - action: utter_issue_resolved
  - action: action_utter_flow_feedback_form

- story: story | deny part
  steps:
  - intent: intent1
  - slot_was_set:
    - is_authenticated: true
    - is_activated: Y
    - slot1: true
    - slot2: true
    - slot3: true
    - slot4: true
    - slot5: false
    - slot6: false
    - slot7: true
    - slot8: category1
    - slot9: categ2
  - action: utter_one_confirmation
  - intent: affirm
  - action: action_one
  - intent: deny
  - slot_was_set:
    - ticket_user_input: null
  - action: utter_enter_comments
  - action: ticket_user_input_form
  - active_loop: ticket_user_input_form
  - active_loop: null
  - action: action_create_sr
  - action: action_utter_flow_feedback_form

- story: story 3 | for slot8: category2
  steps:
  - intent: intent1
  - slot_was_set:
    - is_authenticated: true
    - is_activated: Y
    - slot1: true
    - slot2: true
    - slot3: true
    - slot4: true
    - slot5: false
    - slot6: false
    - slot7: true
    - slot8: category2
  - action: utter_confirmation
  - intent: affirm
  - slot_was_set:
    - ticket_user_input: null
  - action: utter_enter_comments
  - action: ticket_user_input_form
  - active_loop: ticket_user_input_form
  - active_loop: null
  - action: action_create_sr
  - action: action_utter_flow_feedback_form

For instance, in the above example, it is following the story “story | affirm part” first time, but next time, it might follow the third story “story 3 | for slot8: category2”, or go to default fallback, when it should have followed the first story “story | affirm part” according to the set slots.

How should we write the story, so that it follows as expected? Is there any problem while using slots, the way we have used?

The debug log will show you what’s happening with the slot values and dialogue prediction. This will answer your question about where it is going wrong. Could be the slots are not set as you think they are.

Confirm that all of these slots have influence_conversation: true

More than likely, you’ll want to give up on this approach using featurized slots. 11 featurized slots for a single story is not a best practice. Better to use forms for this.

Can you give me an example, as how we can use forms to reduce dependency on many slots?

Read thru the forms doc page. You can also look at the helpdesk and financial demo bots.