Use this file to discover all available pages before exploring further.
A TeamFactory produces a fresh Team for each request. Register it in AgentOS(teams=[...]) alongside any prototype teams.
basic_team_factory.py
from agno.agent import Agentfrom agno.db.postgres import PostgresDbfrom agno.factory import RequestContextfrom agno.models.openai import OpenAIResponsesfrom agno.os import AgentOSfrom agno.team import Team, TeamFactorydb = PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai")def build_support_team(ctx: RequestContext) -> Team: user_id = ctx.user_id or "anonymous" billing_agent = Agent( name="Billing Agent", role="Handle billing inquiries", model=OpenAIResponses(id="gpt-5.4"), instructions=f"You handle billing questions for tenant {user_id}. Be concise.", ) tech_agent = Agent( name="Tech Support Agent", role="Handle technical issues", model=OpenAIResponses(id="gpt-5.4"), instructions=f"You handle technical support for tenant {user_id}. Be concise.", ) return Team( name="Support Team", model=OpenAIResponses(id="gpt-5.4"), members=[billing_agent, tech_agent], db=db, instructions=[ f"You are the support team leader for tenant {user_id}.", "Route billing questions to the Billing Agent and technical issues to the Tech Support Agent.", ], markdown=True, )support_team_factory = TeamFactory( id="support-team", db=db, factory=build_support_team, name="Per-tenant Support Team", description="Builds a support team with billing and tech agents per tenant.",)agent_os = AgentOS(teams=[support_team_factory])app = agent_os.get_app()if __name__ == "__main__": agent_os.serve(app="basic_team_factory:app", port=7777, reload=True)
Run the team like any other team:
curl -X POST http://localhost:7777/teams/support-team/runs \ -F 'message=I need help with billing and a technical issue' \ -F 'user_id=tenant_42' \ -F 'stream=false'
See the Factories reference for the full constructor signature and parameter list.
The tier claim comes from verified middleware, so the tier cannot be changed by the request body. See Authorization From Verified Context for the trust model and JWT Role Factory for an end-to-end JWT example.
Raise FactoryPermissionError from inside the factory to reject unauthorized callers with HTTP 403. AgentOS raises FactoryValidationError (400) automatically when factory_input fails input_schema validation.
from agno.factory import FactoryPermissionErrordef build_team(ctx: RequestContext) -> Team: if "teams:run" not in ctx.trusted.scopes: raise FactoryPermissionError("Missing 'teams:run' scope") ...
See the Factories reference for the full exception hierarchy and the post-resolve behavior.