You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
I also encounter this issues in latest version (Python 0.1.6), and surprised why a kNN query must have harder limit.. I think the maximum limit must the length of row, so we can get all possibilities regardless the score returned..
Hello! So that 4096 limit was attacked to mitigate any possible denial of service attacks, because the results of KNN queries are stored in memory.
I wanted to avoid an attacker adding a k = 99999999 clause to a query and exhausting all the memory of an application.
That being said, making this a configurable settings makes a lot of sense, so I'll take a look at including one. Probably one that can either 1) increase the limit to a new N value, or 2) removing the limit entirely. But this would be an opt-in per-table flag, since I want the default to always be safe.
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?
The text was updated successfully, but these errors were encountered: