Library for fast similarity search and clustering of dense vectors
open sourceMITfree
Faiss is a library for efficient similarity search and clustering of dense vectors, developed mainly at FAIR, Meta's fundamental AI research team. It builds an in-memory index over a set of vectors and finds the k nearest neighbours of new vectors in batches, with exact and approximate indexes (inverted files, product quantization, HNSW graphs and more) that trade speed, memory and accuracy, including indexes for sets that don't fit in RAM, plus k-means clustering and tools for evaluation and parameter tuning. It's written in C++ with complete Python wrappers, and many algorithms run on NVIDIA GPUs, including through NVIDIA cuVS. It's a library rather than a database: storage, filtering and serving are left to the application.
Problems it solves
- find the nearest neighbours among millions of embeddings in Python
- do semantic search over embeddings without running a vector database
- search a billion vectors that don't fit in memory
- cluster embedding vectors with k-means on a GPU
Features
- exact and approximate nearest-neighbour search
- IVF, product quantization and HNSW indexes
- indexes for vector sets larger than RAM
- batch search and k-nearest neighbours
- k-means clustering
- GPU indexes, including NVIDIA cuVS
- C++ library with Python wrappers
Alternatives
The same job
These do what Faiss does.
- Qdrant High-performance, massive-scale vector database and vector search engine for the next generation of AI
- Pinecone The trusted AI knowledge platform
- Elasticsearch Open source search, analytics, and AI platform
- Vespa AI search platform: vector, text and structured search with ranking at scale
