-
Notifications
You must be signed in to change notification settings - Fork 2
research(tools): MemTool — dynamic tool context pruning for large MCP registries (arXiv:2507.21428) #2204
Description
Source
arXiv:2507.21428 — "MemTool: Optimizing Short-Term Memory Management for Dynamic Tool Calling in LLM Agent Multi-Turn Conversations" (July 2025)
Key Finding
Three tool-context management modes: autonomous (agent decides what to prune), workflow (deterministic two-step: remove obsolete → add new), and hybrid. Evaluated across 5,000 tools and 13+ LLMs. Reasoning models excel at autonomous removal (90–94% efficiency); workflow/hybrid modes provide consistent baseline performance across all model sizes.
Applicability to Zeph
As Zeph's MCP tool registry grows, injecting all tool definitions into every turn is increasingly expensive. MemTool's workflow mode maps directly onto zeph-mcp:
- Step 1: LLM call (fast/cheap provider) removes tools irrelevant to current conversation context
- Step 2: semantic search adds tools likely needed for the upcoming turn
- The
*_providerconfig pattern in Zeph meansgpt-4o-minican handle tool-pruning decisions cheaply
This complements the existing tool schema filter ([agent.tool_filter]) which does semantic selection — MemTool adds the dynamic remove/add lifecycle for MCP-sourced tools specifically.
Priority
P3 — useful as MCP tool count scales up