LlamaIndex is an AI framework for building context-aware LLM apps like question-answering chatbots and RAG systems using your own private or any public data sources. Integrating HoneyHive with your LlamaIndex chains provides a detailed view of your application’s performance and behavior, which is crucial for debugging and optimization.

In this guide, we’ll delve into the details of LlamaIndex tracing with HoneyHive, exploring how to pass tracers to different LlamaIndex abstractions, understand the parent-child nesting relationships, and how to utilize this information for debugging, evaluating, and monitoring your LlamaIndex pipelines.


This guide assumes you have a basic understanding of Python, the LlamaIndex library, and the HoneyHive platform. Familiarity with AI models and information retrieval would also be beneficial.

Understanding the HoneyHive LlamaIndex Tracer

The HoneyHiveLlamaIndexTracer class is central to tracing with HoneyHive. It’s designed to track various properties of your LlamaIndex execution, including inputs, outputs, error messages, and metadata. These properties are logged and sent to HoneyHive’s platform, where they are visualized and stored for future debugging and optimization.

The Tracer functions by wrapping around your LlamaIndex agent and monitoring the execution of the agent’s tasks. It tracks each event in the agent’s life cycle, from receiving inputs to generating outputs. This allows you to have a detailed view of how your agent is performing, where it’s spending most of its time, and where potential issues or bottlenecks might be.

Properties Tracked by the Tracer

The HoneyHiveLlamaIndexTracer captures a wealth of information including:

  • Function name: The name of the function in the chain that the event is associated with.
  • Event type: The type of event that occurred. This could be a model prediction (model), an operation by a tool (tool), a chain of events (chain), or a generic event (generic).
  • Inputs and Outputs: The inputs to and outputs from the function. For models, this would be the input prompt and the generated text, respectively.
  • Error: Any error that occurred during the execution of the function.
  • Duration: The time it took to execute the function.
  • Metadata and User Properties: Additional data about the event or the user associated with it.

These properties provide deep insights into the chain’s behavior and performance, and they can be viewed and analyzed on the HoneyHive platform.

Integrating the Tracer with LlamaIndex

The initialization of the CallbackManager is crucial to integrate the tracer with the LlamaIndex. The CallbackManager is initialized with the tracer like so.

from llama_index.core import Settings, VectorStoreIndex
from llama_index.core.callbacks import CallbackManager

Settings.callback_manager = CallbackManager([tracer])

After setting up the tracer and integrating it with the LlamaIndex, you can proceed to load your documents and perform a query. The tracer will automatically track the behavior and performance of your model during this operation.

from llama_index.readers.web import SimpleWebPageReader

documents = SimpleWebPageReader(html_to_text=True).load_data(

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()

response = query_engine.query("What did the author do growing up?")

Understanding Parent-Child Nesting Relationships

In a LlamaIndex chain, a chain function can call other functions, creating a parent-child relationship. A parent function is one that calls other functions, while a child function is one that is called by another function.

The HoneyHiveLlamaIndexTracer captures these relationships, showing which function called which. This is particularly useful for debugging, as it allows you to trace the sequence of function calls that led to a particular output or error.

In the HoneyHive platform, parent-child relationships are represented as a nested structure, where each child function is nested under its parent function. This gives you a clear, visual representation of the chain’s execution flow.

Visualizing Tracer Data in HoneyHive

Once your agent has completed its tasks and the Tracer has logged the necessary information, you can view the traces on the HoneyHive platform. Each trace is visualized as a tree, with each node representing an event in your agent’s life cycle. This provides a clear and intuitive way to understand how your agent is operating and where potential issues might be.

The properties tracked by the Tracer are presented in a structured way, allowing you to quickly identify important information such as inputs, outputs, and any errors.

You can use these traces to:

  • Debug your application: If an error occurs during execution, you can use the traces to find out where the error happened and what caused it.
  • Evaluate your model: By comparing the inputs and outputs of your model across different runs, you can evaluate its performance and identify areas for improvement.
  • Monitor your application: Regularly checking the traces can help you spot any unusual behavior or performance issues early on.

LlamaIndex Quickstart

Get started by tracing your LlamaIndex pipelines.