Skip to main content
Automatically capture document ingestion, embedding, retrieval, and LLM synthesis within LlamaIndex pipelines.

Install

Set up

To capture the complete picture—including both the pipeline structure and the underlying token costs—we highly recommend initializing both the LlamaIndex integration and your specific LLM provider (e.g., OpenAI, Anthropic, Google GenAI).

Usage

Once initialized, all LlamaIndex operations are captured automatically:

Verify

Run your code and confirm the trace arrives:
  1. In the TraceRoot UI: Navigate to Tracing > Traces in TraceRoot Cloud. You should see a trace with root span RetrieverQueryEngine.query, the class and method that as_query_engine().query() resolves to.
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Limitations

  • Initializing both Integration.LLAMA_INDEX and your underlying LLM provider integration (such as Integration.OPENAI) is recommended to capture full token usage and pricing.

Run the example

Clone the repo and run a complete agent end-to-end.

Python

Run the Python example

Next steps

Python SDK Reference

Explore the full Python SDK reference and instrumentation options.

Cost Tracking

Learn how TraceRoot calculates token costs and tracks model spend.