← Back to all projects

Faiss

The similarity-search library that sits underneath the vector databases — an algorithm, not a product

OfficialMIT
Stars
41.2k
Forks
4.6k
Open issues
363
Last commit
29 Oct 2026

What is Faiss?

It is built around an index that holds a set of vectors and searches them, and the dozens of available index structures exist because the trade-offs are real: search time against result quality against memory per vector against how long the index takes to build, and whether it needs training data at all. Some methods keep only a compressed representation and never the original vectors, which is how a single server reaches billions of them. There is no server, no filtering and no access control here — those are what the databases built on top of it add.

What can you do with Faiss?

  • Choose the trade-off deliberately — Index structures differ along search time, search quality, memory per vector, training time and whether unsupervised training data is required at all, with exact search available as the baseline to measure the approximations against.
  • Search more vectors than you could store — Binary vectors and compact quantization codes search a compressed representation and discard the originals, which is what lets a single server hold billions of vectors in main memory — at a documented cost in precision.
  • Move to the GPU by changing the class name — A GPU index substitutes for its CPU counterpart directly, copies between host and device memory are handled for you, and both single-GPU and multi-GPU use are supported.
  • Cluster, not only search — K-means and supporting code for evaluation and parameter tuning ship with the library, so choosing the right index configuration is something you can measure rather than guess.
  • Use it from Python or C++ — The implementation is C++ with complete Python and numpy wrappers, and precompiled packages exist for CPU, GPU and cuVS-backed builds; the only hard dependency is a BLAS implementation.

Before you choose Faiss

  • This is a library, not a database: no server, no metadata filtering, no access control and no persistence beyond writing an index to a file — the operational half is yours to build or to borrow.
  • Which index to use has no default answer; the documented trade-offs mean that evaluating configurations against your own vectors is part of adopting it rather than a later optimisation.

Star history

21 Aug to 30 Oct · +448

40.8k41.2k

Frequently asked questions

Is Faiss free for commercial use?

Faiss is released under the MIT licence — OSI-approved open source, which permits commercial use.

How can Faiss be deployed?

Faiss is available as Self-hosted / Runs locally.