core/vector_store/index library

Dart port of a subset of FAISS' vector-index toolkit.

Mirrors the FAISS Python/C++ API: an Index holds a collection of fixed-dimensionality float32 vectors and supports add, optional train, and k-NN search. All indexes are CPU-only for now and operate on Float32Lists for cache-friendly numerics.

Classes

Index
Base class for all FAISS-style indexes.
RangeSearchResult
Result of a radius / range search — variable-length hits per query.
SearchResult
Result of a k-NN Index.search call.
TopK
Bounded-size max-heap of (score, id) pairs, used by every index to accumulate the top-k neighbours in a single pass.

Enums

Metric
Distance metric used by an Index.

Functions

dot(Float32List a, Float32List b) double
Dot product between two d-length float vectors.
l2sq(Float32List a, Float32List b) double
Squared L2 distance between two d-length float vectors.
toFloat32Rows(List<List<double>> rows, int d) List<Float32List>
Convenience: convert a row-major List<List<double>> to a list of Float32List rows (validating dimensionality).