fix: remove distilled=0 filter from temporal vector search#387
Merged
Conversation
Embeddings are now preserved on markDistilled() (PR #380) but the vector search query still filtered distilled=0, making the preserved embeddings useless. Remove the filter so distilled messages are findable via semantic similarity. BM25/LIKE search paths keep the distilled=0 filter (preventing keyword-match duplication). Only vector search is opened up. PR-2 at 400K tokens: Lore 4.20 → 4.68 (tail-window: 2.65) - Tests alongside: 2.6 → 4.6 - Error handling: 4.0 → 5.0
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
Fixes a bug where preserved temporal message embeddings were never used because the vector search query still excluded distilled messages.
Problem
PR #380 stopped NULLing embeddings on
markDistilled()specifically to keep temporal messages findable via vector search. ButvectorSearchTemporal()inembedding.tsstill hadAND distilled = 0in the SQL query — making the preserved embeddings dead data.Fix
Remove
distilled = 0fromvectorSearchTemporal()only. BM25/LIKE search paths keep the filter (preventing keyword-match duplication with distillations). Only vector search is opened up — this provides the semantic similarity path for finding specific details in distilled messages.Results
PR-2 at 400K tokens:
Per-question improvements:
Files Changed
packages/core/src/embedding.ts— removedistilled = 0fromvectorSearchTemporal()