fix(rag): store full hybrid ID in page-level chunk metadata#38
Merged
Conversation
Page-level chunks (__PAGE__) were stored with block_id="__PAGE__"
in ChromaDB metadata, causing all pages to map to the same short ID
("1") in LLM prompts. This meant the LLM couldn't distinguish between
different page-level chunks when making integration decisions.
Changes:
- Store full hybrid ID (e.g., "Andrew McNamara::__PAGE__") instead
of just "__PAGE__" in metadata block_id field
- Bump INDEX_SCHEMA_VERSION to 5 to trigger automatic reindex
- Each page-level chunk now gets unique short ID (1, 2, 3, ...)
Impact:
- Before: <block id="1"> for all pages (collision)
- After: <block id="1">, <block id="2">, <block id="3"> (unique)
- LLM can now reference specific page-level chunks correctly
The schema version bump ensures automatic index rebuild on next
logsqueak extract/search command with no user intervention needed.
Assisted-by: Claude Code
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
=======================================
Coverage 84.61% 84.61%
=======================================
Files 48 48
Lines 5088 5088
=======================================
Hits 4305 4305
Misses 783 783 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Page-level chunks (PAGE) were stored with block_id="PAGE" in ChromaDB metadata, causing all pages to map to the same short ID ("1") in LLM prompts. This meant the LLM couldn't distinguish between different page-level chunks when making integration decisions.
Changes:
Impact:
The schema version bump ensures automatic index rebuild on next logsqueak extract/search command with no user intervention needed.
Assisted-by: Claude Code