A semantic search system can turn documents into vectors and still be too slow to use. Comparing each query vector with every stored vector becomes a bottleneck when the collection reaches millions or billions of items. FAISS (Facebook AI Similarity Search) is an open-source library for searching dense vectors at that scale. It made real-time similarity search practical for large collections of images, posts, and document passages. section 2.2 section 2.2.3
FAISS combines approximate nearest-neighbor search with clustering, vector compression, and GPU acceleration. Clustering groups similar vectors so a search need not treat the whole collection as one undivided set; compression reduces memory use; GPU-optimized selection speeds the search for close matches. Its clustering explanation starts with k-means: assign vectors to centroids, update the centroids, and repeat. This is the architectural idea, not an index-building recipe. section 2.2.1
Figure 2.3 FAISS's Two-Stage Search Strategy.

The two-stage search diagram separates organizing vectors into clusters from using that organization to accelerate a query. section 2.2.1
Index choice is a trade-off, not a contest for the most elaborate algorithm. FAISS exposes strategies including Flat, IVF, and HNSW. Approximate search can sacrifice some recall for lower latency; GPU acceleration can also make exact search practical at large scale. Choose against the application's recall, speed, and memory requirements, then monitor all three as the index grows. section 2.5 section 2.2.3
Retrieving passages for RAG
An embedding model produces vectors for document passages and a user query. FAISS supplies the scalable search layer that finds relevant passages among millions of stored chunks in real time. Better vector search cannot fix an embedding that places misleading passages close together: retrieval still depends on how well meaning is represented in vector space. section 2.2.3 section 2.0






