Skip to main content
Set up a development environment and run an agent locally. You will:
  1. Create a virtual environment
  2. Install Agno
  3. Export an API key
  4. Run your first agent
  5. Run your 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.
Agno supports Anthropic, Gemini, Groq, Mistral, Cohere, Ollama, and other providers. This example needs a model that supports tool calling. Set the provider’s API key and change the model= argument. See Models.

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:
The agent lists and reads files, then returns an organized summary. It combines 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:
Install the driver packages with uv pip install -U sqlalchemy psycopg, then set db=PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai") on your agent.

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.