> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintrust.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Agno

> Trace Agno agents, teams, and workflows in Braintrust to debug prompts, evaluate models, and monitor production usage

[Agno](https://www.agno.com/) is a Python agent framework for building multi-agent systems. Braintrust traces Agno agents, teams, and workflows, along with the underlying model and tool calls.

**Python**

## Setup

Install the Braintrust SDK and Agno, plus the Yahoo Finance tools used in the example below:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
pip install braintrust agno yfinance
```

Set your Braintrust and model provider API keys:

```bash title=".env" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
BRAINTRUST_API_KEY=your-api-key
OPENAI_API_KEY=your-openai-key
```

> [!NOTE]
>
> Tracing Agno requires Agno 2.1.0 or later.

## Auto-instrumentation

To trace Agno without modifying each agent call, call `init_logger()` and `auto_instrument()` once at startup. `auto_instrument()` patches Agno's agent, team, model, workflow, and tool APIs along with every other supported library.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import braintrust
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools

braintrust.init_logger(project="simple-agent-project")  # Replace with your project name
braintrust.auto_instrument()

# Create and configure the agent
agent = Agent(
    name="Stock Price Agent",
    model=OpenAIChat(id="gpt-5-mini"),
    tools=[YFinanceTools()],
    instructions="You are a stock price agent. Answer questions in the style of a stock analyst.",
)

response = agent.run("What is the current price of AAPL?")
print(response.content)
```

> [accordion] Instrument only Agno
>
> To patch Agno without enabling Braintrust's other integrations, call `setup_agno()` instead. It initializes a logger for you when one isn't already active.
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
> from braintrust.wrappers.agno import setup_agno
> from agno.agent import Agent
> from agno.models.openai import OpenAIChat
> from agno.tools.yfinance import YFinanceTools
>
> # Initialize Braintrust tracing for Agno
> setup_agno(project_name="simple-agent-project")
>
> agent = Agent(
>     name="Stock Price Agent",
>     model=OpenAIChat(id="gpt-5-mini"),
>     tools=[YFinanceTools()],
>     instructions="You are a stock price agent. Answer questions in the style of a stock analyst.",
> )
>
> response = agent.run("What is the current price of AAPL?")
> print(response.content)
> ```

### Workflows

Agno workflows are traced without extra configuration. The workflow run appears as a parent span, with nested agent and model calls underneath it:

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import braintrust
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.workflow import Workflow

braintrust.init_logger(project="workflow-project")  # Replace with your project name
braintrust.auto_instrument()

author_agent = Agent(
    name="Author Agent",
    model=OpenAIChat(id="gpt-5-mini"),
    instructions="Answer with only the author's name.",
)

workflow = Workflow(
    name="Book lookup workflow",
    steps=[author_agent],
)

response = workflow.run("Who wrote Charlotte's Web?")
print(response.content)
```

### Eval runs

When you call `auto_instrument()` or `setup_agno()`, Braintrust also traces Agno's built-in eval types (`agno.eval`) without additional configuration. Each eval run appears as an eval span with the run's `input`, `expected`, `output`, and score.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import braintrust
from agno.agent import Agent
from agno.eval.accuracy import AccuracyEval
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools

braintrust.init_logger(project="agno-evals-project")  # Replace with your project name
braintrust.auto_instrument()

agent = Agent(
    name="Stock Price Agent",
    model=OpenAIChat(id="gpt-5-mini"),
    tools=[YFinanceTools()],
    instructions="You are a stock price agent. Answer with the ticker and nothing else.",
)

evaluation = AccuracyEval(
    name="Ticker Lookup",
    model=OpenAIChat(id="gpt-5-mini"),
    agent=agent,
    input="Which ticker does Figma trade under?",
    expected_output="FIG",
    num_iterations=2,
)

result = evaluation.run(print_summary=True)
```

Eval suites (`agno.eval.suite`, Agno 2.9 or later) automatically open a Braintrust experiment for each suite invocation so each case lands as an experiment row. To keep suite rows in logs instead, pass `eval_experiments=False` to `setup_agno()` or set `BRAINTRUST_AGNO_EVAL_EXPERIMENTS=false`.

## What Braintrust traces

Braintrust captures:

* **Agent run spans** (`<agent>.run`, `<agent>.arun`, and their streaming variants), with the run input, agent and model metadata, output, token usage, and `cancellation_stage` in metadata (Agno v3.0.11 or later).
* **Team run spans** (`<team>.run`, `<team>.arun`, and their streaming variants), with the run input, team and model metadata, output, token usage, and `cancellation_stage` in metadata (Agno v3.0.11 or later).
* **Model call spans** (`<model>.invoke`, `<model>.response`, and their async and streaming variants), with the request messages, model and provider metadata, response, and token usage.
* **Tool call spans** (`<tool>.execute` and `<tool>.aexecute`), with the tool arguments, function metadata, and result.
* **Workflow run spans** (`<workflow>.run`, its async and streaming variants, and nested workflow-step spans), with the workflow input, workflow metadata, output, and token usage.
* **Eval run spans** (`AccuracyEval`, `AgentAsJudgeEval`, `ReliabilityEval`, and `PerformanceEval`), with the eval's input, expected output, output, and 0-1 normalized scores. `AgentAsJudgeEval` requires Agno 2.4 or later. Batch runs include per-case scorer spans.
* **Eval suite case spans** (`agno.eval.suite`, Agno 2.9 or later), with each case's input, expected output, output, tags, and combined judge, reliability, and scorer scores. A Braintrust experiment opens automatically for the suite when a project is in scope.

## Resources

* [Agno documentation](https://www.agno.com/)
* [Trace LLM calls](https://docs.braintrust.dev/instrument/trace-llm-calls.md)


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