Multipe users using an Agent in the Playground

Hey!

First of all, thanks for this amazing framework :slight_smile:

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:

  1. As far as I understand, I would need to launch a single agent for a single user?
  2. 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.
  3. 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.
  4. 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!

1 Like

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 :smiley:

Hi @Eimis . Thanks for reaching out . We have multi-user, multi-session agents in Agno. You can refer to this doc.Sessions - Agno

@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 @Eimis . I got your issue, For playground runs you can pass user id in the run api call and that should give multi user feature .
You can also check all the apis in swagger. http://localhost:7777/docs#/Playground/create_agent_run_v1_playground_agents__agent_id__runs_post

Let me know if this is what you are looking for.