Looping stories

Hi all,

I have a story which will:

  1. Ask what does the user wants to do today. (Eg Option A, B, C)
  2. Allow user to fill up some forms (Eg. Personal info)
  3. Check if the user wants to make another option in step 1.
  • If yes, go back to step 1 and the story repeats
  • If no, exit the bot.

The user should be able to repeat the story infinitely until he/she does not want to continue.

I understand that the suggested method to achieve this is through forms. However, I will be having nested forms, which I am not sure how to handle. (I’m thinking if we can invoke another action within a form)

Any advice will be highly appreciated.

Thank you.

Hi there!

I don’t think you need or even should use stories for this type of behaviour. I think instead you could have two rules, something like:

rule: don't want to continue
steps:
 - action: utter_ask_continue
 - intent: deny
 - action: exit

rule: do want to continue
steps:
 - action: utter_ask_continue
 - intent: affirm
 - action: ask_what_user_wants_to_do

As for the nested forms – is this perhaps something you could do with a single form that has dynamically added slots? If not, can you tell me a bit more about how you want to use nested forms?

Hi @fkoerner, thanks for the advice. I tried it out on a simple bot with 2 options. When I used the default pipeline, the bot doesn’t continue beyond the second round (the bot stopped predicting just before the second utter_ask_continue. But it works after I added AugmentedMemoizationPolicy with max history 20.

stories:
  • story: Check weather steps:

    • intent: greet
    • action: utter_greet
    • intent: check_weather
    • action: weather_form
    • active_loop: weather_form
    • active_loop: null
    • action: utter_weather_forecast
    • action: utter_ask_continue
  • story: Check bus steps:

    • intent: greet
    • action: utter_greet
    • intent: check_bus
    • action: bus_form
    • active_loop: bus_form
    • active_loop: null
    • action: utter_next_bus
    • action: utter_ask_continue

Could you advise on the configurations for the story to behave correctly?

Thank you.