mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
24f21f8b01
sqlite-vec enforces a hard limit of 4096 on the k parameter in knn queries. When a project grows beyond 4096 vector chunks the computed candidate_limit = max(semantic_vector_k, (limit+offset)*10) can exceed this, causing OperationalError: k value in knn query too large. Cap candidate_limit at SQLITE_VEC_MAX_K = 4096 inside SQLiteSearchRepository._run_vector_query() — the one place in the SQLite backend where k is passed to sqlite-vec. Adds a regression test that verifies the cap is enforced for a limit value that would otherwise produce candidate_limit > 4096. Fixes #604 Co-authored-by: bm-clawd <bm-clawd@users.noreply.github.com> Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>