# Does Memoization ignore slots set \> max\_history turns ago?

**URL:** <https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260>\
**Category:** Rasa Open Source\
**Created:** [October 24, 2019, 2:49am UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260 "2019-10-24T02:49:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [October 24, 2019, 2:49am UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/1 "2019-10-24T02:49:26Z")

</div>

I want to confirm that if I have

```
policies:
  - name: MemoizationPolicy
    max_history: 3

```

and I have a slot set 4 turns ago, that the Memoization policy will ignore it?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [October 28, 2019, 7:33am UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/2 "2019-10-28T07:33:12Z")

</div>

no, slots are kept until there is a restart event.

---

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [October 28, 2019, 5:25pm UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/3 "2019-10-28T17:25:44Z")

</div>

Thx @amn41. So Memoization considers all activity in the past max\_history turns PLUS all other slot values no matter when they were set? (Featurized and unfeaturized?)

And what does “exact conversation” (per docs) mean?

1. The exact text entered by users, or
2. The exact intent and entities, or
3. The exact intent and slot type-relevant entities (e.g., different values for text slots would be considered exact, whereas different values for a categorical slot would not be).

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [October 29, 2019, 11:09am UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/4 "2019-10-29T11:09:43Z")

</div>

you’re quite right that language isn’t very clear. By exact it means that the conversation would be featurized exactly the same way. So same intents, entities, slots (depending on how they are featurized)

---

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [October 29, 2019, 4:29pm UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/5 "2019-10-29T16:29:20Z")

</div>

OK, great. That makes sense. But what about featurized slots that are set before max\_history turns ago? The comments in the code seem to imply that those are considered as well. Does that mean _all_ featurized slots are considered, regardless when they’re set?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [October 29, 2019, 5:49pm UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/6 "2019-10-29T17:49:53Z")

</div>

> Does that mean _all_ featurized slots are considered, regardless when they’re set?

yes

---

<div class="post-metadata">

**Author:** ![mmm3bbb](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mmm3bbb](https://forum.rasa.com/u/mmm3bbb)\
**Post date:** [October 29, 2019, 5:56pm UTC](https://forum.rasa.com/t/does-memoization-ignore-slots-set-max-history-turns-ago/20260/7 "2019-10-29T17:56:01Z")

</div>

Hmmm, so I guess this argues for being tidy with slot values then - emptying them when they’re no longer needed. Otherwise, some old, irrelevant slot could mess up memoization.
