How to connect Rasa/X to db

Hello all and @akelad,

I have two questions reading connecting Rasa to DBs::

  • I would like to store conversation logs in a db. I have Rasa and Rasa X implemented/deployed LOCALLY. I know Rasa X has postgresql db build in, can I use this locally? If so, how (could you please provide an example).

  • I have a sql db holding client information (name, phone, etc), I would like to know how I can query this db through Rasa (or Rasa X), instance for authentication purpose? Could you please explain how?

Thanks, AV

Hi @amvas, this is not supported locally, no. You should deploy Rasa X on a server with one of our deployment options: e.g. the one-line deployment script.

As for accessing the database, you can do that through custom actions.

1 Like

Thanks @akelad for your fast reply. We have set up Rasa X using “Docker-Compose”, do we still need to follow " one-line deployment" procedure?

If the deployment was correct, I just need to set up db connection in endpoints.yml file (“tracker_store” part), right? In this case, what would be credentials and url to use build in PostgreSQL in Rasa X?

Thanks, AV

Please follow this Tracker Stores

Thanks @wabi, I already saw that tracker and I am sure that the solution. My question was about how we can config and set up the tracker when Rasa x setup using docker compose. Any thoughts or examples?


Hi @amvas I hope you only can help me regarding deploying the chatbot into a website. I have few questions where I’m not getting correct answers.

  1. How to deploy or integrate Rasa into a website for 24/7 live

  2. You said with docker you deployed. Should I also put my Rasa folder and environment folder also into the docker?

  3. How to run Rasa after putting on online server.

  4. After deployment how to train if needed?

  5. As you asked how to connect to database and I’m very much eager to know that. I want all conversations to stored.

I’m joined as intern for a company and the first project assigned was a chatbot. After all things considered I choosed Rasa. But I can’t find the best answers and I don’t know what to do. It was already 3 weeks completed and pressure on me. If possible please help me. My mail

@skjainmiah for question 1 if you want to integrate rasa on a website you a lot of choice such as rasa webchat, @JiteshGaikwad Widget provided in his github , chatroom, rasa bot

For question 5 please try this link Tracker Stores

1 Like

It will be the same thing to do like what you have in the link if you could test that

1 Like

Bro I tested with local host but I’m not getting. Can you give me entire code for storing the data in database.

I will share my config You will remark that i 'm using mongodb for managing my database

Please add this code in your endpoints.yml

   type: mongod
   url:  mongodb://localhost:27017
   db: chatbot

endpoints.yml (1.4 KB)

For mongodb i don’t define a username and password If you have one you have to set their values


Thanks bhai. I more thing mongodb should I install in my system(linux) or any free online resources?

Hi @skjainmiah,

To be honest, we have not reached the web deployment level yet, we just have it locally. So I wont be the right person answering the questions. Thanks to @wabi who replied your questions.