Interface QueryOptions

Options for a vector store query operation.

QueryOptions

interface QueryOptions {
    topK?: number;
    filter?: MetadataFilter;
    includeEmbedding?: boolean;
    includeMetadata?: boolean;
    includeTextContent?: boolean;
    minSimilarityScore?: number;
    userId?: string;
    customParams?: Record<string, any>;
}

Properties

topK?: number

The number of most similar documents to retrieve.

Metadata filter to apply to the search. Only documents matching the filter will be considered.

includeEmbedding?: boolean

Whether to include the embedding vector in the retrieved documents.

includeMetadata?: boolean

Whether to include metadata in the retrieved documents.

includeTextContent?: boolean

Whether to include the textContent in the retrieved documents.

minSimilarityScore?: number

Optional minimum similarity score (0-1, or specific to metric) for a document to be included in the results. Interpretation depends on the store's similarity metric.

userId?: string

Optional user ID, which might be used for multi-tenancy filters if the store supports it.

customParams?: Record<string, any>

Provider-specific parameters for the query.