Tracking conversations under events


(HQ) #1

Hello,

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 event.name = ‘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.


(HQ) #2

@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:


(Souvik Ghosh) #3

Can you share an example of your tracker?


(HQ) #4

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:

image


(HQ) #5

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


(Souvik Ghosh) #6

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