Faiss
A library for efficient similarity search and clustering of dense vectors, developed by Meta's Fundamental AI Research group, supporting both CPU and GPU execution.
At a Glance
Fully free and open-source under the MIT License. No cost to use, modify, or distribute.
Engagement
Available On
Listed Jun 2026
About Faiss
Faiss is an open-source C++ library developed primarily at Meta's Fundamental AI Research (FAIR) group for efficient similarity search and clustering of dense vectors. It supports datasets of any size, including those that exceed available RAM, and provides Python/numpy wrappers alongside GPU-accelerated implementations. The library is MIT-licensed and hosted on GitHub, where it has accumulated over 40,000 stars.
What It Is
Faiss solves the nearest-neighbor search problem: given a large set of vectors, find the ones most similar to a query vector as quickly as possible. It builds an in-memory index structure over a fixed set of vectors and then answers queries using L2 (Euclidean) distance, maximum inner product (dot product), or cosine similarity. The library is designed to scale from small datasets to billions of vectors on a single server, trading precision for speed when needed.
Index Types and Algorithmic Foundations
Faiss implements a wide range of indexing algorithms drawn from peer-reviewed research, including:
- Flat indexes — exact brute-force search as a baseline
- IVF (Inverted File) — partitions the space to avoid scanning all vectors, based on the "Video Google" approach (Sivic & Zisserman, ICCV 2003)
- Product Quantization (PQ) — lossy compression of high-dimensional vectors for compact storage and fast approximate search (Jégou et al., PAMI 2011)
- HNSW — graph-based approximate nearest neighbor search using Hierarchical Navigable Small World graphs (Malkov et al., 2016)
- NSG — Navigating Spreading-out Graph for fast approximate search (Fu et al., VLDB 2019)
- Binary indexes — for Hamming-space search using multi-index hashing
- Residual and additive quantizers — for high-recall compressed-domain search
Each index type involves trade-offs across search time, search quality, memory per vector, training time, and add time.
GPU Support and Performance
The GPU implementation accepts input from either CPU or GPU memory and can serve as a drop-in replacement for CPU indexes (e.g., GpuIndexFlatL2 replaces IndexFlatL2). Memory copies between CPU and GPU are handled automatically. Both single-GPU and multi-GPU configurations are supported. According to the project documentation, as of March 2017 the GPU implementation provided what was likely the fastest exact and approximate nearest-neighbor search, fastest Lloyd's k-means, and fastest small k-selection for high-dimensional vectors.
Installation and Setup
The recommended installation path is via Conda:
conda install -c pytorch faiss-cpufor CPU-only usageconda install -c pytorch faiss-gpufor CUDA-enabled GPU indexes- A
faiss-gpu-cuvspackage is also available, enabling NVIDIA cuVS backend GPU implementations
The library compiles with CMake. The only hard dependency is a BLAS implementation; GPU support requires CUDA or AMD ROCm. Python bindings are optional.
Update: v1.14.3
The latest release is v1.14.3, published on June 13, 2026, with the repository last updated on June 21, 2026. The project maintains an active CHANGELOG.md for detailed release notes. The consistent release cadence and recent commits signal ongoing active development and maintenance by the Meta FAIR team and community contributors.
Who It Is For
Faiss is primarily a developer and researcher tool. It is used as a building block in retrieval-augmented generation (RAG) pipelines, image and document retrieval systems, recommendation engines, and any application requiring fast nearest-neighbor lookup over large embedding sets. The library's Python wrappers make it accessible to ML practitioners, while the C++ core and GPU support make it suitable for production-scale deployments.
Community Discussions
Be the first to start a conversation about Faiss
Share your experience with Faiss, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under the MIT License. No cost to use, modify, or distribute.
- Full C++ library source code
- Python/numpy wrappers
- CPU and GPU index implementations
- All indexing algorithms (IVF, PQ, HNSW, NSG, binary, etc.)
- Conda packages (faiss-cpu, faiss-gpu, faiss-gpu-cuvs)
Capabilities
Key Features
- Efficient similarity search over dense vectors
- Clustering of dense vectors
- L2 (Euclidean) distance search
- Maximum inner product (dot product) search
- Cosine similarity search
- k-nearest neighbor search
- Batch vector search
- Range search (radius-based)
- Approximate nearest neighbor search with precision/speed trade-offs
- GPU-accelerated indexes (CUDA and AMD ROCm)
- Multi-GPU support
- Binary vector indexing
- Product Quantization (PQ)
- HNSW graph-based indexing
- NSG graph-based indexing
- Inverted File (IVF) indexing
- Residual quantization
- Additive quantization
- On-disk index storage
- Python/numpy wrappers
- C++ API
- Parameter tuning and evaluation utilities
