fix(search): keep mental-model derived state current - #3313
Open
JiehoonKwak wants to merge 1 commit into
Open
Conversation
Build embeddings and VectorChord lexical projections from the same canonical name-plus-content document for partial updates and clears. Keep Knowledge Page renames synchronized with their backing mental model so dense and lexical search state cannot silently retain the old page name.\n\nThis narrows the former PR after upstream vectorize-io#3318: backend query dispatch and schema reconciliation are intentionally excluded and will be handled separately.\n\nContext:\n- vectorize-io#3318 now owns backend-neutral Knowledge Page search dispatch.\n- Name-only and content-only writes previously embedded incomplete text.\n- Clear and page rename left dense embeddings stale.\n- Provider calls remain outside pooled database connections.
JiehoonKwak
force-pushed
the
codex/fix-mental-model-search-lifecycle
branch
from
August 10, 2026 11:36
0ce205f to
395e410
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
name + contentdocument on both name-only and content-only updatesRoot cause
After #3318, VectorChord lexical projections are written on normal create/update paths, but partial updates can still derive dense search state from incomplete text. Name-only updates do not re-embed, clear leaves the old dense vector searchable, and a Knowledge Page rename changes only
knowledge_pages.namewhile its searchable backing row retains the old name.The fix resolves the complete stored document before embedding, keeps provider calls outside pooled database connections, and reuses the shared
pg_search_vector_expr()helper added upstream for the only application-maintained lexical column (VectorChord). Native PostgreSQL updates its generated column; the other backends index base columns.Part of #3307.
Scope
This PR intentionally does not change Knowledge Page query dispatch, runtime backend reconciliation, or perform an in-place text-backend conversion. #3318 owns query dispatch; safe PGroonga physical reconciliation is a separate atomic change.
Verification
./scripts/hooks/lint.sh(Ruff, formatting, ty, ESLint/Prettier): passed