What to build
Add an optional IVF (Inverted File Index) structure for faster search on large codebases. Instead of comparing the query against ALL vectors (O(n)), partition vectors into clusters at index time. At query time, find the nearest N clusters to the query, then brute-force only those clusters.
Decision: Opt-in for large codebases
- Default: Brute force (current behavior). Exact results, fine for <50k vectors.
- Opt-in: Enable via
config.index.ivf.enabled: true or pix index --ivf.
- Clustering: K-means with sqrt(n) clusters. Store centroids + cluster assignments per vector.
- Query: Find nearest N centroids, search only those clusters.
Acceptance criteria
Blocked by
None - can start immediately
What to build
Add an optional IVF (Inverted File Index) structure for faster search on large codebases. Instead of comparing the query against ALL vectors (O(n)), partition vectors into clusters at index time. At query time, find the nearest N clusters to the query, then brute-force only those clusters.
Decision: Opt-in for large codebases
config.index.ivf.enabled: trueorpix index --ivf.Acceptance criteria
.pix/ivf-centroids.bin.pix/ivf-assignments.jsonpix statusshows IVF enabled/disabledBlocked by
None - can start immediately