Skip to content

fix: filter distilled messages from temporal FTS search and purge worker boilerplate#261

Merged
BYK merged 1 commit into
mainfrom
byk/temporal-search-noise-reduction
May 12, 2026
Merged

fix: filter distilled messages from temporal FTS search and purge worker boilerplate#261
BYK merged 1 commit into
mainfrom
byk/temporal-search-noise-reduction

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented May 12, 2026

Summary

  • Add AND m.distilled = 0 filter to all temporal FTS search queries (search(), searchScored(), searchLike()) — matches what vector search already does, uses existing compound index
  • Add DB migration v20 that purges legacy worker boilerplate messages (observer, curator, consolidation, reflector, eval system prompts) from temporal storage

Motivation

Temporal FTS search was hitting all 114K+ messages, but only ~14K undistilled ones are meaningful for recall. The other 100K distilled messages are already represented in distillation search results, creating duplicate signal that dilutes results.

Additionally, ~355 legacy worker boilerplate messages (averaging 100KB+ each, with observer prompts up to 1.6MB containing full conversation transcripts) were polluting keyword matches for virtually any domain query. These came from older gateway/plugin worker calls that stored their full system prompts in temporal storage — a pattern that has since been fixed (no new boilerplate since May 9).

Combined with #260 (weighted RRF for vector search), this should significantly improve recall quality for multi-term semantic queries.

…ker boilerplate

Temporal FTS search was hitting all 114K+ messages, but only ~14K
undistilled ones are meaningful — the other 100K are already represented
in distillation search results. Additionally, ~355 legacy worker
boilerplate messages (curator/observer/reflector prompts averaging
100KB+ each, containing full conversation transcripts) were polluting
keyword matches for virtually any domain query.

Two fixes:
1. Add distilled=0 filter to search(), searchScored(), and searchLike()
   in temporal.ts — matches what vector search already does. Uses
   existing compound index for efficient filtering.
2. DB migration v20 purges legacy worker boilerplate messages that
   match known system prompt patterns (observer, curator, consolidation,
   reflector, eval).
@BYK BYK merged commit bef41fa into main May 12, 2026
7 checks passed
@BYK BYK deleted the byk/temporal-search-noise-reduction branch May 12, 2026 17:05
This was referenced May 13, 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