# Help needed! Issue with dererministic policies and payloads

**URL:** <https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796>\
**Category:** Rasa Open Source\
**Created:** [August 1, 2019, 7:53am UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796 "2019-08-01T07:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![melaniab](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/melaniab/32/4343_2.png) [@melaniab](https://forum.rasa.com/u/melaniab)\
**Post date:** [August 1, 2019, 7:53am UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796/1 "2019-08-01T07:53:16Z")

</div>

I have an issue with Rasa deterministic policies and payloads. I am bulinding a simple (and stupid) deterministic bot that tries to guess your job based on few questions. Questions are answered only by buttons and checkboxes, so there is no natural language processing and I’m using only the following policies:

```auto
policies:
  - name: FormPolicy
  - name: MemoizationPolicy
  - name: MappingPolicy

```

I have a question with a button, then one with a checkbox, and then one with a button again. Everything works good until I come to the final button. Then, when it is selected, the conversation just stops, even though I see in the log that the right payload was uttered. I tried moving logic from `actions.py` to stories and to domain, tried using checkpoints, but nothing made the conversation continue.

One thing that worked was including `KerasPolicy` in the configuration file. Then, the conversation contiued, but after this, I faced all kinds of other issues. I will skip them for now as I belive fundamentally, there sould not be a need to include `KerasPolicy` in a deterministic bot and there should be another solution to changig payloads.

Can somebody help?

I have the following story:

```auto
## dialog beginning
* disclaimer
  - utter_disclaimer
  - utter_question_1
> check_question_1

## Developer 
> check_question_1
* button_Java 
  -utter_java_dev
  
## data scientist 
> check_question_1
* button_R
  -utter_ds
  
## checkboxes 
> check_question_1
* button_python  
  - utter_question_2
  - question_2_form
  - form{"name": "question_2_form"}

 ## happy chatbot path
* button_yes 
  - utter_happy_chatbot_dev

## sad chatbot path 
* button_no
  - utter_sad_chatbot_dev

```

There is a FormAction assosiated with `question_2_form` with the folloging logic:

```python
        if tracker.get_slot("tensorflow") == 1:
            dispatcher.utter_template("utter_ml_engineer", tracker)
        if tracker.get_slot("git") == 1:
            dispatcher.utter_template("utter_python_dev", tracker)
        if tracker.get_slot("rasa") == 1:
            dispatcher.utter_template(template="utter_question_happy", tracker=tracker)

```

where `utter_question_happy` looks like this:

```auto
  utter_question_happy:
    - text: >-
        Are you happy?
      buttons:
        - title: 'yes'
          payload: button_yes
        - title: 'no'
          payload: button_no

```

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [August 1, 2019, 9:18am UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796/2 "2019-08-01T09:18:57Z")

</div>

Hi,

Without using Keras Policy, when the last payload was given, what was the action predicted by Rasa core and using which policy ? you can check that by runing with debug flag. Most likely the last prediction is action\_listen using Memoization.

If it is memoization, it could be linked to max\_history which by default is 3. You can try to increase it. Also you can use the Mapping Policy with a trigger for your last intent/payload for the action you want

---

<div class="post-metadata">

**Author:** ![melaniab](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/melaniab/32/4343_2.png) [@melaniab](https://forum.rasa.com/u/melaniab)\
**Post date:** [August 1, 2019, 10:17am UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796/3 "2019-08-01T10:17:22Z")

</div>

Thank you, @souvikg10. Increasing `max_history` did help with continuing the conversation, but still the right message was not shown. Adding triggers did solve that.

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [August 1, 2019, 10:48am UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796/4 "2019-08-01T10:48:26Z")

</div>

Not sure you would need rasa core, if you have a deterministic path though. The advantage of core comes with the ‘getting out of conversation card’ when the user unwittingly goes away from the flow. You should use one of the probablistic policies to manage that along with Fallback Policy. if it is simply deterministic then use if-else statements. that is good enough. Rasa NLU is useful either way.

---

<div class="post-metadata">

**Author:** ![melaniab](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/melaniab/32/4343_2.png) [@melaniab](https://forum.rasa.com/u/melaniab)\
**Post date:** [August 13, 2019, 12:37pm UTC](https://forum.rasa.com/t/help-needed-issue-with-dererministic-policies-and-payloads/13796/5 "2019-08-13T12:37:29Z")

</div>

Thanks. This was just a pre-taken decisison that I have to use Rasa. I have problem with a free-text forms. When you enter a free text, let’s say the word “assure”, Rasa take’s it not only as a slot value, that is filled, but also as an intent. So now you I have an intent “assure”, which is not listed in any of my stories, so the stories and ithe memoization break and the bot does not continue after some point. Here it is a part of the log:

```auto
2019-08-13 15:27:00 DEBUG rasa.core.policies.memoization - There is a memorised next action '842'
2019-08-13 15:27:00 DEBUG rasa.core.policies.form_policy - There is an active form 'initial_question_form'
2019-08-13 15:27:00 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_FormPolicy
2019-08-13 15:27:00 DEBUG rasa.core.processor - Predicted next action 'initial_question_form' with confidence 1.00.
2019-08-13 15:27:00 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'initial_question_form'.
2019-08-13 15:27:01 DEBUG rasa.core.processor - Action 'initial_question_form' ended with events '['SlotSet(key: enquiry, value: /assure)', 'AgentUttered(text: bot_lookup, data: null)', 'Form(None)', 'SlotSet(key: requested_slot, value: None)']'

```

…

```auto
2019-08-13 15:27:01 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'assure'.

```

Is there a way to make Rasa not remember “assure” as an intent?
