Rasa.core.tracker_store - Error when trying to connect to 'mongod' tracker store. Using 'InMemoryTrackerStore'' instead. The causing error was: localhost:21476: [Errno 111] Connection refused

iam unable to coonect to database and my endpoints.yml file is as bellow

action_endpoint: url: http://localhost:5055/webhook tracker_store: type: mongod url: mongodb://localhost:21476 db: rasa username: “*****” password: “****” auth_source: admin

Hi @rohith could you post the full logs please?

Silly question: Is the username and password enclosed in quotes? Have you tried without quotes? Here’s my info from endpoints:

tracker_store:
    type: mongod
    url: mongodb://localhost:27017
    db: rasa
    username: admin
    password: notmypassword

The user was created in mongo with this command:

> use admin
> db.createUser({user:"admin", pwd:"notmypassword", roles:[{role:"root", db:"admin"}]})
> exit

hello @akelad sorted the connection error but after conversation nothing is saved in database. can anyone tell what happed???

There should be a conversations collection in the rasa database. Tracker information is in this collection.

Do you see anything when you do this:

> use rasa
> db.conversations.findOne()

hie @samscudder thanks for your reply but is there any way to customise what to save to db for example i dont need entire information like events,intent_ranking,confidence,etc. I just need user name and just their conversation

I think that all information stored in the datastore is necessary for Rasa to work. You can select just what you want, though.

You could use the mongoDB unwind command on the events array, and select only the events you want:

db.conversations.aggregate( [
    { $unwind : "$events"},
    { $match: { $and:
        [
            {"sender_id": "default"},
            { $or: [{ "events.event":"user"}, {"events.event":"bot"}]}
        ]}},
    { $project: { "sender_id": 1, "events.timestamp": 1, "events.event": 1, "events.text": 1}}
]).pretty()

thank you @samscudder how can we build a single rasa catbot that can serve for two (or) more entirely different domain usecases eg: health care bot and movie recommendation bot,etc.

I had a similar problem. I created a docker container for each chatbot.

I have 5 containers for Rasa… 2 for each chatbot, 2 for each action server, and one for mongoDB. I specify different endpoints (databases) for each chatbot, so that conversations aren’t muddled between chatbots.

hie @akelad Other that we mannually check the database ,how do we know that a conversation is dumped into mongodb

You can query the tracker endpoint. Also, the debug logs should tell you when a conversation is persisted to the database