kNN Query Limit Error: "k value in knn query too large, provided X and the limit is 4096"
Author: LukasKrieschCreated Dec 18, 2024Updated Jul 1, 2026
When performing k-Nearest Neighbors (kNN) queries using the sqlite-vec extension, queries with a LIMIT or k value greater than the configured maximum (vec_max_k) result in an OperationalError. The default maximum k value is 4096, which can cause issues when trying to retrieve a larger number of results. Is there a possibility to extend the limit?
Source: asg017/sqlite-vec