Given a fixed, immutable storage (for the sake of the question), and given user_id and session_id, if multiple different requests come to the same agent, will the different requests influence each other?
Hi @chroteus, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!
Mostly the agent will behave correctly, but race conditions and messy state is possible. These issues can come up when these agents are running concurrently in APIs for example.
We are working on a new major version (2.0.0) that removes all state from agents/teams/workflows and other classes like storage/memory/model. I’m personally working on this… We aim to have a release candidate for the major update available in about 2 weeks. I would love if you could give your insight when the time comes.
To address any issues in the short term, one way to avoid the issue is to generate an agent instance from a function. So like a agent factory. That way the agent won’t ever be the same instance and it would avoid any state issues. That could have an impact on memory, but if the level of concurrency isn’t too great, the python garbage collector should mitigate that.