AgentOS

Parameter and method reference for the AgentOS class that serves agents, teams, and workflows as a FastAPI app.

Parameters

ParameterTypeDefaultDescription
idOptional[str]GeneratedDerived from name when supplied, otherwise a UUID
nameOptional[str]NoneAgentOS name
descriptionOptional[str]NoneAgentOS description
versionOptional[str]NoneAgentOS version
agentsOptional[List[Union[Agent, RemoteAgent, AgentProtocol, AgentFactory]]]NoneList of agents available in the AgentOS. Also accepts factories, remote agents, and multi-framework adapters
teamsOptional[List[Union[Team, RemoteTeam, TeamFactory]]]NoneList of teams available in the AgentOS. Also accepts factories and remote teams
workflowsOptional[List[Union[Workflow, RemoteWorkflow, WorkflowFactory]]]NoneList of workflows available in the AgentOS. Also accepts factories and remote workflows
dbOptional[Union[BaseDb, AsyncBaseDb]]NoneDefault database for the AgentOS. Agents, teams and workflows with no db use this one
media_storageOptional[Union[MediaStorage, AsyncMediaStorage]]NoneBackend the media routes read stored media from. Defaults to the first one configured on an agent, team, or workflow
checkpointOptional[Literal["runs", "tool-batch", "tools"]]NoneDefault checkpoint level for agents in this AgentOS. Agents without their own checkpoint setting inherit this one. None means no OS-level default and each agent falls back to "runs"
knowledgeOptional[List[Knowledge]]NoneList of standalone knowledge instances available in the AgentOS
interfacesOptional[List[BaseInterface]]NoneList of interfaces available in the AgentOS
a2a_interfaceboolFalseWhether to expose the OS agents and teams in an A2A server
authorizationboolFalseWhether to enable RBAC authorization
authorization_configOptional[AuthorizationConfig]NoneConfiguration for JWT verification when authorization is enabled
cors_allowed_originsOptional[List[str]]NoneList of allowed CORS origins (merged with default Agno domains)
configOptional[Union[str, AgentOSConfig]]NoneUser-provided configuration for the AgentOS. Either a path to a YAML file or an AgentOSConfig instance.
settingsOptional[AgnoAPISettings]NoneSettings for the AgentOS API
base_appOptional[FastAPI]NoneCustom FastAPI APP to use for the AgentOS
lifespanOptional[Any]NoneLifespan context manager for the FastAPI app
mcpOptional[Union[bool, MCPConfig]]NoneServe the OS over MCP (Model Context Protocol) at /mcp. Pass True for the eight default tools, or an MCPConfig to publish components and custom tools via tools and scope the default tools via default_tools, include_tags, and exclude_tags
mcp_serverOptional[Union[bool, MCPConfig]]NoneDeprecated alias for mcp
mcp_authOptional[AuthProvider]NoneAuthProvider that owns authentication for the MCP endpoint (OAuth for connector clients like claude.ai and ChatGPT). Use AgentOSBuiltinAuth.from_env() from agno.os for the built-in authorization server, or an external provider such as WorkOS AuthKitProvider. Requires the MCP server to be enabled via mcp
on_route_conflictLiteral["preserve_agentos", "preserve_base_app", "error"]"preserve_agentos"What to do when a route conflict is detected in case a custom base_app is provided.
tracingboolFalseEnable OpenTelemetry tracing for all agents and teams
auto_provision_dbsboolTrueWhether to automatically provision databases
run_hooks_in_backgroundboolFalseRun agent/team pre/post hooks as FastAPI background tasks
queueOptional[QueueConfig]NoneBackground run execution: per-replica concurrency cap, Redis coordination for multi-replica deployments, and the durable job queue. None keeps the process defaults (cap of 32 or AGNO_BACKGROUND_MAX_CONCURRENCY). See Background Execution and the QueueConfig fields
event_streamOptional[BaseEventStream]NoneExplicit event stream override. Takes precedence over the stream queue.redis would configure. Defaults to the in-memory stream
telemetryboolTrueLog minimal telemetry for analytics
registryOptional[Registry]NoneRegistry to use for the AgentOS
schedulerboolFalseWhether to enable the cron scheduler
scheduler_poll_intervalint15Seconds between scheduler poll cycles
scheduler_base_urlOptional[str]NoneBase URL the scheduler uses for HTTP calls to the OS. Defaults to http://127.0.0.1:7777
publicOptional[PublicSurface]NoneSelect registered components for bounded public serving. See Public Surface.
internal_service_tokenOptional[str]NoneToken for scheduler-to-OS authentication. Auto-generated when the scheduler is enabled and no token is provided

Authorization

Enable RBAC by setting authorization=True and setting the JWT_VERIFICATION_KEY environment variable to your JWT public key:

from agno.os import AgentOS

agent_os = AgentOS(
    id="my-agent-os",
    agents=[my_agent],
    authorization=True,
)

Or for more control, you can use the AuthorizationConfig class:

from agno.os import AgentOS
from agno.os.config import AuthorizationConfig

agent_os = AgentOS(
    id="my-agent-os",
    agents=[my_agent],
    authorization=True,
    authorization_config=AuthorizationConfig(
        verification_keys=["your-jwt-verification-key"],
        algorithm="RS256",
    ),
)

See AuthorizationConfig for configuration options.

Functions

get_app

Get the FastAPI APP configured for the AgentOS.

get_routes

Get the routes configured for the AgentOS.

serve

Run the app, effectively starting the AgentOS.

Parameters:

  • app (Union[str, FastAPI]): FastAPI APP instance
  • host (str): Host to bind. Defaults to localhost
  • port (int): Port to bind. Defaults to 7777
  • workers (Optional[int]): Number of workers to use. Defaults to None
  • reload (bool): Enable auto-reload for development. Defaults to False
  • reload_includes (Optional[List[str]]): Extra file patterns to watch when reload=True. Defaults to None
  • reload_excludes (Optional[List[str]]): File patterns to ignore when reload=True. Defaults to None
  • access_log (bool): Enable the uvicorn access log. Defaults to False

AGENT_OS_HOST and AGENT_OS_PORT environment variables override host and port.

resync

Resync the AgentOS to discover, initialize and configure: agents, teams, workflows, databases and knowledge bases.

Parameters:

  • app (FastAPI): The FastAPI app instance

mcp_auth_exempt_paths

Return the exact OAuth and discovery paths owned by the configured MCP authentication provider. Use these paths when composing custom parent authentication middleware. Returns an empty list when mcp_auth is not configured; do not replace the result with an unrestricted /mcp wildcard.