Skip to main content
Agno is a Python agent framework for building AI applications. Braintrust automatically traces Agno agents and workflows, capturing agent interactions, tool calls, workflow execution, and model responses (supports Agno v2 and higher).
This guide covers manual instrumentation. For quicker setup, use auto-instrumentation.

Setup

Install Braintrust alongside Agno:
pip install braintrust agno
To trace Agno agents with Braintrust using an OpenAI model, configure these environment variables:
.env
BRAINTRUST_API_KEY=your-api-key
OPENAI_API_KEY=your-openai-key

Trace with Agno

To enable automatic tracing, call setup_agno() before creating your agents or workflows. This example creates a stock price agent with Yahoo Finance tools:
Python
pip install braintrust agno yfinance
agno_braintrust.py
from braintrust.wrappers.agno import setup_agno

# Enable Braintrust tracing
setup_agno(project_name="simple-agent-project")

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools

# 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)

Trace Agno workflows

setup_agno() also instruments Agno workflows, including workflow-level spans around run(), async execution, and streaming execution paths.
agno_workflow_braintrust.py
from braintrust.wrappers.agno import setup_agno

setup_agno(project_name="workflow-project")

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.workflow import Workflow

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)
In Braintrust, the workflow run appears as a parent span and nested agent and model calls appear underneath it.

Resources