arXiv:2512.15813cs.SEcs.AI2025-12被引 2

用代码实现可复现的智能体,让任务执行更可靠

CodeMem: Architecting Reproducible Agents via Dynamic MCP and Procedural Memory

  • 用Python代码作为动作空间,支持复杂操作一步完成
  • 通过程序化记忆实现确定性执行,避免大模型随机性问题
  • 适合需要重复、稳定执行的任务场景,如自动化流程

当前工具调用型AI智能体存在动作空间有限、上下文效率低和概率不稳定性问题,难以胜任重复性任务。尽管CodeAct、DynaSaur等方法已通过使用完整Python语言作为动作空间,实现无限工具调用和上下文精简,但大模型的随机性仍导致相同任务可能产生不同执行路径。本文提出CodeMem架构,通过代码形式实现程序化记忆,构建可复用、确定性可靠的智能体工作流,显著提升任务执行的一致性和可重复性。

原文摘要 · Abstract (English)

Current tool-using AI agents suffer from limited action space, context inefficiency, and probabilistic instability that makes them unsuitable for handling repetitive tasks which are otherwise reliably and efficiently tackled by agentic workflows built on platforms like n8n and Zapier. Earlier works like CodeAct, DynaSaur, Code Mode have tried to tackle the first two issues by using the whole Python language as its action space: The number of tools that the agent can call becomes infinite. Python code blocks can execute complex actions into a single step and print only relevant results which helps in keeping the context lean. However, the probabilistic instability issue still remains, as for the same task in the same environment, the agent can follow different trajectories due to the probabilistic nature of LLMs. Therefore, we need procedural memory for consistency and reliability. This paper proposes CodeMem, an architecture to implement procedural memory via code which can be used to build and run reusable agentic workflows with deterministic reliability.

智能体程序记忆自动化可靠性

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