Skip to main content
Install:

Usage

Returning metadata: {"model": ...} records which model produced each response on the result row, visible in the run’s results and metadata. For a full Execution Timeline, use the LlamaIndex tracing integration (its instrumentation handler captures LLM calls, retrievals, and tool calls automatically), or wrap calls in tracer.trace(..., sync=True) yourself. response.source_nodes (for a query engine) or response.sources (for an agent) are worth recording as tool calls or retrieval steps on that span. For RAG scoring, also return the retrieved chunks themselves as retrieval_context:
This powers the RAG metric pack (faithfulness, context relevancy, and friends) and expected-retrieval-context matching for cases that declare it. A complete working example, with a RAG-vs-ReAct-agent toggle and per-source retrieval tracing, is available as llamaindex_eval.py in the AgentX-Python repository.