Connect Rasa to a database

Hi, I am currently working on a capstone project. We want to integrate RASA to our sponsor’s website. Due to confidential reason, patient info is record in local database.

I’ve been searching for related topics but there are not many source available. Below are two functions we prefer to have.

First, we want to store certain user info into our database. There is a tutorial on Youtube, but the syntax seems different. And I had difficult to figure it out.

Second, we want to be able to query the database. The tutorial from RASA live coding session missed many details. If anyone could provide a instruction on this part, that will be much appreciated. Moreover, our sponsor asks us to connect the RASA to a Django server, then route the query to database. I am not sure whether this is doable or not. I read some posts it seems some people successfully implemented Flask + database model. So I think Django should work as well.

you can build a django app called rasa and import Rasa as a python library to make predictions and then use the ORMs of Django to connect to the Databases. I have worked on this unfortunately only for Rasa NLU, but you can import the rasa package and build a python package to get the next action prediction as well.

The other option is the action server but then you will have multiple HTTP calls

1 Like