Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Confident ai Deepeval Update Retriever Span

From Leeroopedia

Overview

Update Retriever Span is the implementation function that enriches the current retriever-type span with retrieval-specific metadata, including the embedding model name, top-k value, and chunk size. This function is designed to be called from within an @observe(type="retriever") decorated function to attach retrieval configuration data to the span.

API Documentation

Function: update_retriever_span

Source: deepeval/tracing/context.py:L153-166

Import:

from deepeval.tracing import update_retriever_span

Signature:

update_retriever_span(embedder=None, top_k=None, chunk_size=None)

Parameters

Parameter Type Description
embedder Optional[str] The name of the embedding model used for this retrieval operation (e.g., "text-embedding-3-small").
top_k Optional[int] The number of top results retrieved by the similarity search.
chunk_size Optional[int] The size of text chunks used in the retrieval index.

Input / Output

  • Inputs: Retrieval configuration parameters -- embedder name, top_k count, and chunk_size value.
  • Outputs: The current retriever span is enriched with the provided metadata, which is reflected in the Confident AI dashboard for retrieval quality analysis.

Usage Example

from deepeval.tracing import observe, update_retriever_span

@observe(type="retriever")
def retrieve(query: str) -> list:
    update_retriever_span(embedder="text-embedding-3-small", top_k=5, chunk_size=512)
    return vector_store.similarity_search(query, k=5)

Relationships

Principle:Confident_ai_Deepeval_Retriever_Span_Enrichment

Metadata

DeepEval Tracing Observability LLM_Evaluation 2026-02-14 09:00 GMT

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment