Search code examples
python-3.xrasa-nlurasa-corerasa

How to track time taken on each step in RASA chatbot


I am pretty new to RASA. Our bot uses a lot of custom actions on each step of the conversation. There is a new requirement in my project to track the time a user spends on each step and log it into a separate data-store.

I have tried to use a simple class lo keep a track of the steps (current and previous steps) and calculate the time between steps on each interaction.

Not sure how to scale this solution to track the time taken for multiple sessions (or whether this is a right approach in first place). Not really sure of the life-cycle of the classes Would really appreciate any insights/pointers on how to achieve this specially for each individual user/dialog.


Solution

  • The easiest solution is probably to store all of this information in the tracker. E.g. you can create an unfeaturized slot called step_times and store a dict in there with the timing for each step.

    You can then configure the sessions not to erase these slots https://rasa.com/docs/rasa/core/domains/#session-configuration (or create a custom action_session_start )