trace.init(). Every query, document retrieval, re-ranking step, LLM synthesis call, and tool invocation is captured as a structured trace — so you can measure retrieval quality, diagnose slow queries, and understand exactly which steps contribute to latency and cost in your production pipelines.
Prerequisites
- Python 3.9 or higher
- An active Veritrix account and API key
- LlamaIndex core installed
Installation & Setup
1
Install Veritrix and LlamaIndex
2
Initialize Veritrix tracing
Call
trace.init() once at the top of your application, before you build any index or query engine.3
Build and query your index as normal
Veritrix instruments LlamaIndex’s global settings and callback system automatically after
trace.init(). No changes to your index or query engine code are needed.Example: RAG Pipeline
The following example builds a simple in-memory vector index and runs a query against it. Veritrix traces the full retrieval-and-synthesis cycle, including the embedding call, retrieved nodes, and the final LLM call.Example: LlamaIndex Agent with Tools
For agentic pipelines, Veritrix captures each reasoning step and tool call the agent makes before arriving at a final answer.What Gets Captured Automatically
Retrieval traces include the actual document chunks returned for each query, making it easy to audit whether your index is surfacing the most relevant content.