FAISS
FAISS (Facebook AI Similarity Search) is a library of exact and approximate vector search indexes on CPU/GPU. It is a common building block under custom RAG stacks and inside some vector databases.
Index families
- Flat — exact search; great recall, limited scale
- IVF — coarse quantizer + inverted lists for speed
- HNSW — graph-based ANN with strong recall
- PQ / OPQ — product quantization for memory compression
Choosing a config
Trade memory, latency, and recall against corpus size. GPU indexes help at large $n$; CPU HNSW is often enough for mid-scale apps. Always measure recall@k on a labeled query set before locking the index type.
FAISS handles search math; you still own chunking, embedding models, and metadata filters around it.