Files
basicmachines-co-basic-memory/src/basic_memory
claude[bot] 24f21f8b01 fix: cap sqlite-vec k value at 4096 to prevent knn query crash
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>
2026-02-25 05:17:07 +00:00
..