Skip to content

fix: remove distilled=0 filter from temporal vector search#387

Merged
BYK merged 1 commit into
mainfrom
fix-vector-distilled
May 19, 2026
Merged

fix: remove distilled=0 filter from temporal vector search#387
BYK merged 1 commit into
mainfrom
fix-vector-distilled

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented May 19, 2026

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. But vectorSearchTemporal() in embedding.ts still had AND distilled = 0 in the SQL query — making the preserved embeddings dead data.

Fix

Remove distilled = 0 from vectorSearchTemporal() 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:

Baseline Before After
Lore 4.20 4.68
Tail-window 2.90 2.65

Per-question improvements:

  • Tests alongside implementation: 2.6 → 4.6
  • Error handling expectations: 4.0 → 5.0

Files Changed

  • packages/core/src/embedding.ts — remove distilled = 0 from vectorSearchTemporal()

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
@BYK BYK self-assigned this May 19, 2026
@BYK BYK merged commit 7cc3b80 into main May 19, 2026
10 checks passed
@BYK BYK deleted the fix-vector-distilled branch May 19, 2026 11:12
This was referenced May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant