← Back to Leaderboard
Ffacebookresearch

facebookresearch/faiss

Embeddable C++ vector search with exact and approximate indexes and optional GPU support

Engineering Health (Methodology)
A+ · 98/100
Maintenance Activity
● Updated today
Latest Release
v1.16.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption23/25
Release Cadence20/20
License Clarity20/20
GPU
Total Stars
★ 42,028
24h Growth
+12
7d Growth
+90
Forks
4,697

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

facebookresearch/faiss Star History (2020-01-12 - 2026-12-04) ALL-TIME STAR HISTORY (2020-01 – 2026-12) +33.8k in 2518d · avg +13/day 43.9k 23.7k 3.5k 2020-01-12: ★ 8,2012020-06-13: ★ 9,4722020-11-14: ★ 10,9962021-04-17: ★ 12,6732021-09-18: ★ 14,0682022-02-19: ★ 15,6762022-07-23: ★ 16,9422022-12-24: ★ 18,1632023-05-27: ★ 21,4362023-10-28: ★ 24,4432024-03-30: ★ 27,0282024-08-31: ★ 29,6302025-02-01: ★ 32,1102025-07-05: ★ 35,3552025-12-06: ★ 37,8662026-05-09: ★ 39,7212026-12-04: ★ 42,028 ★ 42k 2020-01 2023-06 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Faiss is an embeddable C++ library, not a standalone vector database server. The index is the main abstraction: an application supplies vectors, searches with query vectors using the chosen similarity metric, and gets back integer IDs. In a RAG pipeline, the application must map those IDs to documents and metadata; embedding generation and document retrieval sit outside the index.

The native build uses CMake and BLAS. Optional Python bindings expose the index APIs to NumPy workloads; the CPU package manifest uses scikit-build-core with SWIG >=4.2,<5 and NumPy >=2.0 as build requirements. CPU and GPU implementations share the index-oriented interface for supported types, as illustrated by IndexFlatL2 and GpuIndexFlatL2. Check backend support for the specific index before switching a deployment.

Key Capabilities & Differentiators

Faiss supports exact and approximate dense-vector search as well as clustering. It compares vectors using L2 distance or inner product; cosine retrieval uses inner product after normalizing both stored and query vectors. Flat search provides an exact reference for measuring recall. Graph methods such as HNSW and NSG add a structure over raw vectors, while binary and compact-code approaches can, depending on the index, search without retaining the original vectors.

Supported GPU indexes can take buffers from host or device memory and handle transfers automatically when needed. Both single- and multi-GPU use are supported, but end-to-end gains depend on where embeddings are produced and where results are consumed. Use the evaluation and tuning utilities to compare recall, search time, memory per vector, training time, and insertion cost on representative data.

Trade-offs & Limitations

Flat search gives exact neighbors without approximate-index tuning but scans the stored vectors at query time. Graph indexes spend additional memory on links to reduce search work. Compact codes can lower the memory cost substantially, but the savings may come with a recall penalty and, depending on the index, a separate training step. Compare candidates with the same corpus and queries, measuring recall against Flat as well as build and insertion costs.

Compared with a standalone vector database, Faiss removes the need for a separate search service when embedded in the application, but the library does not provide a managed database layer for document storage, filtering workflows, replication, or failover. The MIT license permits commercial integration; keep the required notices when redistributing and review the terms of optional dependencies separately.

Hardware & Deployment Guide

Start with faiss-cpu on representative vectors to establish an exact baseline and profile the retrieval process. The CPU Python package manifest requires Python >=3.10. Anaconda provides faiss-cpu, faiss-gpu, and faiss-gpu-cuvs builds; for a source build, plan for CMake and BLAS, then add the CUDA or ROCm toolchain for the GPU path you intend to use. NVIDIA cuVS is optional. Faiss can run locally without a hosted API.

Size RAM or VRAM for the selected index representation and search workspace, then measure at realistic batch sizes and concurrency. Test host-to-device transfers in the full pipeline before committing to GPU deployment. The v1.16.0 changes include e-means benchmarks, a max_points_per_centroid option for e-means, and a regression test for flat search in a nested OpenMP region.

Integration boundary: the C++ index and Python/NumPy bindings return integer IDs for application-side document lookup.
Similarity metrics: use L2 or inner product directly, or normalize both sides for cosine retrieval.
Exact baseline: use IndexFlatL2 to establish ground truth before evaluating approximate L2 indexes.
Index layout: HNSW and NSG add graph structures, while some compact-code indexes can discard original vectors.
GPU execution: supported indexes accept host or device buffers; device-resident inputs and outputs avoid transfers.
Build choices: CMake and BLAS form the native build path, with optional CUDA, ROCm, and NVIDIA cuVS support.
Best For

RAG or recommendation teams that already own their embedding and document pipelines and need direct control over in-process vector retrieval, recall, and memory use.

Skip If

You need a ready-to-run networked database that owns document and metadata storage, filtering workflows, replication, and failover.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

GPU
@article{douze2024faiss,
      title={The Faiss library},
      author={Matthijs Douze and Alexandr Guzhva and Chengqi Deng and Jeff Johnson and Gergely Szilvasy and Pierre-Emmanuel Mazaré and Maria Lomeli and Lucas Hosseini and Hervé Jégou},
      year={2024},
      eprint={2401.08281},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
faiss ★42k+90C++MITEmbeddable C++ vector search with exact and approximate indexes and optional GPU
firecrawl216.5k+4.6kTypeScriptAGPL-3.0Local and hosted web ingestion that turns sites into RAG-ready Markdown
markitdown199.7k+909PythonMITPython library and CLI that turn mixed-format documents into Markdown for RAG in
claude-mem121.7k+1.4kTypeScriptApache-2.0Hook-driven memory and hybrid search for coding agents that need cross-session r

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/facebookresearch/faiss.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

facebookresearch/faiss Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about faiss

How do I integrate Faiss into a RAG pipeline?

Generate embeddings outside Faiss, add them to the index, and search with query embeddings from the same embedding space. Use the returned integer IDs to fetch text and metadata from your application store. For cosine retrieval, normalize both indexed and query vectors and use inner product.

Do I need a GPU, and how should I estimate VRAM usage?

No. The CPU build can run the retrieval layer by itself. For GPU sizing, measure the selected index and search workspace at representative batch sizes and concurrency. Copies between host and device memory can offset compute gains, so compare end-to-end latency rather than kernel time alone.

Can I self-host Faiss in a commercial product?

Yes. The MIT license permits commercial use and self-hosting. If you redistribute Faiss, retain the required copyright and permission notices. Review THIRD_PARTY_NOTICES and check the terms of any optional dependencies you ship with your build.

When is a vector database a better choice than Faiss?

Choose Faiss when you want an in-process search index and already have a home for documents, metadata, and operational controls. Choose a vector database service when filtering, replication, or a managed network endpoint are central requirements. Compare both on end-to-end retrieval quality and latency under your real filtering and update workload.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining facebookresearch/faiss? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature facebookresearch/faiss on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare