import type { Field } from '../model/implementation/field.js'; import type { RootEntityType } from '../model/implementation/root-entity-type.js'; import { QueryNode } from './base.js'; import { VariableQueryNode } from './variables.js'; /** * A QueryNode that represents a vector nearest-neighbor search on a root entity type. * * This node follows the same innerNode+itemVariable pattern as TransformListQueryNode * and TraversalQueryNode, allowing the authorization framework and query-node-object-type * framework to traverse into innerNode for output mapping and field resolution. * * @param rootEntityType - the root entity type being searched * @param field - the field holding the vector embeddings (must have a vectorIndex) * @param vectorNode - a query node evaluating to the query vector ([Float]) * @param nProbe - optional query-time recall knob; number of IVF clusters to probe * @param minScore - optional lower bound on the similarity score (COSINE / INNER_PRODUCT only) * @param maxDistance - optional upper bound on the distance score (L2 only) * @param filterNode - optional pre-filter applied before scoring; defaults to TRUE (no filter) * @param itemVariable - loop variable representing each candidate document * @param innerNode - the output projection node; defaults to itemVariable (identity) * @param skipNode - optional query node evaluating to the number of results to skip (LIMIT skip, count) * @param maxCountNode - optional query node evaluating to the maximum result count (LIMIT) */ export interface VectorSearchQueryNodeParams { readonly rootEntityType: RootEntityType; readonly field: Field; readonly vectorNode: QueryNode; readonly nProbe?: number; readonly minScore?: number; readonly maxDistance?: number; readonly filterNode?: QueryNode; readonly itemVariable?: VariableQueryNode; readonly innerNode?: QueryNode; readonly skipNode?: QueryNode; readonly maxCountNode: QueryNode; } export declare class VectorSearchQueryNode extends QueryNode { readonly rootEntityType: RootEntityType; /** The field that holds the vector embeddings and carries the vectorIndex configuration. */ readonly field: Field; /** A query node that evaluates to the query vector ([Float]). */ readonly vectorNode: QueryNode; /** Number of IVF clusters to probe at query time; undefined uses the index default. */ readonly nProbe: number | undefined; /** Lower bound on similarity score; applicable to COSINE and INNER_PRODUCT metrics only. */ readonly minScore: number | undefined; /** Upper bound on distance; applicable to the L2 metric only. */ readonly maxDistance: number | undefined; readonly filterNode: QueryNode; readonly itemVariable: VariableQueryNode; readonly innerNode: QueryNode; /** Optional offset: number of results to skip before returning (offset in LIMIT skip, count). */ readonly skipNode: QueryNode | undefined; readonly maxCountNode: QueryNode; constructor(params: VectorSearchQueryNodeParams); describe(): string; } /** * A leaf QueryNode that represents the vector similarity/distance score computed by the * enclosing VectorSearchQueryNode. * * Only works within the innerNode of a VectorSearchQueryNode */ export declare class VectorScoreQueryNode extends QueryNode { describe(): string; }