arXiv:2607.20709cs.AIcs.CL2026-07

用Python对象构建智能代理,让模型行为像代码一样可测试、可调试。

NVIDIA-labs OO Agents: Native Python Object-Oriented Agents

  • 代理即Python对象,方法是动作,字段是状态,文档字符串作提示。
  • 支持类型注解、运行时调用大模型、长期记忆等能力,接口统一易维护。
  • 适合开发可调试的复杂智能体,尤其对熟悉Python的工程师友好。

传统智能体开发分散在提示模板、工具定义、回调代码和工作流图中。我们提出NVIDIA面向对象代理(NOOA),一种与模型无关的Python框架,用于构建可靠的人工智能代理。NOOA采用更简洁的方法:代理就是一个Python对象。其方法是模型可执行的动作,字段是状态,文档字符串作为提示,类型注解则充当契约。方法体仅包含'...'的将在运行时由大模型驱动的代理循环完成,而具有正常体的方法保持标准确定性行为。这使得开发者与代理拥有相同的接口,因此代理行为可测试、可追踪、可重构和持续改进。本文有三项贡献:(1) 提出代理作为Python对象的编程模型及设计原则;利用现有Python抽象,通过直观的API暴露上下文、事件、状态渲染、长期记忆和验证的LLM循环等能力,使开发人员与代理共享同一编程范式。(2) 首次在同一界面整合六项面向模型的核心理念:类型化输入输出、基于引用传递活对象、代码即动作、可编程循环工程、显式对象状态、模型可调用的上下文与事件钩子。我们发现社区已在多个方向上逐步趋同,常以实验或部分功能形式出现,本文对比分析旨在推动采纳。(3) 实证表明当前模型能有效使用此接口,在针对性能力测试以及SWE-bench Verified、Terminal-Bench 2.0和ARC-AGI-3等代理与推理基准上表现良好。

原文摘要 · Abstract (English)

Traditional agent development is split across prompt templates, tool schemas, callback code, and workflow graphs. We present NVIDIA Object-Oriented Agents (NOOA), a model-agnostic Python framework for building reliable AI agents. NOOA takes a simpler approach: an agent is a Python object. Its methods are the actions the model can take, fields are its state, docstrings are its prompts, and its type annotations are contracts. A method whose code body consists of "..." is completed at runtime by an LLM-driven agent loop, while methods with normal bodies remain standard deterministic Python. This gives developers and agents the same interface, so agent behavior can be tested, traced, refactored, and improved just like other software. This paper makes three contributions. (1) We present the agent-as-a-Python-object programming model and the design principles behind it. Where Python has existing abstractions, we adopt them directly. Agent-specific capabilities--context, events, state rendering, long-term memory, and validated LLM loops--are exposed through simple Pythonic APIs, so both developers and agents share one familiar programming model. (2) We identify six model-facing ideas that NOOA is, to our knowledge, the first to combine on a single surface: typed input/output, pass-by-reference over live objects, code as action, programmable loop engineering, explicit object state, and model-callable harness APIs for context and events. We find the community already converging on several of these ideas--often as experimental or partial features--and present the comparison to encourage further adoption. (3) We demonstrate that current models use this interface effectively, both in targeted capability tests and on agentic and reasoning benchmarks such as SWE-bench Verified and Terminal-Bench 2.0 and ARC-AGI-3.

智能体Python框架大模型

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