# Wrong Action triggered after correctly identifying intent

**URL:** <https://forum.rasa.com/t/wrong-action-triggered-after-correctly-identifying-intent/10709>\
**Category:** Rasa Open Source\
**Created:** [May 31, 2019, 8:43am UTC](https://forum.rasa.com/t/wrong-action-triggered-after-correctly-identifying-intent/10709 "2019-05-31T08:43:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![enginoir](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@enginoir](https://forum.rasa.com/u/enginoir)\
**Post date:** [May 31, 2019, 8:43am UTC](https://forum.rasa.com/t/wrong-action-triggered-after-correctly-identifying-intent/10709/1 "2019-05-31T08:43:46Z")

</div>

I have a defined user story that follows this template : -

```
## story1
* intent1{'entity':'value1'}
   - action_1
   - utter_was_that_useful
* affirm
   - utter_goodbye
   - action_reset_slot
* deny
   - utter_take_action
 ## story2
* intent2{'entity':'value2'}
   - action_2
   - utter_was_that_useful
* affirm
   - utter_goodbye
   - action_reset_slot
* deny
   - utter_take_action

```

I have entity labeled training examples for all the intents in the **nlu.md** file, and am using Memoization/Keras policy with **max history** set to 2 and **augmentation factor** set to 0.

However, the core consistently triggers the wrong action after correctly identifying the intent, and completely abandons the story in some cases ( triggering **goodbye** after the **deny** intent, despite that chain not being a part of any story). I suspect that has something to do with the way I have defined the story. Can someone please help me figure this out? Thanks

I have consulted [this](http://forum.rasa.com/t/solved-predicted-action-not-following-the-story/3364) solution, but it made no difference in the behavior of my bot.

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [June 5, 2019, 1:54pm UTC](https://forum.rasa.com/t/wrong-action-triggered-after-correctly-identifying-intent/10709/2 "2019-06-05T13:54:53Z")

</div>

HI @enginoir. How many training stories do you have?

---

<div class="post-metadata">

**Author:** ![rbossie](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@rbossie](https://forum.rasa.com/u/rbossie)\
**Post date:** [June 6, 2019, 7:04am UTC](https://forum.rasa.com/t/wrong-action-triggered-after-correctly-identifying-intent/10709/3 "2019-06-06T07:04:24Z")

</div>

@enginoir I’m wondering what you mean by your story, If the user sends a message with intent1, and the bot utters was\_that\_useful, do you want the user to either say yes or no? Because the way your stories are defined now, you want the user to say yes all the time and then say no afterwards.

Correct me if I misinterpreted what you want to do, but I think you should define your story this way:

```
## story1happy
* intent1{'entity':'value1'}
   - action_1
   - utter_was_that_useful
* affirm
   - utter_goodbye
   - action_reset_slot

## story1unhappy
* intent1{'entity':'value1'}
   - action_1
   - utter_was_that_useful
* deny
   - utter_take_action
```
