Size of trackers in custom tracker store

Hello!

I’ve created a custom tracker store object to connect my bot to a centralized key/value store. That store has limits on the size of values and is also remote to my bot.

When do trackers get reset or pop old information off of the conversation? Is that configurable? I’d like to ensure trackers don’t exceed my store’s limits.

Also, are trackers retrieved/saved for every new user message/bot response? Since it’s remote, larger trackers could eventually impact my bot’s performance.

Thanks!

1 Like

trackers have max_event_history property: rasa_core/trackers.py at 7451990c9d3948709e4dc59f05f18d8be77e1a45 · RasaHQ/rasa_core · GitHub

1 Like

Thanks, that worked. I hadn’t caught it before. I had to override the init_tracker() function on my custom tracker store object like below. The default store does not limit the size of trackers.

class CustomTrackerStore(rasa_core.tracker_store.TrackerStore):
    ...
    def init_tracker(self, sender_id):
      if self.domain:
        return DialogueStateTracker(sender_id,
                                    self.domain.slots,
                                    max_event_history = 100)
      else:
        return None
1 Like

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

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

db = MongoTrackerStore(domain=“d.yml”,host=‘mongodb://localhost:27017’, 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.

Hey @ajaxwini. This information should already be stored in your mongodb, so there should be no extra need for you to do so. Please see the documentation about Tracker Stores and make sure your endpoints.yml includes the correct information. For information on how to fetch specific details from your mongodb maybe have a look at the mongodb docs db.collection.find() — MongoDB Manual.