I have a SaaS that uses AI which “runs” on AWS Lambda, and have a set of AWS API Gateway APIs. I learned about Agno and it seems so simple, it would really simplify my code. But before start refactoring things out, I started to read the documentation and one question came up.
As far as I understand, the Agent is supposed to work like a singleton, am I right to think like that? If so, its not possible to use Agno in a serveless environment like AWS Lambda. Cause every time my lambda is triggered, the Agent would be re instantiated and I would lose everything Agno has to offer. Same for RAG (Knowledge object).
Am I getting this wrong? Did anyone use Agno with AWS Lambda to point me to the right direction?
Hey @sss, 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!
Depending on what you need to do with your Agent, it should be possible to use it in AWS Lambda.
Memories, sessions and knowledge can all be added to persistent storage. So every time your Agent starts, it will have access to the data from previous runs. Importantly would be to set your agent_id and agent_name field when setting up your Agent. Otherwise the framework will create random values for these on every startup, causing data to not be correlated.
Agno Agents initialize very quickly, so this is a good application for Lambda. Please let me know more about your use case and how we can assist in setting up your Agents!