Skip to content

Tracing RAG pipelines and agents

Span design for retrieval, reranking, generation and tool loops; attributes that make traces debuggable; token and cost accounting per trace; sampling strategies that keep the interesting traces; and how to find the slow or wrong step.

14 minยทVerified 2026-11Pro+50 XP

A trace of an ordinary web request is a handful of spans. A trace of a RAG request or an agent run is a small program execution, and it is the only artifact that lets you answer "why was this answer slow, wrong or expensive?" for one specific user.

Pro content

Keep reading with Inference Academy Pro

Unlock the rest of this lesson, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.