Faiss: Similarity search and clustering for dense vectors
Efficient approximate nearest neighbor search for billion-scale vectors.
Learn more about faiss
Faiss is a C++ library designed for similarity search and clustering operations on dense vector collections. It implements various indexing algorithms that support L2 distance and dot product comparisons, including methods based on binary vectors, quantization codes, and graph-based structures like HNSW and NSG. The library can handle vectors that exceed available RAM through compressed representations and scaling techniques, while optional GPU implementations provide accelerated search and clustering operations. Common applications include approximate nearest neighbor search at scale, vector database operations, and clustering tasks in machine learning pipelines.
Multiple Index Types
Offers exact search baselines and approximate methods using quantization, graphs, and hybrid structures. Engineers select indexes based on specific constraints like memory limits, accuracy requirements, or query latency targets.
Drop-in GPU Acceleration
CPU indexes run on NVIDIA or AMD GPUs with automatic memory management and no code changes. Supports single and multi-GPU configurations with optional cuVS backend for additional performance.
Compressed Vector Storage
Stores only quantized representations instead of original vectors, reducing memory by 8-64x. Enables billion-scale indexing on single machines with controlled precision trade-offs.
import faiss
import numpy as np
# Create random vectors and build index
vectors = np.random.random((1000, 128)).astype('float32')
index = faiss.IndexFlatL2(128)
index.add(vectors)
# Search for 5 nearest neighbors
query = np.random.random((1, 128)).astype('float32')
distances, indices = index.search(query, k=5)Release notes do not specify breaking changes, new requirements, or feature details beyond the version increment.
- –Review the full changelog link to identify any breaking changes or migration steps before upgrading.
- –Test thoroughly in staging as the provided release notes contain no actionable upgrade guidance.
Adds binary CAGRA GPU index, cuVS 25.08 integration with fp16/int8 support, RaBitQ SIMD optimizations, and extended API suffix; no breaking changes noted.
- –Upgrade cuVS to 25.08 and enable fp16/int8 support for CAGRA indexes; add GpuIndexBinaryCagra for binary vector search.
- –Pin openblas to 0.3.30 if using nightlies; static CUDA linking now optional via build flag for deployment flexibility.
Adds RaBitQ quantization, memory-mapping/zero-copy deserialization, and CAGRA/HNSW enhancements; fixes integer overflows in IndexNSG and IVF sharding.
- –Integrate RaBitQ quantization and enable memory-mapped index loading for reduced memory footprint during deserialization.
- –Upgrade to libcuvs 25.04 and fix int32 overflow in IndexNSG plus IVF centroid sharding ID generation bugs.
See how people are using faiss
Related Repositories
Discover similar tools and frameworks used by developers
optuna
Define-by-run Python framework for automated hyperparameter tuning.
gym
Standard API for reinforcement learning environment interfaces.
fastmcp
Build Model Context Protocol servers with decorators.
ComfyUI
Visual graph-based diffusion model workflow builder.
StabilityMatrix
Multi-backend inference UI manager with embedded dependencies.