Indexes and searches large sets of embedding vectors with CPU or GPU backends. Python and C++ APIs support exact and approximate nearest-neighbor methods.
Overview
Faiss is a library for similarity search and clustering over dense floating-point vectors. It builds in-memory index structures, adds vectors in batches, and runs nearest-neighbor queries under L2 distance, inner product, or related metrics, including cosine via normalized dot products.
Algorithms range from exact flat search to compressed and graph-based indexes that trade memory or accuracy for speed. Some indexes store only quantized codes so billions of vectors can fit on one machine; others layer structures such as HNSW or NSG on raw vectors.
The core implementation is C++ with complete Python bindings. GPU variants accelerate many index types when CUDA or ROCm hardware is available, and optional integrations extend to additional GPU backends. Supporting utilities cover evaluation and parameter tuning.
Installations are commonly distributed through Conda packages for CPU-only or GPU-enabled builds. Faiss is developed primarily at Meta’s Fundamental AI Research group and underpins retrieval and embedding search in research and applied ML pipelines.
Key features
- Dense vector indexes
- L2 and inner product search
- Approximate and exact methods
- Compressed vector codecs
- HNSW and IVF-style indexes
- Python and C++ APIs
- Single and multi-GPU indexes
- Batch query support
Use cases
- Embedding nearest-neighbor retrieval
- Large-scale similarity search
- Vector clustering and k-means
- RAG index backends
- GPU-accelerated nearest-neighbor search
Does the same job as
Faiss doesn't name these products itself, but its own description shows it does the same job.