feat(persistence): add embedded seekDB support - #1293
Merged
Conversation
- manage embedded seekDB lifecycle with pylibseekdb - reuse OceanBase vector and full-text persistence logic - support default and custom seekDB data paths - add seekDB configuration and profile tests
Teingi
reviewed
Aug 20, 2026
Teingi
reviewed
Aug 20, 2026
1 task
… harden shutdown cancellation
# Conflicts: # e2e/bub/uv.lock
Member
Author
|
Thanks for the review @Teingi . I have addressed all of the feedback:
Validation completed:
I kept the GitHub workflows unchanged to keep this PR focused on the minimal seekDB integration. |
Teingi
reviewed
Aug 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional embedded seekDB persistence backend to PowerContext’s Server/runtime, enabling OceanBase-compatible storage without running an external database process.
Changes:
- Introduces
SeekDBConfig/SeekDBProfileand wiresseekdbinto runtime database selection and composition. - Adds settings support for default/blank/custom seekDB paths, plus E2E harness support for discovering and purging seekDB-backed scopes.
- Adds the
powercontext[seekdb]extra (withpylibseekdb) and documents how to install/configure embedded seekDB.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/powercontext/builtin/persistence/seekdb/profile.py |
Implements embedded seekDB lifecycle + SQLAlchemy async engine creation over a local Unix socket. |
src/powercontext/builtin/persistence/seekdb/__init__.py |
Exposes seekDB config/profile/errors as a package API. |
src/powercontext/builtin/runtime/composition.py |
Allows the builtin runtime to open either OceanBase or embedded seekDB profiles for OceanBase-compatible indexes. |
src/powercontext/builtin/runtime/config.py |
Extends the database discriminator union to include SeekDBConfig. |
src/powercontext/server/settings.py |
Adds settings normalization so seekDB path defaults correctly when omitted/blank. |
src/powercontext/paths.py |
Adds default_seekdb_path() and exports it. |
tests/builtin/persistence/test_seekdb_profile.py |
Adds unit tests for seekDB profile lifecycle, cancellation safety, and SQLAlchemy dialect close behavior. |
tests/test_server.py |
Adds ServerSettings coverage for selecting seekDB and for default/blank/custom path handling. |
tests/e2e/real_experience_skill/harness.py |
Extends the E2E harness DB utilities to support seekDB profiles. |
pyproject.toml |
Defines the seekdb optional extra and its dependency on pylibseekdb. |
uv.lock |
Locks the new optional pylibseekdb dependency and adds the seekdb extra metadata. |
e2e/bub/uv.lock |
Updates the E2E lock metadata to include the seekdb extra requirements. |
docs/en/docs/how-to/install-and-run.md |
Documents embedded seekDB installation/configuration. |
docs/zh/docs/how-to/install-and-run.md |
Chinese documentation for embedded seekDB installation/configuration. |
.env.example |
Adds an opt-in embedded seekDB configuration example. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
# Conflicts: # tests/test_server.py
# Conflicts: # tests/test_server.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
None
Rationale for this change
PowerContext currently supports SQLite and externally managed OceanBase deployments. This PR adds an optional embedded seekDB backend for users who need OceanBase-compatible persistence without running a separate database server.
The integration uses
pylibseekdbonly to manage the embedded database lifecycle, while reusing the existing OceanBase-compatible persistence, full-text search, and vector search paths.What changes are included in this PR?
powercontext[seekdb]extra withpylibseekdb.SeekDBConfigandSeekDBProfile.seekdbto the runtime database discriminator and persistence composition.POWERCONTEXT_SERVER_DATABASE_KIND=seekdb.seekdbsubdirectory whenDATABASE_PATHis omitted or blank..env.examplewith an opt-in embedded seekDB configuration example.uv.lockwith the optional seekDB dependency.Are there any user-facing changes?
Yes. This PR adds a new opt-in persistence backend.
Install PowerContext with embedded seekDB support:
pip install "powercontext[server,seekdb]"Configure the Server:
The seekDB database name defaults to
test.This is not a breaking change:
pylibseekdbis not installed by the default Server extra.kind=seekdbis selected.Embedded seekDB currently requires a supported Linux or macOS
pylibseekdbwheel. Windows users can continue using SQLite or OceanBase, but embedded seekDB is not currently available on Windows.How was this change tested?
uv lock --check: passed.git diff --check: passed./health/livereturned a healthy status./health/readyreported both the runtime and database as ready.Ctrl+Cshutdown exited with code 0.ConnectionResetError, SQLAlchemy close warning, or traceback.AI usage statement
OpenAI Codex (GPT-5.6) was used to assist with implementation, debugging, code review, test execution, and drafting this PR.