让AI代理学会复盘,提升任务执行的可靠性与效率。
Get Experience from Practice: LLM Agents with Record & Replay
- 记录代理执行过程,提炼成可复用的结构化经验
- 通过复用历史经验,减少重复计算并提高成功率
- 适合需要安全、低成本部署的复杂任务场景
AI代理依托大语言模型(LLMs)及MCP、A2A等通信协议,已从简单聊天机器人发展为能执行多步骤复杂任务的自主实体,潜力巨大。然而,LLMs固有的不确定性与高算力需求带来了可靠性、隐私、成本与性能四大挑战。现有方法如模型对齐、工作流约束和本地部署虽部分缓解问题,但难以根本解决。本文提出新范式AgentRR(Record & Replay),将经典回放机制引入代理框架:1. 记录代理在任务执行中与环境的交互及内部决策过程;2. 将该过程总结为包含流程与约束的结构化“经验”;3. 在后续相似任务中复用这些经验以指导行为。我们设计了多层次经验抽象方法与校验函数机制,前者平衡经验的特异性与泛化性,后者作为信任锚点确保回放的完整与安全。此外,探索了用户录制示范、大小模型协作、隐私敏感执行等多种应用模式,并构想构建经验库以共享知识、降低部署成本。
原文摘要 · Abstract (English)
AI agents, empowered by Large Language Models (LLMs) and communication protocols such as MCP and A2A, have rapidly evolved from simple chatbots to autonomous entities capable of executing complex, multi-step tasks, demonstrating great potential. However, the LLMs' inherent uncertainty and heavy computational resource requirements pose four significant challenges to the development of safe and efficient agents: reliability, privacy, cost and performance. Existing approaches, like model alignment, workflow constraints and on-device model deployment, can partially alleviate some issues but often with limitations, failing to fundamentally resolve these challenges. This paper proposes a new paradigm called AgentRR (Agent Record & Replay), which introduces the classical record-and-replay mechanism into AI agent frameworks. The core idea is to: 1. Record an agent's interaction trace with its environment and internal decision process during task execution, 2. Summarize this trace into a structured "experience" encapsulating the workflow and constraints, and 3. Replay these experiences in subsequent similar tasks to guide the agent's behavior. We detail a multi-level experience abstraction method and a check function mechanism in AgentRR: the former balances experience specificity and generality, while the latter serves as a trust anchor to ensure completeness and safety during replay. In addition, we explore multiple application modes of AgentRR, including user-recorded task demonstration, large-small model collaboration and privacy-aware agent execution, and envision an experience repository for sharing and reusing knowledge to further reduce deployment cost.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。