How does carry_over_slots_to_new_session work if sender_id changes?

I want to load user data into slots at the beginning of a new conversation. Using just the open source CLI, how does Rasa know if I’m am the same user? I see sender_id getting populated with a hash that changes.

The setting carry_over_slots_to_new_session seems to imply that when a user connects, that they will be remembered, but if users aren’t tracked with a client token somewhere, does this load all slot info for a user?

Sorry, I’m new and not sure if I’m thinking about this correctly.

In your frontend interface, you can keep the sender ID constant instead of a random ID.

It could, for example, be a username.

For example, in the Chatbot Widget by Jitesh Gaikwad, the sender ID is generated like so:

const sender_id = uuidv4();

This will generate a random UUID every time the page refreshes.

Instead, you could do something like:

const sender_id = isLoggedIn() ? getUsername() : uuidv4();

So if the user is logged in, the sender ID will be set to the username, otherwise it will generate a random ID.

Of course, you should build your own isLoggedIn() and getUsername() functions accordingly to your interface.

Thank you @ChrisRahme . So you start Rasa with --enable-api, then when sending a request forward a sender_id each time?

Using the command line client though, it will always create a new sender_id per every session? (and appears that way for Rasa X as well?)

It also appears that Custom Connectors must do this?

You specify the sender ID in the JSON message you’re sending via your own UI, not in the command

Don’t hesitate to ask if you’re having trouble doing that :slight_smile: (preferably in a new thread)

Yes, Rasa Shell and Rasa X generate their own IDs, you can’t change that without changing their code (which you can’t for Rasa X since it is not open source)

Custom Connectors just receive the sender ID

1 Like