Overview

The production runtime and control plane for your agentic systems.

AgentOS transforms your agents into a production-ready API.

A minimal application looks like this:

1from kern.os import AgentOS
2
3agent_os = AgentOS(
4 name="My AgentOS",
5 agents=[my_agent],
6 teams=[my_team],
7 workflows=[my_workflow],
8 tracing=True
9)
10
11app = agent_os.get_app()
12
13if __name__ == "__main__":
14 agent_os.serve(app="my_os:app", reload=True)

Parameters

ParameterTypeDefaultDescription
namestrNoneAgentOS name
agentsList[Agent]NoneAgents to include
teamsList[Team]NoneTeams to include
workflowsList[Workflow]NoneWorkflows to include
dbBaseDbNoneDatabase used for the AgentOS
tracingboolFalseEnable tracing to AgentOS db
knowledgeList[Knowledge]NoneKnowledge bases
interfacesList[BaseInterface]NoneAgent interfaces (docs)
configstr or AgentOSConfigNoneConfiguration path or object (docs)
base_appFastAPINoneCustom FastAPI app (docs)
lifespanAnyNoneLifespan context manager (docs)
authorizationboolFalseEnable RBAC (docs)
authorization_configAuthorizationConfigNoneJWT verification config
enable_mcp_serverboolFalseEnable MCP server (docs)
cors_allowed_originsList[str]NoneAllowed CORS origins
auto_provision_dbsboolTrueAuto-provision databases
run_hooks_in_backgroundboolFalseRun hooks in background

See AgentOS class reference for details.

Methods

get_app()

Returns the configured FastAPI application.

serve()

Starts the AgentOS server.

ParameterTypeDefaultDescription
appstr or FastAPIRequiredFastAPI app instance or module path
hoststrlocalhostHost to bind
portint7777Port to bind
workersintNoneNumber of workers
reloadboolFalseEnable auto-reload

Environment variable fallbacks

When host or port are not passed explicitly, serve() reads from environment variables before using defaults.

Environment VariableFallback ForDefault
AGENT_OS_HOSThostlocalhost
AGENT_OS_PORTport7777

Precedence: explicit argument > environment variable > default value.

This is useful for containerized deployments where host and port are configured externally:

1# In your Dockerfile or orchestrator config
2ENV AGENT_OS_HOST=0.0.0.0
3ENV AGENT_OS_PORT=8000
1# No host/port needed. serve() reads from AGENT_OS_HOST and AGENT_OS_PORT.
2if __name__ == "__main__":
3 agent_os.serve(app="my_os:app", reload=True)

resync()

Reloads agents, teams, workflows, and resources.

Configuration

The config parameter accepts a YAML path or AgentOSConfig object. Use it to configure prompts, display names, and database settings.

1agent_os = AgentOS(
2 name="My AgentOS",
3 agents=[my_agent],
4 config="config.yaml", # or AgentOSConfig(...)
5)

See Configuration for details.