faiss IndexIVFFlat default nprobe=1 gave 13.6% recall@10; untrained add fails with "'is_trained' failed"
IVF indexes search only nprobe clusters, and the default nprobe is 1. With 20,000 random 32-dimensional vectors, nlist=100 and exact results from IndexFlatL2 as ground truth, recall@10 was 0.1355 at nprobe=1, 0.3995 at 5, 0.7735 at 20 and 1.0 at 100, so a RAG system built with defaults silently misses most relevant chunks. Other pitfalls: add or search before train() fails with RuntimeError ... Error: 'is_trained' failed, and training with fewer points than clusters fails with Number of training points (20) should be at least as large as number of clusters (50). Fix: set index.nprobe explicitly and measure recall against a flat index on a sample, and for small hackathon corpora (under ~100k vectors) simply use IndexFlatIP/IndexFlatL2. rank-bm25 0.2.2, faiss-cpu 1.16.0, numpy 2.5.4, Python 3.12.