LedgerAgent: 面向遵循策略的工具调用代理的结构化状态
LedgerAgent: Structured State for Policy-Adherent Tool-Calling Agents
June 18, 2026
作者: Md Nayem Uddin, Amir Saeidi, Eduardo Blanco, Chitta Baral
cs.AI
摘要
在客户服务领域中,遵循策略的工具调用智能体需要在轮次间维护任务状态,同时调用工具并遵守领域策略。任务状态由通过用户交互和工具调用观察到的事实、标识符、约束条件及状况构成。在标准智能体中,任务状态并未单独表示。观察结果、工具返回值及策略指令被放入提示词中,使得智能体在每次决定下一步操作时,需从提示词中重新构建相关状态。这种设计使状态管理隐式化,导致两种常见错误模式:智能体可能检索到正确的事实,但后续决策却基于过时、缺失或错误的信息;或者,一个语法正确的工具调用仍可能违反依赖于当前任务状态的领域策略。为此,我们提出LedgerAgent——一种面向工具调用智能体的推理时方法,它将观察到的任务状态单独维护在独立账本中,并将这些状态呈现到提示词中。该账本还用于在执行为环境带来变化的工具调用之前检查状态相关的策略约束,从而阻止策略违反行为。在四个客户服务领域以及由开源和闭源模型组成的混合评估面板中,与基于提示词的标准工具调用方法相比,LedgerAgent在平均passk指标上有所提升,且在更严格的多次尝试一致性指标下取得了最大增益。
English
Policy-adherent tool-calling agents in customer-service domains must maintain task states across turns while calling tools and obeying domain policies. Task states consist of relevant facts, identifiers, constraints, and conditions observed through user interaction and tool calls. In standard agents, task states are not represented separately. Observations, tool returns, and policy instructions are placed in the prompt, leaving agents to reconstruct the relevant states from the prompt each time they decide what to do next. This design makes state management implicit, creating two common failure modes. An agent may retrieve the right facts but later ground its decision in stale, missing, or incorrect information; and a syntactically valid tool call may still violate a domain policy that depends on the current task state. We introduce LedgerAgent, an inference-time method for tool-calling agents that maintains observed task states in a separate ledger and renders the states into the prompt. The ledger is also used to check state-dependent policy constraints before environment-changing tool calls are executed, blocking policy violations. Across four customer-service domains and a mixed panel of open- and closed-weight models, LedgerAgent improves average passk over a standard prompt-based tool-calling approach, with the largest gains under stricter multi-trial consistency metrics.