# FAISS

> Canonical: https://skillalmanac.com/glossary/faiss | Last verified: 2026-11-24 | Index status: not offered to search engines

FAISS (Facebook AI Similarity Search) is an open-source library, developed mainly at Meta, for searching, clustering and compressing dense vectors, which are long lists of numbers that stand for text, images or other data.

Also called: Faiss library, Facebook AI Similarity Search, faiss index, faiss python, faiss vector search.

## In plain language

FAISS is a toolbox for finding things that are alike. If a program turns thousands of paragraphs into lists of numbers (called vectors), FAISS can take the numbers for a new question and quickly return the paragraphs whose numbers are closest. Think of a librarian who shelves books by theme and can walk straight to the right shelf. It is a library that a programmer calls from code, not a ready-made search website, so you still build the storage, updates and permissions around it. Faster, approximate search can miss some true best matches, and compressing vectors lowers precision, so the settings need testing on your own data.

## Technical definition

Faiss is a C++ library with Python wrappers that provides indexing methods and related primitives to search, cluster, compress and transform vectors. Its README says it compares vectors by L2 distance or dot product, with cosine similarity available by normalising vectors. An index can store raw vectors, as in a flat index, or compressed codes that lower precision in exchange for scale, and some methods, such as HNSW and NSG, add a graph structure on top of the vectors. The README says some algorithms run on GPUs through CUDA or ROCm. The Faiss paper (arXiv 2401.08281, first submitted January 2024) describes the library's design and the trade-offs of vector search.

## How it shows up when you use agents

FAISS usually sits inside something else. When a coding agent or an app answers questions from a large set of documents, a [retrieval-augmented generation](/glossary/retrieval-augmented-generation) pipeline first turns each chunk of text into an [embedding](/glossary/embedding), a list of numbers that captures meaning. FAISS can hold those lists and return the nearest ones to a question. A [vector database](/glossary/vector-database) offers that storage as a service, with extras around it. FAISS is the search library, so a team that uses it directly writes the saving, loading, updating and access rules itself.

You may meet it when an agent writes Python for a [semantic search](/glossary/semantic-search) prototype, or when a project's dependency list names a faiss package. What breaks when it is misunderstood: a team assumes the index is a database, loses it on restart because nobody saved it, or finds that approximate settings return different neighbours than an exact search would. A sensible next step is to compare an approximate index against an exact one on a small sample of your own questions before trusting it. The guide [What is RAG](/learn/what-is-rag) shows where retrieval sits in the pipeline, and [rag-chunking-planner](/skills/skill-almanac/rag-chunking-planner) tests the chunking step that feeds any index.

## Common confusions

- **FAISS versus a vector database.** FAISS is a library for similarity search that you call from code. A vector database is a service that stores vectors with metadata and handles requests from many clients, and some are built on libraries like it.
- **FAISS versus an embedding model.** FAISS does not create the vectors. A separate [embedding](/glossary/embedding) model does, and FAISS searches what that model produced.
- **Exact versus approximate search.** An index that compresses vectors or uses a graph trades some precision for scale, according to the project README. Check the results against an exact search for your data.
- **Myth.** FAISS is only for GPUs. The README says some algorithms can run on GPUs, and it describes the library as written in C++ with complete wrappers for Python.

## Worked examples in this catalogue

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide explains the indexing and query phases of retrieval-augmented generation, in which stored passages are found by similarity to the question.

Why it exercises the concept: The retrieval step of a RAG system is the job a vector index such as FAISS performs. The guide shows where that step sits and where it fails.

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Your documents split by three chunking strategies, with defects and offline recall reported for each, so chunk settings are chosen with numbers.

Why it exercises the concept: What goes into a vector index is decided by chunking. This skill measures that choice before you load anything into an index. It does not build a FAISS index itself.

### [library-docs-lookup](https://skillalmanac.com/skills/skill-almanac/library-docs-lookup)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An answer to a library question drawn from the installed package's own files, with file and line cited.

Why it exercises the concept: FAISS is a library with its own docs and wrappers. When an agent writes FAISS code, this skill steers it to the installed package's files instead of recall.

## Related terms

- [Vector database](https://skillalmanac.com/glossary/vector-database.md)
- [Embedding](https://skillalmanac.com/glossary/embedding.md)
- [Semantic search](https://skillalmanac.com/glossary/semantic-search.md)
- [Retrieval-augmented generation (RAG)](https://skillalmanac.com/glossary/retrieval-augmented-generation.md)
- [Cosine similarity](https://skillalmanac.com/glossary/cosine-similarity.md)
- [Quantization](https://skillalmanac.com/glossary/quantization.md)

## Sources

- [The Faiss library](https://arxiv.org/abs/2401.08281), arXiv (Douze et al.) (accessed 2026-11-24)
- [facebookresearch/faiss: A library for efficient similarity search and clustering of dense vectors](https://github.com/facebookresearch/faiss), Meta (GitHub) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
