I’m using an in memory tracker store. After many turns of conversation, rasa become slower and slower.
Checked the log and then I find that every time rasa core extract all events and send to action server. Related logs following:
2020-08-04 10:30:21 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 23242 events.
…
2020-08-04 10:30:21 DEBUG rasa.core.processor - Predicted next action 'form_xx' with confidence 1.00.
2020-08-04 10:30:21 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'form_xx'.
/usr/local/miniconda3/lib/python3.6/site-packages/aiohttp/payload.py:228: ResourceWarning: Sending a large body directly with raw bytes might lock the event loop. You should probably pass an io.BytesIO object instead
I checked action call data, and found that it’s very big.
Waiting for your reply. Thank you very much.
Hi, the InMemoryTrackerStore always stores the whole conversation history and there is no nice way to clear it. Also, there shouldn’t be, because that would mean that in the middle of the conversation the bot suddenly “forgets” everything that was said.
What you can do is to use a custom tracker store instead for which you specify a maximum number of events to store. How to add a custom tracker store is described in our docs. Set up your custom tracker store to use a tracker with the parameter max_event_history set to some number instead of None .
E.g. your tracker store class could look similar to this:
I’m a little unsure how max_event_history works with regards to the tracker.
Does it stop storing new events in the tracker when that limit hits?
Or does it do a rolling number of events that are retrieved each time?