Launch Week 02 wrapped — explore all five launches

Agno

Use Confident AI for LLM observability and evals for Agno

Overview

Agno is a Python framework for building agents, teams, and workflows. Confident AI allows you to trace Agno with a single call to init() — agent runs show up in the Observatory, so you can follow their execution and inspect the model and tool calls beneath them.

RuntimeRequirementsSetup
PythonPython 3.10+, agno and your provider SDKCall init() before running your agent
TypeScriptNot supported by this integration

Auto-Instrument

  1. Install Dependencies

    Run the following command to install confident-trace along with Agno and the model provider SDK your agent uses (the example below uses OpenAI):

    pip install confident-trace agno openai
  2. Setup Confident AI Key

    Get your Confident AI Project API key and set it as an environment variable, or pass it to init() directly:

    export CONFIDENT_API_KEY="<your-confident-api-key>"
    export OPENAI_API_KEY="<your-openai-key>"
  3. Configure Agno

    Call init() once at startup, before running your agent. The installed framework is detected automatically.

    main.py
    from confident_trace import init, shutdown
    from agno.agent import Agent
    from agno.models.openai import OpenAIChat
    
    init()
    
    agent = Agent(
        name="assistant",
        model=OpenAIChat(id="gpt-4o-mini"),
    )
    
    try:
        result = agent.run("Explain OpenTelemetry in one sentence.")
        print(result.content)
    finally:
        shutdown()
  4. Run Agno

    Run your agent by executing the script:

    python main.py

    Done ✅. Open the Observatory in your Confident AI project to inspect the trace and its child spans.

What Gets Captured

  • Agent and team execution — run names, timing, status, inputs, outputs, and parent-child relationships.
  • Workflows and steps — workflow execution, individual steps, and supported parallel, conditional, loop, and router containers.
  • Tool calls — tool names and their input/output.
  • Model calls — messages, model details, and token usage from supported provider integrations.
  • Custom spans — application spans created inside a tool remain nested under that execution.

Sync, async, and streamed runs are supported. Consume streams fully, or close them when stopping early. Background job dispatch is not traced as completed agent execution; instrument the worker that runs the job.

Captured inputs, outputs, and messages follow the content policy. Model backends that bypass supported provider integrations require explicit instrumentation for LLM spans.

Set Trace Span Properties

Use a trace context to add properties you know before the call starts. It creates no extra span; the trace started by agent.run() inherits the tags, metadata, and user ID.

main.py
from confident_trace import init, trace_context

init()

with trace_context(
    tags=["support"],
    metadata={"release": "2026-09"},
    user_id="user-42",
):
    result = agent.run("Explain OpenTelemetry in one sentence.")

See trace context for every supported trace property and update behavior.

Instrumenting Multi-Turn

You do not need turn() when one Agno entry-point call is already one conversational turn—the integration creates that turn's trace automatically. Use turn() when you want to define the boundary yourself, such as grouping two sequential Agno calls into one turn. Reuse the same thread ID on later turns to group them into one conversation.

main.py
from confident_trace import init, turn

init()

with turn("support-turn", thread_id="chat-42"):
    context = agent.run("Find the relevant account details.")
    answer = agent.run(f"Summarize these details: {context.content}")

See threads for thread I/O, turn IDs, and user IDs.

Disable Agno Instrumentation

Pass init() a list of integration identifiers to opt in to only those integrations. The identifier for Agno is "agno" in Python; omit it to disable this integration. An empty list disables all automatic instrumentation:

main.py
from confident_trace import init
init(instrumentations=())
# Use ("agno",) to opt in; omit "agno" to disable it.

This turns off Confident AI's automatic instrumentation; calls made after initialization are not instrumented by this integration.

Next Steps

Now that your agent is traced, dive deeper into:

Need help wiring this into your stack?Bring traces and evals into the tools your team already usesTalk to an expert

Last updated on

Built byConfident AI