Building a Generic HNSW Index in Rust: When Cosine Distance Isn’t Enough

Towards AI
Generative AI

Every Rust ANN library I found had the same problem. None of them would let me change the distance function. I’m building OmniPulse, a content fingerprinting system that uses Wavelet Scattering Transform to identify audio. I needed to search a large index of audio fingerprints by similarity. The fingerprints weren’t standard embedding vectors, but scattering coefficients and the most efficient way to compare them was Sliced-Wasserstein distance, not L2 or cosine. I went on a search to find the perfect Rust ANN Library.