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.
| Runtime | Requirements | Setup |
|---|---|---|
| Python | Python 3.10+, agno and your provider SDK | Call init() before running your agent |
| TypeScript | Not supported by this integration | — |
Auto-Instrument
Install Dependencies
Run the following command to install
confident-tracealong with Agno and the model provider SDK your agent uses (the example below uses OpenAI):pip install confident-trace agno openaiSetup 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>"from confident_trace import init init(api_key="<your-confident-api-key>")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()Run Agno
Run your agent by executing the script:
python main.pyDone ✅. 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.
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.
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:
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:
Online Evals
Run evaluations on traces and spans in real-time as they're ingested into Confident AI to monitor your agent's quality.
Threads
Group agent runs from the same conversation into a thread and evaluate the whole conversation as one unit.
Last updated on