Skip to main content

Module ops

Module ops 

Source
Expand description

Vector operations for RAG system

This module provides high-performance vector operations for similarity search and embedding manipulation. All functions are optimized for hot-path performance.

Functionsยง

approx_equal
Checks if two vectors are approximately equal within a tolerance.
cosine_similarity
Computes the cosine similarity between two vectors.
dot_product
Computes the dot product of two vectors.
l2_distance
Computes the Euclidean (L2) distance between two vectors.
normalize
Normalizes a vector to unit length (L2 norm = 1).