> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/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.

<View title="Python" icon="https://img.logo.dev/python.org?token=pk_BdcHD9e5SCW3j1rnJkNyMQ">
  <h2 id="setup-python">
    Setup
  </h2>

  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.
  </Note>

  <h2 id="auto-instrumentation-python">
    Auto-instrumentation
  </h2>

  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.

  <CodeGroup>
    ```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)
    ```
  </CodeGroup>

  <Accordion title="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.

    <CodeGroup>
      ```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)
      ```
    </CodeGroup>
  </Accordion>

  <h3 id="workflows-python">
    Workflows
  </h3>

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

  <CodeGroup>
    ```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)
    ```
  </CodeGroup>

  <h3 id="eval-runs-python">
    Eval runs
  </h3>

  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.

  <CodeGroup>
    ```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)
    ```
  </CodeGroup>

  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`.

  <h2 id="what-traced-python">
    What Braintrust traces
  </h2>

  Braintrust captures:

  * **Agent run spans** (`<agent>.run`, `<agent>.arun`, and their streaming variants), with the run input, agent and model metadata, output, and token usage.
  * **Team run spans** (`<team>.run`, `<team>.arun`, and their streaming variants), with the run input, team and model metadata, output, and token usage.
  * **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.

  <h2 id="resources-python">
    Resources
  </h2>

  * [Agno documentation](https://www.agno.com/)
  * [Trace LLM calls](/docs/instrument/trace-llm-calls)
</View>
