Skip to main content

GETSIMN

Find the N most similar vectors to an input vector, ranked by a similarity metric. Optionally restrict candidates with a predicate.

Syntax

GETSIMN <n> WITH [<float>, ...] USING <cosinesimilarity|euclideandistance|hnsw> IN <store_name> WHERE (<predicate>)

Parameters

Example

GETSIMN 3 WITH [0.25, 0.88] USING cosinesimilarity IN my_store WHERE (category != "draft")

See SDK examples for Python, Node, Go, and Rust.