Need Guidance on Action Loops

Hello everyone! I am trying to implement a chatbot for my master’s project using Rasa Open Source (3.5.15), and I have a question regarding the following requirement.

I need to create a simple flow (or branching logic) that presents a menu with two options for the user: one that allows them to access a FAQ (which I will handle through NLU, Stories, and Rules) and another that lets them proceed to interact with our AI, which will be triggered by a Custom Action.

The challenge I’m facing is that I can’t seem to create a loop in the action_talk_with_ai . I’m unsure if I can achieve this solely with Slots and another action to control it, or if I should use a Form instead, and what slots I would need to manage this.

I would like to know if any of you have encountered this situation before or if you could offer any suggestions.

I would greatly appreciate your help!

With the help of someone from the Rasa Stack Brasil community (thanks Fran), I was able to do what I needed using Slots and with Rules with Conditions and also Fallback configuration.

I can control this loop only with Slot and everything I don’t understand (nlu_fallback)

- rule: out-of-scope
  condition:
    - slot_was_set:
        - talk_with_ai_path: false
  steps:
  - intent: out_of_scope
  - action: utter_out_of_scope

- rule: Ask the user to rephrase whenever they send a message with low NLU confidence
  condition:
    - slot_was_set:
        - talk_with_ai_path: false
  steps:
  - intent: nlu_fallback
  - action: utter_please_rephrase

- rule: Loop to generate and get response from LLM
  condition:
  - slot_was_set:
      - talk_with_ai_path: true
  steps:
  - or:
    - intent: nlu_fallback
    - intent: out_of_scope
  - action: action_talk_with_ai

If anyone needs more details or any help, please contact me.