Repository navigation
Index memory tags in FTS (#58) - #69
Merged
Merged
Conversation
Tags were stored on every memory but never indexed: the external-content FTS table was fts5(repo, note) only, so a query matching a tag but not the note body missed the memory. Migration 013 rebuilds memories_fts as fts5(repo, note, tags) and its three insert/update/delete triggers, carrying new.tags / old.tags through. The JSON array string stored in memories.tags tokenizes straight into tag words under the FTS5 default tokenizer, so no transform is needed. The index is backfilled for existing rows via the 'rebuild' command (FTS5 has no ADD COLUMN). schema.sql reference updated to the final shape. Bench (fts search surface): hit@1 72.7 -> 81.8, hit@5 90.9 -> 93.9, recall@5 85.6 -> 91.7, MRR 0.794 -> 0.864; synonym category 33.3 -> 66.7; misses 3 -> 2. Snapshot committed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
7vignesh
added a commit
that referenced
this pull request
Oct 27, 2026
Release 2.1.0. Ships the backlog merged to main since v2.0.0, notably: - Index memory tags in FTS (#58 / #69) - Tag-filtered retrieval on get_context and search_memory (#59 / #71) Pushing the v2.1.0 tag after this merges triggers the npm publish workflow, which re-checks that the tag matches package.json before publishing.
This branch was successfully deployed
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.
Closes #58 (and the duplicate #4).
What
Index
memories.tagsin the FTS5 table so tag text contributes to keyword recall. Previously the external-content table wasfts5(repo, note)only, so a query matching a tag but not the note body missed the memory.How
memories_ftsasfts5(repo, note, tags)and recreates the three insert/update/delete triggers, carryingnew.tags/old.tagsthrough. FTS5 has noADD COLUMN, so the table is dropped and recreated;INSERT INTO memories_fts(memories_fts) VALUES ('rebuild')backfills every existing row.tags(e.g.["git","release"]) tokenizes straight into the tag words under the FTS5 default tokenizer, so no transform is needed. Verified.fts.tsneeded no change:MATCHspans all FTS columns by default, so tags are searched automatically.schema.sqlreference updated to the final shape.Measurement (per AGENTS.md)
npm run bench, FTS search surface:Snapshot committed. The numbers support keeping the change.
Out of scope (unchanged)
get_context/search_memorysignatures unchanged (tag filtering is the Tag-filtered retrieval (tags filter with AND/OR) #59 follow-up).Tests
Added to
tests/fts.test.ts: tag-only match, note-body regression, and an update-trigger regression.npm run cigreen.