Rasa database connectivity

Hello everyone, i am a noob and newbie to rasa, i ll get to the main point: so is it possible to connect rasa to a database and then store the conversations, domain, stories and nlu ?

So everytime i use the command rasa train , it will update the stories, nlu and domain in the database also…

If anyone knows how to do that, can you guide me a bit?

In detail the Reason and what am i implementing rasa for: I am working on rasa as for my final year project, which contains 3 main entities thats user , admin, and the university staff…

User chats with the bot through rasa webchat, (everytime user chats with bot, the conversations are storied in database…

Admin controls everything by rasa x and alos has access to database, everytime trains bot, nlu, stories,domain is stored in databse…

University Staff logins and a page can be seen, in which they can only see(ready only) conversations, domain, stories and nlu but not be able to edit the data, and make requests to admin for editing the data…

mentioned reason to give you a clear idea of what am i going to do !

Apologies for my broken english!

hello hamza

yes you can connect the rasa to database such as MySQL as I use in my graduation project as your situation. for my case I use the DB for storing a lot of intent like colleges and majors and the details for each one.

finally I guess and think that the rasa x has a conversation saved by default search about how to reuse it not make a new one.

and for DB i use Xampp for MYSQL and here can find how to connect python (action.py) file to MYSQL

hope this help you.

can you tell me in detail and provide an example code that how you stored the intents online in a db ?

Thanks alot but thats not what i am looking for…

Just as rasa x shows you the conversations, intents and domains in the web page… i want to develop a simialr web page which will show the same contents but it will be in read only format and it will be limited to conversations, nlu , domain and stories !

for admin side i ll be using rasa x, for user side i have developed the web page and added the script so that will be used for user interaction with chatbot…

The staff side is remaining only…

Hi, for storing the domain and conversations it sounds like what you’re looking for is a tracker store, depending on the database you’d like to use perhaps the SQL tracker store?

For storing the stories and nlu data you’ll have to come up with your own way of pushing these to a database. This means you’ll have to come up with tables to store these. You can write a SQL connector in python, this will connect to your database and update the tables accordingly. Does that make sense?

1 Like