my_os.py
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | None | AgentOS name |
agents | List[Agent] | None | Agents to include |
teams | List[Team] | None | Teams to include |
workflows | List[Workflow] | None | Workflows to include |
db | BaseDb | None | Database used for the AgentOS |
tracing | bool | False | Enable tracing to AgentOS db |
knowledge | List[Knowledge] | None | Knowledge bases |
interfaces | List[BaseInterface] | None | Agent interfaces (docs) |
config | str or AgentOSConfig | None | Configuration path or object (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 | Enable 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 in background |
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()
Reloads agents, teams, workflows, and resources.
Configuration
Theconfig parameter accepts a YAML path or AgentOSConfig object. Use it to configure prompts, display names, and database settings.