Approximate nearest-neighbor (ANN) algorithms speed up top-k similarity search by accepting a small loss in recall. Compared with exhaustive search, they can make queries two or three orders of magnitude faster. section 4.5.3
Choose an index approach to match corpus scale and deployment needs:
- Use a flat NumPy array for prototypes with tens of thousands of chunks. section 4.5.3
- Consider an in-process library such as FAISS for hundreds of thousands of chunks; HNSW is a common default, while IVF suits corpora sharded across many machines. section 4.5.3
- For multi-tenant production with millions of chunks and audit logging, use a vector database such as Pinecone, Weaviate, Qdrant, or Postgres with pgvector. section 4.5.3






