Faiss is a library for efficient similarity search and clustering of dense vectors.
Faiss addresses the problem of finding similar vectors in large datasets by providing multiple indexing algorithms that trade off search speed, result quality, memory usage, and training time. The library assumes vectors are represented as fixed-dimensional arrays and compared using L2 distance or dot product similarity. It includes methods ranging from exact search baselines to compressed quantization codes that can scale to billions of vectors in memory on a single machine, as well as graph-based structures like HNSW and NSG. GPU implementations are available for the most computationally intensive operations, with automatic memory transfer handling and support for both single and multi-GPU setups.
Faiss suits projects requiring vector similarity at scale, from recommendation systems to semantic search. The choice between methods depends on whether your use case prioritizes exact results or can tolerate approximation in exchange for speed and memory efficiency. The library is implemented primarily in C++ with Python bindings, requires only a BLAS implementation as a core dependency, and offers optional GPU acceleration via CUDA or AMD ROCm. Precompiled packages are available through Anaconda for both CPU and GPU variants.
The project maintains a detailed changelog documenting feature additions and improvements. Development activity includes ongoing refinement of indexing algorithms and GPU implementations, with support for emerging GPU backends like NVIDIA cuVS. The codebase is built with CMake and includes comprehensive documentation alongside the core library functionality.