Skip to content

feat(sqlite)!: replace Vec1 with bundled sqlite-vec - #1306

Open
PsiACE wants to merge 1 commit into
masterfrom
codex/replace-vec1-sqlite-vec
Open

feat(sqlite)!: replace Vec1 with bundled sqlite-vec#1306
PsiACE wants to merge 1 commit into
masterfrom
codex/replace-vec1-sqlite-vec

Conversation

@PsiACE

@PsiACE PsiACE commented Aug 21, 2026

Copy link
Copy Markdown
Member

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_extension has been removed without backward compatibility.

How was this change tested?

  • make check
  • make test: 629 passed, 9 skipped
  • make docs-test

AI usage statement

OpenAI Codex was used to implement and test this change.

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.
@PsiACE
PsiACE marked this pull request as ready for review August 21, 2026 09:08
@PsiACE

PsiACE commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

This is a breaking change because sqlite-vec is not compatible with Vec1

@Teingi Teingi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants