How to save bot conversation on mongodb?

Hi , I am new to rasa and currenlty completed a facebook bot using rasa core:.10.4. I want to save the conversation on mongodb. Could you please provide the detail how to save it.

I just stored the tracker in mongodb but it stored only sender id and tracker id. I want to store chat conversasion on mongo. Please help me to get i.

take a look tracker_store. there is a MongoDB Tracker store that you can pass to your agent on creation. It will save the conversation history

Hi souvik , Thanks for response. I am able to store tracker on mongo and from tracker i am able to get the data but i want to store data in chat format and currently i am getting like

Dialogue with name ‘1813498192019988’ and turns:

ActionExecuted(action: action_listen)

    UserUttered(text: Hi, intent: {'name': 'greet', 'confidence': 0.9587802290916443}, entities: [])

    ActionExecuted(action: utter_greet)

    BotUttered(text: Hello, how can I help you?, data: null)

Also how i can track new conversation and update on mongo db

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Hello friend,Could you please tell me how are you fetching specific details from the tracker store. Elaborating my doubt below:

in my (socketIO class) i have used mongotracker like this-

db = MongoTrackerStore(domain=“d.yml”,host=‘host ip’, db=‘xyz’, username=“x”,password=“x”,collection=“x”,event_broker=None)

agent = Agent.load(‘models/dialogue’, interpreter=‘models/current/nlu’,action_endpoint = action_endpoint,tracker_store=db)

now i want to fetch some data like db.sender_id or db.event. the reason of doing it is to store it column wise on my mongodb.Please help me solving this problem.

Hi @ajaxwini Can you explain the term column-wise like how you wanna store data on mongodb?

Hi Abhi,

I want to store sender id in one col and then respective start time of the chat and end time and then all conversation in other table for respective sender where sender id will act as a foreign key.


Did you get the answer for how to fetch the data from tracker store ?


hi , can someone please tell me how to save all conversation on mongodb ? i’m new to rasa and i’m confused , you said to use mongotrackerstore, but i don’t know how to do that , o where to put that code ! there aren’t really a lot of resources out there !! thank u in advance

how did you store tracker on mongo plz ,?

Welcome to the forum @rahma!

Please take a look at the documentation for doing this: MongoTrackerStore

If you have further questions please let us know!