Skip to content

feat: add search_context tool for searching compressed content#40

Open
ranxianglei wants to merge 1 commit into
masterfrom
ranxianglei/2026-06-29_search-context
Open

feat: add search_context tool for searching compressed content#40
ranxianglei wants to merge 1 commit 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

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