Repository navigation
Drop a heading's path chunk when it has real content - #19
Merged
Merged
Conversation
Every markdown heading got a breadcrumb-only `path` chunk regardless of whether it also had narrow/full content chunks. Two independent retrieval benchmarks (a synthetic corpus and a real 137-file vault, 145 hand-verified queries) measured it as retrieval-inert — it never ranked in a query's top 30 across either — while accounting for ~46% of a vault's chunk count, so of embedding time and index size on every `semantic index`. Keep it only where it is load-bearing: a heading with neither direct content nor a non-empty subtree (a placeholder `## Future work` with nothing under it) still needs a row for Store.FileHeadings to derive a valid `#anchor` from, since that's the only place such a heading would otherwise appear in the chunks table. search.go's collapseByFile / bestContentSibling, which promote a path hit to its content sibling, are unchanged — they now only ever fire for that one case, which is exactly correct (nothing to promote to). [reindex] — chunkVersion 5; every vault re-chunks and re-embeds once on the first index after upgrading. Signed-off-by: John Sabath <john@reactor.inc>
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.
Every markdown heading gets a breadcrumb-only
pathchunk regardless ofwhether it also has narrow/full content chunks — even a heading with a full
paragraph under it carries an extra, content-free copy in the index.
Two independent retrieval benchmarks (a synthetic corpus and a real 137-file
vault, 145 hand-verified queries) measured this chunk as retrieval-inert: it
never ranked in a query's top 30 across either set.
pathchunksEmit
pathonly when a heading has neither direct content nor a non-emptysubtree (a placeholder
## Future workwith nothing under it) — the one casewhere
Store.FileHeadingshas no other chunk to derive that heading's#anchorfrom.search.go's existing path→sibling promotion is unchanged;it now only ever fires for that case, correctly finding nothing to promote.
Side effect:
[reindex]—chunkVersionbumps to 5, so every vaultre-chunks and re-embeds once on the next
semantic index.Proof: unit tests pin both the emitted-for and dropped-for cases,
including the empty-subtree-still-gets-an-anchor case
FileHeadings/lintdepend on. Full suite green, including the real-embedding-model e2e script.