How to reset chatbot slots everytime launched from browser? Multiple users chatting to chatbot?

Hi all,

So I’ve managed to connect a custom front-end for my chatbot.

The UI has javascript code which calls Rasa X API to authenticate the user and send and receive messages from the bot. So far, so good.

The Rasa X server where the Rasa X API is hosted is running locally on my computer on port 5002, and my script server is running locally on my computer on port 5055. Again, so far, so good…

However, when I re-start my browser to chat with my chatbot again, the slots are not reset from the previous chat, which obviously makes some parts of my stories get skipped when I chat again.

How do I reset my conversation everytime I refresh the page? Can this be done programmatically using Rasa X API? I haven’t been able to do so yet…

Also, how would this extend to having multiple users chatting to the chatbot at once? Since the tracker.db file is saved server-side, how can I have one server (local on port 5002 for now) for multiple users chatting to my chatbot at the same time? Because as it stands, if multiple users connect to the same server, I could fill the single set of tracker slots saved on that one server by messaging the chatbot from multiple clients.

Any help would be greatly appreciated.

Hi @alihejaziu multiple users chatting to the bot is possible out of the box. If you’re using the REST channel you just need to make sure you’re assigning each user a unique user_id. If you do that for each new session (so including you refreshing), then having a new session every time you refresh is possible as well. The channel has configurable session persistence out of the box as well, so that may be another option

Hi @akelad. Thank you so much for your response. If possible, could you please tell me how to “assign each user a unique user_id”. I’m struggling to find out how using the documentation.

Your help is greatly appreciated.

Thank you!

that’s something you have to handle in your frontend. You then hit the rest api by sending the sender id you generated, along with the messages they send

Thank you for the help.

hey, I am facing the same issue. Were you able to figure this out?

I am trying to set new session key every time user comes back in Slack channel. How to identify a new session of user ?

can you show us the url on how you are passing the data to rasa from your front end(mostly it will be in js), for my custom widget for time being , i am generating random numbers and assigned it as user id to rasa.