Integrations / LlamaIndex

Trace LlamaIndex agents and RAG

To trace LlamaIndex with Tracify, wrap each query or agent run in the Python SDK's trace_agent decorator and record retrieval as its own step. Model calls made through a wrapped provider client join the same trace.

Your code

LlamaIndex

Tracify

One run.

  • 01One trace per query or agent run
  • 02Retrieval as a separate step
  • 03Model calls with tokens and cost
  • 04Errors and slow steps in order

Setup

A few lines.

python
import tracify

@tracify.trace_agent(name="docs-rag")
def answer(question: str):
    with tracify.span("retrieve", type="retrieval", input=question):
        nodes = retriever.retrieve(question)
    with tracify.span("synthesize", type="llm"):
        return query_engine.query(question)

Full details in the documentation. All integrations are listed on the integrations page.

Can I see which retrieved chunks led to a bad answer?
Yes. Retrieval is recorded as its own step in the run, so you can open it next to the model call that used it.

Send your first trace.

Free to start.