feat(sqlite)!: replace Vec1 with bundled sqlite-vec - #1306
Conversation
Bundle sqlite-vec with the builtin extra and load it automatically for SQLite profiles. Remove the Vec1 extension path configuration and migrate vector search, tests, and user documentation to vec0. BREAKING CHANGE: SQLiteConfig no longer accepts vec1_extension; SQLite vector search now uses the bundled sqlite-vec package.
|
This is a breaking change because sqlite-vec is not compatible with Vec1 |
Teingi
left a comment
There was a problem hiding this comment.
The bundled sqlite-vec migration is clear overall, but the FTS-only startup regression and stale RFC contracts should be addressed before merging.
| run_async = dbapi_connection.run_async | ||
| run_async(lambda connection: _load_extension(connection, extension)) | ||
| run_async = dbapi_connection.run_async | ||
| run_async(_load_sqlite_vec) |
There was a problem hiding this comment.
[P1] Load sqlite-vec only for vector-enabled profiles
SQLiteProfile.open(SQLiteConfig(), tables=SHARED_TABLES) now executes this for every SQLite connection, even when no embedding model is configured and open_builtin_contexts() only constructs the FTS index. I reproduced this by making sqlite_vec.loadable_path() point to an unavailable library: the FTS-only profile fails during _warm_sqlite() with sqlite3.OperationalError, before FTS can be used. This also contradicts the updated configuration docs, which say FTS remains available without an embedding model. Please only register/load sqlite-vec when the vector index is enabled, keeping the FTS-only path independent of extension loading.
| supplied. PowerContext does not install or build the native extension; provide a compatible library for the target | ||
| operating system and architecture: | ||
| SQLite vector search is enabled when an embedding model is supplied. The `powercontext[builtin]` extra bundles | ||
| `sqlite-vec`, so no extension path or separate native-library installation is required: |
There was a problem hiding this comment.
[P2] Update the RFC contracts for sqlite-vec
The runtime contract now replaces Vec1 and removes vec1_extension, but the English and Chinese copies of RFCs 0014, 0019, and 0020 still prescribe Vec1, its extension path, and vec1(...) table/query semantics. Readers now get incompatible setup and schema descriptions from the checked-in documentation. Please update both locale copies as part of this breaking change.
Rationale for this change
Replace the external Vec1 dependency with bundled sqlite-vec so SQLite vector search works without manual extension installation.
What changes are included in this PR?
SQLite now uses sqlite-vec for vector and hybrid search.
SQLiteConfig.vec1_extensionhas been removed without backward compatibility.How was this change tested?
make checkmake test: 629 passed, 9 skippedmake docs-testAI usage statement
OpenAI Codex was used to implement and test this change.