Forget the slot memory

when a dialogue finished, we could use [Restarted] to clean the slot memory. However, in some situation, the user end the dialogue in the midway.We didn’t know that the dialogue had finished,so the slot memory would be still remembered. several days later, the user have a conversation with the robot, He will find that the robot still have that memory,the response will be so confused. So, how to solve the problem?clean at regular time?

1 Like

Once you are done using the slot value, in yours actions set the slot value to None. If a particular part indicates the end of dialogue, trigger a custom action and in that function use

return [SlotSet(slotName, None)]

Continuing the discussion from Forget the slot memory:

I know this.my problem is, the user finish the dialogue in the midway.the user didn’t speak anymore.but our robot is still active, remember the slot value. so,how to fix this?

@ srikar_1996

How I do this is in my custom actions, once I’m done using the slot value, I reset it. It might be the same function that I use the slot or any subsequent ones.

I can’t think of any other way in which we can clear midway.

maybe I don’t describe clearly. for example,

Robot: Where are you going? ----It’s a city slot.

I: New York. ---- city slot has been set.

Robot:why? ----It’s a reason slot.

But I did’t answer this question.I just quit.The Robot waited my response. The city slot will be remembered until …? I can’t clear this slot in actions.py,nobody tell actions to reset the city slot,because It is not the end of conversation.

The way I would do this is, when New York or any city is entered, I’d trigger a custom action, work with the slot and return the slot as empty. Would that help solving the issue?

no,I will use the slots in the whole conversation.It is a multi-turn conversation. anyway,thx~

In this case, I think you - as a developer - need to decide on “how long is too long”. Let’s say there is a threshold time t=24 hours after which it is safe to assume that slot needs to be cleared. This is how I’d work with this:

As soon as the Agent receives a new message, check the timestamp of the previous message. (This timestamp can be obtained from the Tracker of your bot.) If the previous message is older than t (which is 24 hours in our example) you can simply reset the tracker. Resetting the tracker will clear its entire history.

1 Like

ok,this is a smart way.good job~! thx. @akshay2000

What’s the general strategy to find or determine the end of conversation, so that slot values should be delted?

hi, where can i do this to judge the timestamp? in my customized action or any else? thanks

One way is when the user explicitly exits the conversation from UI, etc. Another way is timeouts.

You can do that wherever you call the handle_message.