faiss: Search and Cluster Dense Vectors Efficiently

Summary
Faiss provides indexing methods for similarity search and clustering over dense vectors, with trade-offs between search speed, accuracy, and memory use. It suits teams building vector retrieval or large-scale nearest-neighbor systems in C++ or Python.
At a glance
- Language
- C++
- License
- MIT
- Stars
- 41k
- Forks
- 4.5k
- Added to OSRepos
- January 29, 2026
- Last analyzed
- October 3, 2026
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Overview
Faiss is a vector search and clustering library for finding vectors closest to a query using L2 distance or dot product. It offers index types that trade search speed and quality against memory use, training time, and the cost of adding vectors, from exact search to compressed and graph-based approaches.
It is aimed at developers and researchers who need to search collections ranging from in-memory datasets to sets that may not fit in RAM. C++ is the main implementation language, with Python/NumPy wrappers and optional GPU support.
Key Features
- Supports similarity search using L2 distance and dot products, including cosine similarity on normalized vectors.
- Provides exact and approximate index types with different memory, speed, and search-quality trade-offs.
- Includes compressed representations that can reduce memory requirements without retaining original vectors.
- Supports graph-based indexing structures such as HNSW and NSG.
- Provides GPU indexes, including single- and multi-GPU use, with CPU and GPU input support.
- Includes clustering, evaluation, and parameter-tuning support.
- Offers C++ and Python/NumPy interfaces.
Use Cases
- Build nearest-neighbor retrieval for recommendation, search, or deduplication systems when records can be represented as dense vectors.
- Search very large vector collections when keeping every original vector in memory is impractical and compressed indexes are acceptable.
- Run approximate vector retrieval on GPU-equipped servers when CPU search does not meet application needs.
- Cluster vector datasets or compare index configurations as part of a machine-learning research workflow.
Project Facts
- Language: C++
- License: MIT
- Stars: 41k
- Forks: 4.5k
- Topics: none listed
- Archived: no
Getting Started
Install a precompiled package with conda install -c pytorch faiss-cpu. GPU packages and build instructions are linked from the README. See the getting-started tutorial for index and search examples.
Alternatives
- lance: Lance combines vector search with columnar storage and dataset versioning, while Faiss focuses on vector indexing and nearest-neighbor search.
Considerations
- Choosing an index requires balancing speed, accuracy, memory, and indexing costs; approximate or compressed indexes may return less precise results than exact search.
- GPU support is optional and requires an appropriate CUDA or AMD ROCm setup. The project also offers CPU-only packages.
- Building from source uses CMake and requires a BLAS implementation. The Python interface is optional.
- Faiss expects vector data and integer identifiers, so applications must handle vector creation and any associated metadata themselves.
Repository: facebookresearch/faiss · Documentation
Source repository
Open the original repository on GitHub.
16 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

agent.cpp: Build Local AI Agents in C++
September 3, 2026
agent.cpp is a C++ library for building agents that run small language models locally through llama.cpp. It provides an agent loop, tools, callbacks, and support for GGUF models, grammar constraints, and LoRA adapters.

ACM-ICPC-Algorithms: Competitive Programming Algorithms
July 16, 2026
A collection of algorithms and data structures for competitive programming, organized by topic. It is useful for ICPC participants and programmers looking for reference implementations across common contest problems.

awesome-competitive-programming: Find Contest Learning Resources
July 16, 2026
A curated directory of resources for competitive programming, algorithms, and data structures. Use it to find study materials, practice platforms, contest tools, and communities in one place.

CompetitiveCode: Explore Competitive Programming Problems and Solutions
July 16, 2026
CompetitiveCode is a community collection of interesting programming challenges and documented solutions organized by source or topic. It is useful for learners practicing algorithms and contributors sharing solutions in several programming languages.