How to enable multithreading in RASA


Can anyone help me with how can we enable multithread with Rasa, currently only one single session seems to work for me. I want to open multiple Chats at the same time and that should not affect the other chats, is this possible in Rasa.

Thanks, Pausali

I want to open multiple Chats at the same time

Can you please clarify on that?

Rasa uses sanic an async server which can process other tasks while the current task is blocked (e.g. due to IO). Threads wouldn’t help you a lot due the Python GIL. You could use multiple Sanic workers, but then you’d need to implement a process safe LockStore

Hi Tobias,

i would like to open multiple chats for different user for testing the bot, i am new to this technology, can you help me with a document or link where i can configure the same.

The Python Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter. All the GIL does is make sure only one thread is executing Python code at a time; control still switches between threads. What the GIL prevents then, is making use of more than one CPU core or separate CPUs to run threads in parallel.

Python threading is great for creating a responsive GUI, or for handling multiple short web requests where I/O is the bottleneck more than the Python code. It is not suitable for parallelizing computationally intensive Python code, stick to the multiprocessing module for such tasks or delegate to a dedicated external library. For actual parallelization in Python, you should use the multiprocessing module to fork multiple processes that execute in parallel (due to the global interpreter lock, Python threads provide interleaving, but they are in fact executed serially, not in parallel, and are only useful when interleaving I/O operations). However, threading is still an appropriate model if you want to run multiple I/O-bound tasks simultaneously.


Do you have any demo chatbot or any video where i can refer to this, if yes please do share with me.

Hi Everyone,

I’m developing a RASA chatbot having a form with several slots. Once the slot values are filled, they are verified and an e-mail is to be send to the given (user defined) e-mail address.

It seems adding an action to send an email in a separate rule set might take some time to get the response within the conversation and it can distract the user when using the bot. So thought of sending the email as a seperate thread.

Please kindly share with me, if any multi-threading task handling method in available in RASA…

Thank you.