Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agno.com/llms.txt

Use this file to discover all available pages before exploring further.

AgentOS comes with a built-in tracing provider that routes traces to your database. Every run produces a trace tree: spans for the LLM call, each tool, hook, retrieval, and team delegation. These can be stored in agno_traces and agno_spans in the same db you use for sessions.
from agno.os import AgentOS

agent_os = AgentOS(
    agents=[agent],
    db=db,
    tracing=True,
)

Multi-database tracing

Traces are high-volume and write-heavy. For production deployments, you’ll often want them in a separate database from sessions and memory. Traces generally have a different cost profile, different retention and different access patterns:
from agno.db.postgres import PostgresDb

primary_db = PostgresDb(db_url="postgresql://primary/...")
trace_db = PostgresDb(db_url="postgresql://traces/...")

agent_os = AgentOS(
    agents=[agent],
    db=primary_db,
    tracing=True,
    trace_db=trace_db,
)
See Multi-DB tracing for the full setup.

What gets captured

SpanAttributes
Runagent_id, user_id, session_id, model, latency, status
LLM callModel, prompt tokens, completion tokens, temperature, tool calls returned
ToolTool name, arguments, result, duration, exception (if any)
Pre/post hookHook name, duration, modified input/output
RetrievalQuery, vector store, k, returned docs, scores
Team delegationMember name, mode, sub-run trace
Traces follow OpenTelemetry semantic conventions and you can query them directly:
-- Top-10 slowest span types by average duration
SELECT
    name,
    AVG(duration_ms) AS avg_ms,
    COUNT(*) AS calls
FROM agno_spans
GROUP BY name
ORDER BY avg_ms DESC
LIMIT 10;

In the AgentOS UI

The control plane renders the same traces visually. Click a run and see the full tree: LLM hops, tool calls with their inputs and outputs, hooks, sub-agent traces. Filter by user, session, time range.

External providers

Send traces to Langfuse, Langsmith, Arize, or any OpenTelemetry endpoint by adding an exporter. Check out the Observability section: Langfuse, Langsmith, Arize, Logfire, MLflow.