autofaiss

An open-source Python library from Criteo that builds FAISS k-nearest-neighbour indexes automatically. Instead of choosing an index type and its hyperparameters yourself, you set a maximum index size and a maximum query time, and autofaiss picks the index and parameters that give the highest recall within those limits.


What it does

FAISS offers hundreds of index combinations, each with up to six build hyperparameters and further search-time parameters. autofaiss searches that space for you using FAISS’s efficient indexes, binary search and heuristics, maximising recall under two constraints:

ConstraintCLI flag
Index memory--max_index_memory_usage (e.g. "10GB")
Query latency--max_index_query_time_ms (e.g. 10)

A single autofaiss quantize command reads a folder of embeddings and writes the tuned index; the similarity metric is set with --metric_type (e.g. "ip"). Passing a FAISS index_key fixes the index type and has autofaiss tune only its parameters.

The launch post credits product quantization for its headline compression.

The project’s own numbers

On a 200-million-vector image-embedding dataset of about 1 TB, the authors report an index of about 10 GB built in 3 hours with about 15 GB of memory, answering queries in about 10 ms. These are Criteo’s figures, without an independent benchmark or a stated recall value.

Where it fits

  • Automates the index-choice step. The trade-offs in Vector Search Tradeoffs — recall against latency against memory — are exactly what autofaiss searches over. The usual hand-made alternative is FAISS’s own index-choice guide, or benchmarks like Choosing Indexes for Similarity Search (Faiss in Python).
  • FAISS-only. It builds FAISS indexes and nothing else, so everything FAISS lacks on its own — filtering, persistence, live updates — autofaiss lacks too.
  • Release history. The repository is not archived; the latest release is 2.18.0 (November 2025), and the one before it 2.17.0 (January 2024).
  • FAISS — the library it wraps

Articles

People

Company