RetrievalOptions
Options for retrieval operations.
Properties
Section titled “Properties”filter?
Section titled “filter?”optional filter?: VectorFilter;Metadata filter (for vector-backed retrievers).
optional hint?: string;Optional hint or context to guide the retriever.
includeEmbeddings?
Section titled “includeEmbeddings?”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.
queryEmbedding?
Section titled “queryEmbedding?”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.