Stories break flow and conversation behaves incorrect

I created a conversation which gets the user’s sleep time and asks questions accordingly. A custom action was created to classify the user’s sleep category.

Later when the user responds with the expected input, it breaks the stories and responds with some other intent in the conversation.

For example:

How it should behave:

User: I slept for 2 hours Bot: Ok, but 2 hours is below the average recommendation of the National Sleep Foundation, USA. Bot: To better understand the cause, could you explain the following symptoms?? User: Yes Bot: Do you have trouble falling asleep? User: Yes/No Bot: Do you have trouble staying asleep? User: Yes/No Bot: Do you snore? Or does someone else’s snoring disturb your sleep? User: Yes/No Bot: It is updated successfully!! Bot: Alright! Have a nice day!

How it is behaving now:

User: I slept for 2 hours Bot: Ok, but 2 hours is below the average recommendation of the National Sleep Foundation, USA. Bot: To better understand the cause, could you explain the following symptoms?? User: Yes Bot: Do you have trouble falling asleep? User: Yes/No (Breaks flow and responds with another intent of another story.) Bot: Are you taking any pills that could have led to excessive sleeping? If yes, could you tell me the name of the pill? User: Yes/No Bot: It is updated successfully!

I have attached my stories.md, nlu.md, domain.yml and actions.py files in this.

How do I resolve this? Is there any mistake in the way I’ve done them?actions.py (1.3 KB) domain.yml (1.8 KB) nlu.md (1.7 KB) stories.md (1.4 KB)

If you want to have the same conversation every time, you should use a form:

are you using any tests? Setting up end-to-end evaluation would be a good start Evaluating Models