I’m trying to figure out a way how to allow multiple different users to authenticate and then use my Agent in the open-source agent-ui playground.
I’m a Python developer, so I can implement my own proxy Auth layer. I’m already passing user_idto my Agent and have different memories / storage tables / sessions with different user_id for my Agent (currently hardcoded).
Although it would be great to get an advice on how to approach the agent-ui Playground, because as far as I understand, it only listens to single uvicorn instance on a single port.
My ideas would be:
As far as I understand, I would need to launch a single agent for a single user?
How to figure out the port problem? Maybe it’s possible to somehow dynamically inject or remove new Agents from the same Playground instance? I’d hide the agent selections from the FE and would implement user validation.
Another idea would be to dynamically spin up an agent-ui instance for every user and dynamically asign a random port to this instance, but this is not really scalable? I’d somehow need to manage NGINX configs etc.
Any other ideas to get me on a right path?
I’d be also happy to contribute to this library with my solution if needed.
Hi @Eimis
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!
Hey Monali! No, it’s not urgent, but would be great to get some ideas from the team. I’m working on my own FastAPI middleware for this, so would be great to be sure I’m on a right path
@monalisha yep I saw this, but I’d like to use the Playground for this (see my original text in this post), I am not manually handling agents with agent.print_response("How are you?").
Could you point me to the right way how I should achieve this?
Hi @capgrey Yes you can surely get it from the session_state and use it to get user_id at tool level. You can refer to the below docs and cookbook. thanks