Run Your First AgentOS

Serve an agent through FastAPI with persistent sessions and a local REST API.

Save the following code to agno_assist.py:

agno_assist.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic import Claude
from agno.os import AgentOS

db = SqliteDb(db_file="agno.db")

agent = Agent(
    name="Agno Assist",
    model=Claude(id="claude-sonnet-4-5"),
    db=db,
)

agent_os = AgentOS(agents=[agent], db=db)
app = agent_os.get_app()

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

Your agent now has a FastAPI API and persistent sessions.

Run it locally

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U 'agno[os]' anthropic

Export your Anthropic API key

export ANTHROPIC_API_KEY=sk-***

Run your AgentOS

python agno_assist.py

Your AgentOS is now running at http://localhost:7777.

EndpointDescription
http://localhost:7777/healthRuntime health check
http://localhost:7777/docsInteractive API documentation
http://localhost:7777/infoRuntime information and registered component counts
http://localhost:7777/configRegistered components and runtime capabilities

Use http://localhost:7777 as the endpoint when connecting this runtime to the Control Plane.

This local quickstart runs without authentication. Configure Security & Auth before deploying it.

Next steps

TaskGuide
Manage and monitor the runtimeConnect Your AgentOS
Call agents through RESTUsing the API
Explore every endpointAgentOS API reference
Protect the runtimeSecurity & Auth