my_os.py
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | None | AgentOS name |
agents | List[Agent] | None | List of agents |
teams | List[Team] | None | List of teams |
workflows | List[Workflow] | None | List of workflows |
db | BaseDb | None | Database to use for the AgentOS |
tracing | bool | False | Enable tracing to provided database |
knowledge | List[Knowledge] | None | List of knowledge instances |
interfaces | List[BaseInterface] | None | List of interfaces (docs) |
config | str or AgentOSConfig | None | Configuration file path or config instance (docs) |
base_app | FastAPI | None | Custom FastAPI app (docs) |
lifespan | Any | None | Lifespan context manager (docs) |
authorization | bool | False | Enable RBAC (docs) |
authorization_config | AuthorizationConfig | None | JWT verification config |
enable_mcp_server | bool | False | Turn AgentOS into an MCP server (docs) |
cors_allowed_origins | List[str] | None | Allowed CORS origins |
auto_provision_dbs | bool | True | Auto-provision databases |
run_hooks_in_background | bool | False | Run hooks as background tasks |
Methods
get_app()
Returns the configured FastAPI application.
serve()
Starts the AgentOS server.
| Parameter | Type | Default | Description |
|---|---|---|---|
app | str or FastAPI | Required | FastAPI app instance or module path |
host | str | localhost | Host to bind |
port | int | 7777 | Port to bind |
workers | int | None | Number of workers |
reload | bool | False | Enable auto-reload |
resync()
Rediscover and reinitialize agents, teams, workflows, databases, and knowledge bases.
Configuration
Theconfig parameter accepts a YAML file path or AgentOSConfig instance. Use it to set quick prompts, display names, and per-database settings.