> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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:

```python my_os.py theme={null}
from agno.os import AgentOS

agent_os = AgentOS(
    name="My AgentOS",
    agents=[my_agent],
    teams=[my_team],
    workflows=[my_workflow],
    tracing=True
)

app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="my_os:app", reload=True)
```

## Parameters

| Parameter                 | Type                        | Default              | Description                                                                                                 |
| ------------------------- | --------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------- |
| `id`                      | `str`                       | `None`               | Unique instance ID. Generated from `name` or a UUID when unset                                              |
| `name`                    | `str`                       | `None`               | AgentOS name                                                                                                |
| `description`             | `str`                       | `None`               | AgentOS description                                                                                         |
| `version`                 | `str`                       | `None`               | AgentOS version                                                                                             |
| `agents`                  | `List[Agent]`               | `None`               | Agents to include                                                                                           |
| `teams`                   | `List[Team]`                | `None`               | Teams to include                                                                                            |
| `workflows`               | `List[Workflow]`            | `None`               | Workflows to include                                                                                        |
| `db`                      | `BaseDb` or `AsyncBaseDb`   | `None`               | Database used for the AgentOS                                                                               |
| `checkpoint`              | `str`                       | `None`               | Default checkpoint level for agents without their own: `"runs"`, `"tool-batch"`, or `"tools"`               |
| `tracing`                 | `bool`                      | `False`              | Enable tracing to AgentOS `db`                                                                              |
| `knowledge`               | `List[Knowledge]`           | `None`               | Knowledge bases                                                                                             |
| `interfaces`              | `List[BaseInterface]`       | `None`               | Agent interfaces ([docs](/agent-os/interfaces/overview))                                                    |
| `a2a_interface`           | `bool`                      | `False`              | Expose agents and teams over an A2A server ([docs](/agent-os/interfaces/a2a/introduction))                  |
| `config`                  | `str` or `AgentOSConfig`    | `None`               | Configuration path or object ([docs](/agent-os/config))                                                     |
| `settings`                | `AgnoAPISettings`           | `None`               | API settings for the OS                                                                                     |
| `base_app`                | `FastAPI`                   | `None`               | Custom FastAPI app ([docs](/agent-os/custom-fastapi/overview))                                              |
| `on_route_conflict`       | `str`                       | `"preserve_agentos"` | Route conflict handling with a custom `base_app`: `"preserve_agentos"`, `"preserve_base_app"`, or `"error"` |
| `lifespan`                | `Any`                       | `None`               | Lifespan context manager ([docs](/agent-os/lifespan))                                                       |
| `authorization`           | `bool`                      | `False`              | Enable authorization ([docs](/agent-os/security/authorization/overview))                                    |
| `authorization_config`    | `AuthorizationConfig`       | `None`               | JWT verification config                                                                                     |
| `mcp_server`              | `bool` or `MCPServerConfig` | `False`              | Enable MCP server ([docs](/agent-os/mcp/mcp))                                                               |
| `mcp_auth`                | `AuthProvider`              | `None`               | Auth provider for the MCP endpoint (OAuth for connector clients). Requires `mcp_server`                     |
| `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                                                                                     |
| `telemetry`               | `bool`                      | `True`               | Enable telemetry                                                                                            |
| `registry`                | `Registry`                  | `None`               | Component registry for the OS ([docs](/agent-os/studio/registry))                                           |
| `scheduler`               | `bool`                      | `False`              | Enable the cron scheduler ([docs](/agent-os/scheduler/overview))                                            |
| `scheduler_poll_interval` | `int`                       | `15`                 | Seconds between scheduler poll cycles                                                                       |
| `scheduler_base_url`      | `str`                       | `None`               | Base URL for scheduler HTTP calls. Falls back to `http://127.0.0.1:7777`                                    |
| `internal_service_token`  | `str`                       | `None`               | Token for scheduler-to-OS auth. Auto-generated when the scheduler is enabled                                |

See [AgentOS class reference](/reference/agent-os/agent-os) for details.

## 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                  |

#### Environment variable overrides

`serve()` reads `AGENT_OS_HOST` and `AGENT_OS_PORT` from the environment. When set, they override the `host` and `port` arguments.

| Environment Variable | Overrides | Default     |
| -------------------- | --------- | ----------- |
| `AGENT_OS_HOST`      | `host`    | `localhost` |
| `AGENT_OS_PORT`      | `port`    | `7777`      |

Precedence: environment variable > explicit argument > default value.

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

```bash theme={null}
# In your Dockerfile or orchestrator config
ENV AGENT_OS_HOST=0.0.0.0
ENV AGENT_OS_PORT=8000
```

```python my_os.py theme={null}
# No host/port needed. serve() reads from AGENT_OS_HOST and AGENT_OS_PORT.
if __name__ == "__main__":
    agent_os.serve(app="my_os:app", reload=True)
```

### `resync(app)`

Reloads agents, teams, workflows, and resources on the given FastAPI app.

## Configuration

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

```python theme={null}
agent_os = AgentOS(
    name="My AgentOS",
    agents=[my_agent],
    config="config.yaml",  # or AgentOSConfig(...)
)
```

See [Configuration](/agent-os/config) for details.
