mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
b6369d3d14
sqlite-vec enforces k <= 4096 for nearest-neighbor queries. Projects with >4096 vector chunks would crash all vector/hybrid search because candidate_limit = max(100, (limit + offset) * 10) exceeded this hard limit. Clamp the knn k in _run_vector_query while keeping the outer SQL LIMIT unclamped. Only affects SQLite — pgvector has no such constraint. Fixes #604 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>