How to send rasa events tracker data to api not database?

hi, anybody here ever make custom tracker_store.py that send the events to an api? need help i am exploring on this part but got stucked

in case, i want to save the events rasa tracker in my custom api with flask. i dont want to save it directly from rasa tracker store feature. how to send the events data from rasa tracker store to my custom flask endpoint?

thanks

@hanifabd Why do you want to use the tracker_store for your use case, I hope you are aware of why we use the tracker store?

@hanifabd you can directly send the API request from the chatbot or user queries and get the instant response using custom action and for storing the conversation of bot/user then you use tracker store.

@hanifabd

I didn’t get it can you please share some examples or code in this context OR that you have developed your own API (custom) and want to send the API request from the rasa? Give us more detail please.

You can either create a custom tracker store (discussed here) or you could look at an existing (Rabbit or Kafka) or custom event broker.

Hi, basicly i want to make my own tracker saver using flask. not using tracker_store feature by rasa, and actually i have tackled this issue by using this rasa endpoints: (GET) http://localhost:5005/conversations/"+ sender_id +"/tracker" to stream the bot activity history. thanks a lot.

i didnt use tracker_store.py finally and done this issues all in flask directly by using that endpoint

So, you’re polling that endpoint at some interval?

basicly, i create a custom endpoints for rasa rest webhook using flask. I send message through that flask apps. Parallely i get its current time execution (EVENT_START) when the message sent to the webhook and also sent GET request to http://localhost:5005/conversations/"+ sender_id +"/tracker" to get the chatbot events history. its quite tricky to append only the newest events and make sure no duplication when inserting to db. to tackle that problem i use EVENT_START (that i define before) and get LATEST_EVENT_TIME that available in tracker data json. I use that 2 parameters (EVENT_START and LATEST_EVENT_TIME) to get the newest event and then send to db

If you bring up the rabbit container you wouldn’t have to poll and filter events by date. Just subscribe to the event queue.

1 Like

could you share the repo or some documentation about it? thank you