v2026.11.2
All Bundles
Bundle

A local vector index for retrieval: store embedding vectors under string ids and ask for the nearest ones. Search is exact (a scan of every vector) for cosine similarity, dot product and Euclidean distance. Compile with -lib ml_vector,gen_collect; it needs nothing from System.ML. Design and measurements: docs/AI.md, "Local vector search".

VectorHit

One search result: the id of a stored vector and its score. For COSINE and DOT a higher score is closer; for L2 the score is the Euclidean distance, so a lower score is closer. Hits come back closest first either way.

Operations

GetId #

The id the vector was added under.

method : public : GetId() ~ String

Return

TypeDescription
Stringid

GetScore #

The cosine similarity or dot product (higher is closer), or the Euclidean distance (lower is closer).

method : public : GetScore() ~ Float

Return

TypeDescription
Floatscore

New # constructor

Constructor

New(id:String, score:Float)

Parameters

NameTypeDescription
idStringid the vector was added under
scoreFloatsimilarity (COSINE, DOT) or distance (L2)