> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent SDK

> Build agents, teams, and workflows using the Agno SDK.

Agno is a Python SDK for building agent platforms. It gives you three primitives (agents, teams and workflows) and a large set of capabilities you can attach to them.

<Snippet file="create-venv-step.mdx" />

```bash theme={null}
uv pip install -U agno openai sqlalchemy yfinance
```

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```powershell Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

```python Agent theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.tools.workspace import Workspace

workbench = Agent(
    name="Workbench",
    model="openai:gpt-5.5",
    db=SqliteDb(db_file="workbench.db"),
    tools=[Workspace(".")],
    enable_agentic_memory=True,
    add_history_to_context=True,
    num_history_runs=3,
    markdown=True,
)

workbench.print_response("Inventory this folder.")
```

```python Team theme={null}
from agno.agent import Agent
from agno.team import Team
from agno.tools.yfinance import YFinanceTools

bull = Agent(
    name="Bull",
    model="openai:gpt-5.4",
    role="Make the case FOR investing.",
    tools=[YFinanceTools()],
)
bear = Agent(
    name="Bear",
    model="openai:gpt-5.4",
    role="Make the case AGAINST investing.",
    tools=[YFinanceTools()],
)

team = Team(
    name="Investment Committee",
    members=[bull, bear],
    instructions="Hear both sides, then synthesize a balanced recommendation.",
)

team.print_response("Should I invest in NVIDIA?")
```

```python Workflow theme={null}
from agno.agent import Agent
from agno.team import Team
from agno.tools.yfinance import YFinanceTools
from agno.workflow import Step, Workflow

researcher = Agent(
    model="openai:gpt-5.4",
    tools=[YFinanceTools()],
    instructions="Gather raw market data.",
)

bull = Agent(model="openai:gpt-5.4", role="Make the case FOR investing.")
bear = Agent(model="openai:gpt-5.4", role="Make the case AGAINST investing.")
committee = Team(
    name="Investment Committee",
    members=[bull, bear],
    instructions="Debate the position.",
)

writer = Agent(
    model="openai:gpt-5.4",
    instructions="Write a 200-word investment brief.",
)

workflow = Workflow(
    name="Stock Research",
    steps=[
        Step(name="Research", agent=researcher),
        Step(name="Debate", team=committee),
        Step(name="Report", agent=writer),
    ],
)

workflow.print_response("Analyze NVIDIA for investment.")
```

## Primitives

| Primitive | Description |
| - | - |
| [Agent](https://agno-v2.mintlify.site/agents/overview.md) | Model-driven programs with tools and instructions |
| [Team](https://agno-v2.mintlify.site/teams/overview.md) | Multiple agents working together as a team |
| [Workflow](https://agno-v2.mintlify.site/workflows/overview.md) | DAG-based orchestration across agents, teams, and functions. Supports linear steps, loops, branches, parallel work |

## Capabilities

### Model and tools

| Capability | What it adds |
| - | - |
| [Models](https://agno-v2.mintlify.site/models/overview.md) | 30+ providers behind one API |
| [Tools](https://agno-v2.mintlify.site/tools/overview.md) | 100+ integrations and the ability to write your own |
| [Skills](https://agno-v2.mintlify.site/skills/overview.md) | Composable abilities you can attach to agents and teams |
| [Multimodal](https://agno-v2.mintlify.site/multimodal/overview.md) | Image, audio, and video input and output |
| [Structured I/O](https://agno-v2.mintlify.site/input-output/overview.md) | Type-safe input and output with Pydantic schemas |

### Memory and context

| Capability | What it adds |
| - | - |
| [Storage](https://agno-v2.mintlify.site/database/overview.md) | Durability and persistence with supported database backends |
| [Sessions](https://agno-v2.mintlify.site/sessions/overview.md) | Multi-turn session management with summaries, history, and metrics |
| [State](https://agno-v2.mintlify.site/state/overview.md) | Session and agentic state agents can read and update mid-run |
| [Memory](https://agno-v2.mintlify.site/memory/overview.md) | Store facts about each user and recall them in later conversations |
| [Knowledge](https://agno-v2.mintlify.site/knowledge/overview.md) | Search over documents, URLs, and databases |
| [Learning](https://agno-v2.mintlify.site/learning/overview.md) | Agents that improve over time with learned behavior and decisions |
| [Compression](https://agno-v2.mintlify.site/compression/overview.md) | Compress tool call results to save context space |
| [Context Providers](https://agno-v2.mintlify.site/context-providers/overview.md) | Inject live data from Calendar, Gmail, Drive, Slack, Wiki, MCP, and more |

### Control and safety

| Capability | What it adds |
| - | - |
| [Guardrails](https://agno-v2.mintlify.site/guardrails/overview.md) | Input validation, PII detection, and prompt injection defense |
| [Hooks](https://agno-v2.mintlify.site/hooks/overview.md) | Lifecycle hooks for input, output, and state |
| [Human-in-the-Loop](https://agno-v2.mintlify.site/hitl/overview.md) | Pause runs for approval, input, or external execution |

### Operations

| Capability | What it adds |
| - | - |
| [Background execution](https://agno-v2.mintlify.site/background-execution/overview.md) | Continue long-running work after the initial API request returns |
| [Evals](https://agno-v2.mintlify.site/evals/overview.md) | Measure accuracy, performance, and reliability; agent-as-judge |
| [Observability](https://agno-v2.mintlify.site/observability/overview.md) | Tracing with Langfuse, Logfire, Arize, The Context Company, and 12+ providers |
| [Scheduler](https://agno-v2.mintlify.site/scheduler/overview.md) | Run agents, teams, and workflows on recurring schedules |

## Components

Agents, teams, and workflows become runnable **components** once you add their models, tools, state, and configuration. Code-defined components stay in Python. Components created in Studio or through the `/components` API use draft and published versions, with a `current` version that you can promote or roll back.

### Versioned components

When components are created via the API, they carry a versioned configuration. Published versions are immutable, and run requests accept a `version` parameter so you can pin clients to a specific version. A `current` pointer decides which version your production API serves: set it to a newer version to promote, or an earlier one to roll back.

Tune a component's instructions, model, or tools and publish the change as a new version. Promote the new version or roll back to an earlier version based on its results.

## Learn more

> **[SDK Introduction](https://agno-v2.mintlify.site/sdk/introduction.md)**
>
> Agents, teams, and workflows in pure Python.

> **[Build Agents](https://agno-v2.mintlify.site/agents/overview.md)**
>
> Create agents with models, tools, and instructions.

> **[Build Agent Platform](https://agno-v2.mintlify.site/agent-platform/overview.md)**
>
> Assemble a full platform on the AgentOS runtime.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.