Rasa uses a ticket lock mechanism to ensure that incoming messages for a given conversation ID are processed in the right order, and locks conversations while messages are actively processed. This means multiple Rasa servers can be run in parallel as replicated services, and clients do not necessarily need to address the same node when sending messages for a given conversation ID.
InMemoryLockStoreis the default lock store. It maintains conversation locks within a single process.
This lock store should not be used when multiple Rasa servers are run parallel.
To use the
InMemoryTrackerStoreno configuration is needed.
RedisLockStoremaintains conversation locks using Redis as a persistence layer. This is the recommended lock store for running a replicated set of Rasa servers.
To set up Rasa with Redis the following steps are required:
rasa run -m models --endpoints endpoints.yml
Start your Redis instance
Add required configuration to your
endpoints.ymllock_store:type: "redis"url: <url of the redis instance, e.g. localhost>port: <port of your redis instance, usually 6379>password: <password used for authentication>db: <number of your database within redis, e.g. 0>key_prefix: <alphanumeric value to prepend to lock store keys>
To start the Rasa Core server using your Redis backend, add the
localhost): The url of your redis instance
6379): The port which redis is running on
1): The number of your redis database
None): The prefix to prepend to lock store keys. Must be alphanumeric
None): Password used for authentication (
Noneequals no authentication)
False): Whether or not the communication is encrypted
None): Path to an ssl private key
None): Path to an ssl certificate
None): The path to a file of concatenated CA certificates in PEM format
10): Time in seconds after which an error is raised if Redis doesn't answer