Saving conversations to MongoDB

So I have seen this been asked a few times, but I still can’t solve the issue.

I want to log conversations with my bot in a mongoDB collection. I currently use cmdline and start the bot using a makefile command containing endpoints.yml .

python -m rasa_core.run -d models/dialogue -u models/current/nlu --endpoints endpoints.yml --connector "twilio" --port 5002 --credentials dev_credentials.yml --enable_api --debug

I know this is being recognized because my actions/core servers are working properly. Inside the endpoint.yml file, I have the following for tracker store…

tracker_store:
    store_type: mongod
    url: mongodb://localhost:27017
    db: rasa
    username: admin
    password: xyz123
    collection: conversations

I set up a rasa database and a conversation collection using the mongoDB shell, and added a username and password for only the rasa database. I can verify both the database and the collection exist using the shell/python.

After I run my bot, i query the mongodb database using python/shell and I don’t see any inserts/updates during/after the conversation.

Are conversations saved on a message by message basis, or does it record slot values at the end of the conversation? The docs are not explicit about what type of logging actually occurs…

I am not sure if the tracker_store is having trouble authenticating…or if the MongoDB Tracker Store method is even being called. If anyone has any ideas on how to debug/address the issue let me know! I would really appreciate it!!!

db= MongoTrackerStore( domain,host='mongodb://localhost:27017', db='rasa', username=__, 
			password=____,collection='conversations',event_broker=None)

Then pass db to agent Agent= Agent(domain,interpreter,tracker_store=dB,endpoint)

upgrade to rasa core 0.12 to enable tracker_store by using endpoints.yml file

1 Like

Also

From rasa_core.tracker_store import MongoTrackerStore

Thanks, I was using 0.11.4

Hi @ahson I am trying to save conversation in the mongo db as well. Can you please elaborate how you set up a database?

hi , i have an doubt , here (db= MongoTrackerStore( domain,host=‘mongodb://localhost:27017’, db=‘rasa’, username=__, ** ** password=____,collection=‘conversations’,event_broker=None))what is domain means ???