Skip to content

RetrievalResult

A single result from a retrieval operation.

optional embedding?: readonly number[];

The embedding vector for this result’s text content. Populated when the retriever requests includeVectors: true from the vector store. Used by RetrievalCache to index results by document embedding without a separate embed() call.


id: string;

Identifier of the retrieved chunk or document.


optional metadata?: Record<string, unknown>;

Metadata associated with the retrieved item.


optional reason?: string;

Human-readable reason for selection.


optional relevanceScore?: number;

Mirrors score for runtimes that consume citation relevance explicitly.


optional score?: number;

Relevance score. Higher is more relevant.


optional snippet?: string;

Short preview used by citation cards.


sourceId: string;

Stable source identifier for citation tracking.


text: string;

The retrieved text content.