# Agent Runtime (/features/runtime)



AgentOS is the FastAPI for agents. It serves agents as an API, an MCP server, and through chat interfaces like Slack, Telegram, and WhatsApp. This local example serves an agent with session storage, tracing, scheduling, and MCP:

```python title="workbench.py" lineNumbers
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.os import AgentOS
from agno.tools.workspace import Workspace

workbench = Agent(
    name="Workbench",
    model="openai:gpt-5.5",
    db=SqliteDb(db_file="workbench.db"),  # session storage
    tools=[Workspace(".")],               # read/write in this directory
    add_history_to_context=True,          # add past 3 runs to context
)

# Serve via AgentOS, get streaming, session isolation, API endpoints
agent_os = AgentOS(
    agents=[workbench],
    tracing=True,
    scheduler=True,
    mcp=True,
    db=SqliteDb(db_file="workbench.db"),
)
app = agent_os.get_app()

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

Install the dependencies, set `OPENAI_API_KEY`, save the example as `workbench.py`, and start it:

```bash
uv pip install -U "agno[os,mcp,openai]"
export OPENAI_API_KEY="your-api-key"
python workbench.py
```

Open `http://localhost:7777/docs` to inspect the REST API. `Workspace(".")` exposes local file operations and shell execution; destructive operations require human confirmation by default. Run this example in the directory you want the agent to work in.

AgentOS adds session management, background execution, tracing, evaluations, and opt-in authorization. Configure a [durable worker](/agent-os/background-execution/overview) for queued jobs that must survive process restarts.

Build agents, teams, and workflows with the Agno SDK. Run them with AgentOS. Manage and monitor them using the Control Plane.

## What the runtime gives you [#what-the-runtime-gives-you]

The runtime covers the ground between your agent code and a production service:

| Concern           | How AgentOS handles it                                                               |
| ----------------- | ------------------------------------------------------------------------------------ |
| HTTP API          | Auto-generated endpoints for every registered agent, team, and workflow              |
| Persistence       | Sessions and enabled memory features persist to your `db`                            |
| Streaming         | Run endpoints support SSE; tokens and tool calls stream when `stream=true`           |
| MCP server        | Expose agents, teams, workflows, and custom tools to MCP clients at `/mcp`           |
| Auth              | Set `authorization=True` and configure a JWT verification key to enforce RBAC scopes |
| Scheduling        | Set `scheduler=True` to poll the database and fire due jobs in process               |
| Observability     | Set `tracing=True` to write OpenTelemetry traces to the AgentOS database             |
| Interfaces        | Slack, Telegram, WhatsApp, A2A, AG-UI                                                |
| Human in the loop | Pause runs for user confirmation, admin approval, or external execution              |

## Explore [#explore]

<CardGroup cols="2">
  <Card title="Agent API" icon="server" href="/features/api">
    Run your agent platform as an API.
  </Card>

  <Card title="MCP Server" icon="plug" href="/features/mcp-server">
    Expose agents, teams, workflows, and custom tools to MCP clients.
  </Card>

  <Card title="Agent Storage" icon="database" href="/features/storage">
    Add durability and persistence.
  </Card>

  <Card title="Observability" icon="chart-line" href="/features/observability">
    Tracing, run history, and audit logs in your own database.
  </Card>

  <Card title="Security and Auth" icon="shield-halved" href="/features/security-and-auth">
    JWT validation, RBAC scopes, and per-request isolation.
  </Card>

  <Card title="Scheduling" icon="clock" href="/features/scheduling">
    In-process cron and multi-step workflows.
  </Card>

  <Card title="Interfaces" icon="comments" href="/features/interfaces">
    Reach users on Slack, Telegram, WhatsApp, A2A, and AG-UI.
  </Card>
</CardGroup>
