Favicon of FAISS

FAISS

Open-source vector search library for C++ and Python, with MIT licensing, compressed indexes, and CPU or NVIDIA and AMD GPU support.

Screenshot of FAISS website

FAISS is an open-source library for developers who need to search and cluster vector data on their own machines or servers. Its main strength is the choice between exact results and approximate searches that use less memory or return results faster. It's MIT-licensed.

Written in C++ with Python and NumPy wrappers, FAISS handles the search component of applications that compare vector representations. It finds the closest matches using Euclidean distance, dot products, or cosine similarity with normalized vectors. Searches can return several nearest matches, process queries in batches, or find every match within a given radius.

For large datasets, compressed indexes can search without retaining the original vectors, at the cost of some accuracy. These methods can fit billions of vectors in a single server's memory. FAISS also supports datasets that exceed RAM and indexes stored on disk. HNSW and NSG indexes retain the original vectors and add graph structures to speed up searches.

FAISS runs on CPUs, with optional acceleration through NVIDIA CUDA or AMD ROCm. Its GPU implementation supports single and multiple GPUs and accepts vectors from CPU or GPU memory, so it can fit applications whose data already resides on a GPU.

Beyond retrieval, the library includes k-means clustering, binary vector search, and tools for evaluating search quality and tuning the balance between speed, accuracy, and memory use.

Similar to FAISS