arXiv:2507.21428cs.CL2025-07被引 17

让大模型在对话中高效管理工具记忆,避免信息过载

MemTool: Optimizing Short-Term Memory Management for Dynamic Tool Calling in LLM Agent Multi-Turn Conversations

  • 设计三种记忆管理架构,动态控制工具调用上下文
  • 自主模式下推理模型工具清理效率达90%-94%
  • 适合需要长期工具协作的智能体应用开发

大型语言模型(LLM)代理在动态搜索并集成相关工具或模型上下文协议(MCP)服务器方面展现出显著的自主能力。然而,固定的上下文窗口限制了其在需要重复、独立使用工具的多轮交互中的有效性。我们提出MemTool,一种短时记忆框架,使LLM代理能够在多轮对话中动态管理工具或MCP服务器上下文。MemTool提供三种代理架构:1)自主代理模式,赋予完全的工具管理自主权;2)工作流模式,提供无自主性的确定性控制;3)混合模式,结合自主与确定性控制。在ScaleMCP基准上对13+种LLM进行评估,实验覆盖100次连续用户交互,测量工具移除比率(短时记忆效率)和任务完成准确率。在自主代理模式下,推理类模型实现高工具移除效率(3窗口平均90%-94%),而中等规模模型效率显著较低(0%-60%)。工作流与混合模式始终有效管理工具移除,而自主与混合模式在任务完成上表现更优。基于任务准确率、代理能力和自主性,我们提出各模式的权衡与建议。

原文摘要 · Abstract (English)

Large Language Model (LLM) agents have shown significant autonomous capabilities in dynamically searching and incorporating relevant tools or Model Context Protocol (MCP) servers for individual queries. However, fixed context windows limit effectiveness in multi-turn interactions requiring repeated, independent tool usage. We introduce MemTool, a short-term memory framework enabling LLM agents to dynamically manage tools or MCP server contexts across multi-turn conversations. MemTool offers three agentic architectures: 1) Autonomous Agent Mode, granting full tool management autonomy, 2) Workflow Mode, providing deterministic control without autonomy, and 3) Hybrid Mode, combining autonomous and deterministic control. Evaluating each MemTool mode across 13+ LLMs on the ScaleMCP benchmark, we conducted experiments over 100 consecutive user interactions, measuring tool removal ratios (short-term memory efficiency) and task completion accuracy. In Autonomous Agent Mode, reasoning LLMs achieve high tool-removal efficiency (90-94% over a 3-window average), while medium-sized models exhibit significantly lower efficiency (0-60%). Workflow and Hybrid modes consistently manage tool removal effectively, whereas Autonomous and Hybrid modes excel at task completion. We present trade-offs and recommendations for each MemTool mode based on task accuracy, agency, and model capabilities.

大模型代理工具调用记忆管理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。