Skip to content

RetrievalOptions

Options for retrieval operations.

optional filter?: VectorFilter;

Metadata filter (for vector-backed retrievers).


optional hint?: string;

Optional hint or context to guide the retriever.


optional includeEmbeddings?: boolean;

Whether to include embedding vectors in retrieval results. When true, retrievers that use a VectorStore will request includeVectors: true and map the result vectors onto RetrievalResult.embedding. Default: false.


optional queryEmbedding?: readonly number[];

Pre-computed query embedding vector. When provided, vector-backed retrievers SHOULD skip the embed(query) call and use this vector directly. Prevents double-embedding when the caller (e.g., RetrievalCache) has already embedded the query for cache lookup.


optional topK?: number;

Maximum number of results to return.