feat: add optional PostgreSQL + pgvector backend#375
Open
chrisdietr wants to merge 1 commit intotobi:mainfrom
Open
feat: add optional PostgreSQL + pgvector backend#375chrisdietr wants to merge 1 commit intotobi:mainfrom
chrisdietr wants to merge 1 commit intotobi:mainfrom
Conversation
This was referenced Mar 11, 2026
8d183e3 to
55328be
Compare
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.
Summary
Adds PostgreSQL + pgvector as an optional backend for QMD.
SQLite remains the default. PostgreSQL is opt-in via:
QMD_BACKEND=postgresQMD_POSTGRES_URL=postgresql://...This version is rebuilt against the current v2 layout on
main, so the diff matches the current code organization instead of the old pre-v2 structure.Why
SQLite is still the best default for local single-user usage.
PostgreSQL is useful for shared or multi-process deployments where multiple agents or services need concurrent access to the same QMD index.
What changed
src/db.tssrc/pg.tssrc/pg-worker.tssrc/store.tssrc/cli/qmd.tssrc/index.tsOut of scope
Reviewer guide
Suggested review order:
src/db.tssrc/pg.tssrc/pg-worker.tssrc/store.tssrc/cli/qmd.tssrc/index.tstest/store.postgres.test.tsREADME.mdCHANGELOG.mdValidation
bun run buildbun test --preload ./src/test-preload.ts test/sdk.test.tsAI-assisted development notes
Prompts used
src/qmd.tslocation intosrc/cli/qmd.ts.Decision summary
QMDStore.backend.Alternatives considered
Updating the original pre-v2 PR directly
Rejected because the resulting diff was harder to review after the v2 refactor.
Adding explicit PostgreSQL constructor options to the stable SDK in this PR
Deferred to keep this change focused on backend support.
Validation performed