Tracking conversations under events


I am building a dashboard using the conversations that i have stored with mongodb. There is a slight problem though, under events for each sender, conversations are not grouped by a conversation id. Instead all events are stored in sequence. The only way to tell apart conversations is by grouping events that come before = ‘action_restart’. Ideally Id want with each event a field that stores the number of its corresponding conversation. In python, i can simply write a script that does that but after the data is stored there isn’t much i can do. Is there a way to write a script for this before the data is stored? or is this possible with mongodb after it is stored? any help would be appreciated.

@souvikg10, i’ve seen you had worked a lot with trackers. Do you know how i can solve this? Basically i just want to group all the events by a conversation number under sender_id. Ideally this should be done before the data is loaded to the dashboard tool. My intuition is maybe i could key, conversation number, for each event. This key is mapped to a counter that increments as events are added and resets when the event is of type ‘action_restart’ Thanks :slight_smile:

Can you share an example of your tracker?

I’m using MongoTrackerStore

external_tracker = MongoTrackerStore(domain=None) agent = Agent.load(agent_path, interpreter=interpreter, action_endpoint=endpoint, tracker_store=external_tracker)

The data stored looks like:


I think I may have fixed this by monkey-patching the save method in MongoTrackerStore

In the last PR, you can easily add your own tracker store instead of using default by extending the trackerStore class.