Skip to main content

Module vector

Module vector 

Source
Expand description

Allocation-free vector distance primitives shared by storage and SQL.

Functionsยง

cosine_distance
Cosine distance on decoded f32 slices.
cosine_distance_bytes
Cosine distance (1 - cosine_similarity) on raw LE f32 bytes.
ip_distance_bytes
Negative inner-product distance on raw LE f32 bytes.
l2_distance
L2 (Euclidean) distance on decoded f32 slices.
l2_distance_bytes
L2 (Euclidean) distance on raw little-endian f32 byte slices.
validate_vector_bytes