Redis Lock Store do not save conversations

Hello!

This is my first rasa project and we’re going to deploy it to production environment soon. The bot is going to be deployed in kubernetes and we want to make replica set with more than one instance. In order to do that I started to try to make redis lock store for the bot. Right now I’m doing it locally on my machine and it seems to me that nothing is stored in redis.

I’m on MacOS. Rasa version=3.5.6. Python=3.8.13. Redis version=7.2.0

In my endpoints.yml I have the following code:

lock_store:
  type: "redis"
  url: localhost
  port: 6379
  db: 1
  key_prefix: rasa

When I run the bot locally it seems to be connected to the redis lock store.

This is what I get when I run MONITOR with redis-cli:

127.0.0.1:6379[1]> monitor
OK
1692611890.230273 [1 127.0.0.1:53707] "SELECT" "1"
1692611890.250144 [1 127.0.0.1:53707] "GET" "rasa:lock:default"
1692611890.262775 [1 127.0.0.1:53707] "SET" "rasa:lock:default" "{\"conversation_id\": \"default\", \"tickets\": [\"{\\\"number\\\": 0, \\\"expires\\\": 1692611950.250377}\"]}"
1692611890.271530 [1 127.0.0.1:53707] "GET" "rasa:lock:default"
1692611891.129285 [1 127.0.0.1:53707] "GET" "rasa:lock:default"
1692611891.129533 [1 127.0.0.1:53707] "SET" "rasa:lock:default" "{\"conversation_id\": \"default\", \"tickets\": []}"
1692611891.129694 [1 127.0.0.1:53707] "GET" "rasa:lock:default"
1692611891.129851 [1 127.0.0.1:53707] "DEL" "rasa:lock:default"

If I run KEYS * I get:

127.0.0.1:6379[1]> keys *
(empty array)

It looks like redis saves and deletes the data.

Could somebody explain to me if it’s supposed to work like that? Or am I doing something wrong?

I’ve never used redis before as well as rasa, so any clarification would be very much appreciated!

The lock store doesn’t need to save conversations. It’s a method for multiple Rasa instances to handle concurrent access. What you are looking for is the tracker store.

Yes, I want to deploy the bot in kubernetes cluster and make multiple instances there. I’m just testing it locally with one instance at the moment.

What bothers me – if there’s no keys in the lock store, how are multiple instances are going to retrieve data? It seems like something should be saved there in order to implement the functionality.

Maybe I’m getting something wrong here and everything behaves as expected?

Think of it like a Mutex: it’s only needed as soon as the action is hot and multiple instances are working concurrently on a conversation, afterwards it’s empty.

Thank you for the explanation!