Save the following code to agno_agent.py:
from agno.os import AgentOS
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic import Claude
agent = Agent(
name="Agno Agent",
model=Claude(id="claude-sonnet-4-5"),
db=SqliteDb(db_file="agno.db"),
add_history_to_context=True,
markdown=True,
)
agent_os = AgentOS(agents=[agent])
app = agent_os.get_app()
if __name__ == "__main__":
agent_os.serve(app="agno_agent:app", reload=True)
In ~20 lines: an Agent with memory and state, served as a FastAPI application.
Run Your AgentOS
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
Install dependencies
uv pip install -U agno anthropic 'fastapi[standard]' sqlalchemy
Export your Anthropic API key
export ANTHROPIC_API_KEY=sk-***
Run your AgentOS
fastapi dev agno_agent.py
Your AgentOS is now running at http://localhost:8000.
| Endpoint | Description |
|---|
http://localhost:8000 | Connect to the control plane |
http://localhost:8000/docs | Interactive API documentation |
http://localhost:8000/config | View AgentOS configuration |