Skip to content

feat: add search_context tool for searching compressed content#40

Merged
ranxianglei merged 4 commits into
masterfrom
ranxianglei/2026-06-29_search-context
Jun 30, 2026
Merged

feat: add search_context tool for searching compressed content#40
ranxianglei merged 4 commits into
masterfrom
ranxianglei/2026-06-29_search-context

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

  • New search_context tool lets the model search through ALL compressed block summaries before decompressing
  • Fills the gap between compress and decompress: model can find relevant blocks by keyword
  • Returns hit list with relevance scores, previews, and decompress hints

Changes

  • lib/compress/search.ts: Added createSearchContextTool() — searches active block summaries with term-frequency relevance (topic ×0.3, summary ×0.15), case-insensitive, ranks hits, ~3000 char output cap
  • lib/compress/index.ts: Export
  • index.ts: Tool registration + toolsToAdd
  • lib/prompts/system.ts: Tool description

Usage

search_context({ query: "decoder accuracy" })
→ 📦 [b387] ⭐⭐⭐⭐⭐ (0.95) "Decoder experiments"
   Unified decoder PPL=43, acc=34.4%...
   → decompress(387) for full content

@ranxianglei ranxianglei force-pushed the ranxianglei/2026-06-29_search-context branch from 8c54e28 to 93b787a Compare June 30, 2026 00:07
@ranxianglei ranxianglei merged commit 1c3b139 into master Jun 30, 2026
3 checks passed
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