Skip to main content
Let’s get our dev environment set up for Agno. We will:
  1. Create a virtual environment
  2. Install Agno
  3. Export API key
  4. Run our first agent
  5. Run our agent as a service

1. Create a virtual environment

Agno needs Python 3.9 or newer. We recommend uv, but pip works fine too.

2. Install Agno

Install the Agno SDK plus the OpenAI provider.

3. Export your API key

Don’t have one? Get a key from platform.openai.com.
Any model provider works: Anthropic, Gemini, Groq, Mistral, Cohere, Ollama, and 25+ others. Set the corresponding API key and swap the model= argument. See Models for the full list.

4. Run your first agent

Save this as sorting_hat.py. The agent walks your current directory, decides how to organize it, and prints a tidy summary.
sorting_hat.py
Run it:
You should see the agent reason through the folder, call tools, and return a structured summary. That’s your first agent built using Agno: a model, tools, and instructions.

5. Run your agent as a service

The script above is fine as a one-off. To make the agent reachable over HTTP, with session storage, memory, and tracing, run it using AgentOS. Install the runtime extras:
Save this as workbench.py:
workbench.py
Run it:
The __main__ block calls agent_os.serve(), which starts a uvicorn server with hot reload. Your AgentOS is now running at http://localhost:7777. Open http://localhost:7777/docs for the OpenAPI spec, or connect the UI:
  1. Open os.agno.com and sign in.
  2. Click Add OSLocal.
  3. Enter http://localhost:7777, name it, and connect.
You now have sessions, memory, tracing, and a chat UI.

Wire up your coding agent

Agno is designed to be used with coding agents. The docs are exposed as an MCP server so your coding agent has live access to the surface area. For Claude Code:
You can also drop a .mcp.json in the repo:
.mcp.json
For full setup, see: Using Agno with Coding Agents →

A note on Postgres

Many examples and tutorials in this documentation use Postgres + pgvector instead of SQLite. Postgres is what we recommend for production, and pgvector lets you keep relational data and embeddings on the same engine. The fastest way to run both locally is Docker:
Set your db=PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai")

You’re ready to build with Agno

You have an agent running locally, a path to serving it, your coding agent wired up, and Postgres ready when you need it. From here:

Agents

Build, run and debug agents

Teams

Coordinate multiple agents.

Workflows

Build step-based pipelines.