arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2409.16120cs.SEcs.AIcs.CL
收藏

MOSS:为AI智能体赋能代码驱动演化与上下文管理

MOSS: Enabling Code-Driven Evolution and Context Management for AI Agents

Beihang University(北京航空航天大学)

Ming Zhu, Yi Zhou

AI总结:

针对LLM智能体代码生成脱离运行时上下文及多轮交互变量隔离等难题,提出MOSS框架,通过集成动态上下文管理与控制反转容器,实现代码与上下文一致性,提升智能体开发效率与自适应演化能力。

摘要:

开发由大型语言模型(LLMs)驱动的AI智能体在实现真正的图灵完备性和自适应的代码驱动演化方面面临重大挑战。当前的方法通常独立于运行时上下文生成代码,严重依赖LLM的记忆,这导致了低效并限制了适应性。在沙盒环境中手动开发协议进一步限制了智能体的自主适应性。关键在于,在多轮交互中实现代码和上下文的一致性,并确保每次交互内局部变量的隔离,仍然是一个未解决的问题。我们引入了MOSS(llM-oriented Operating System Simulation,面向LLM的操作系统模拟),这是一个新颖的框架,通过将代码生成与动态上下文管理系统集成来解决这些挑战。MOSS通过使用一种在交互间维护Python上下文的机制来确保一致性和适应性,包括局部变量的隔离和运行时完整性的保持。该框架的核心是采用控制反转容器并结合装饰器来强制执行最少知识原则,允许智能体专注于抽象接口而非具体实现。这促进了新工具和库的无缝集成,实现了运行时实例替换,并降低了提示复杂度,为智能体提供了一个“所见即所得”的环境。通过一系列案例研究,我们展示了该框架如何提升智能体开发的效率和能力,并突出了其在迈向能够通过代码演化的图灵完备智能体方面的优势。

英文摘要:

Developing AI agents powered by large language models (LLMs) faces significant challenges in achieving true Turing completeness and adaptive, code-driven evolution. Current approaches often generate code independently of its runtime context, relying heavily on the LLM's memory, which results in inefficiencies and limits adaptability. Manual protocol development in sandbox environments further constrains the agent's autonomous adaptability. Crucially, achieving consistency in code and context across multi-turn interactions and ensuring isolation of local variables within each interaction remains an unsolved problem. We introduce MOSS (llM-oriented Operating System Simulation), a novel framework that addresses these challenges by integrating code generation with a dynamic context management system. MOSS ensures consistency and adaptability by using a mechanism that maintains the Python context across interactions, including isolation of local variables and preservation of runtime integrity. At its core, the framework employs an Inversion of Control (IoC) container in conjunction with decorators to enforce the least knowledge principle, allowing agents to focus on abstract interfaces rather than concrete implementations. This facilitates seamless integration of new tools and libraries, enables runtime instance replacement, and reduces prompt complexity, providing a "what you see is what you get" environment for the agent. Through a series of case studies, we show how this framework can enhance the efficiency and capabilities of agent development and highlight its advantages in moving towards Turing-complete agents capable of evolving through code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑