FAOPs:AI智能体工作流的范式与代数
FAOPs: Normal Forms and an Algebra for AI Agent Workflows
AI总结:
本文提出FAOP理论,将AI智能体工作流转化为类型化函数并施加四个递进范式,通过FAOP代数实现编译时保障,在SkillBase中实现该理论并以金融工作流示例验证。
摘要:
各机构正日益将操作流程编码为多步骤智能体技能,本文称之为智能体操作流程(Agent Operating Procedures, AOPs),这类流程必须具备可追溯性、可审计性、可复现性、访问控制性,且受时间与成本约束,这些是受监管行业的强制性要求。然而,AOPs通常以粗粒度文件形式存在,其中步骤捆绑操作、复制的流程会逐渐偏离、任意步骤可访问任意工具,且重构未受管控。我们提出功能型智能体操作流程(Functional Agent Operating Procedures, FAOP),这一形式化理论为AI智能体工作流带来数据库级别的规范。FAOP将每个工作流重新定义为作用域状态上的类型化函数,并对整个流程库施加四个递进范式:分解范式(FNF-1)将工作流拆分为原子步骤;类型化范式(FNF-2)使数据流明确且经过类型检查;因式分解范式(FNF-3)为每个共享流程提供单一规范定义,确保变更可传播而非偏离;作用域范式(FNF-4)将每个步骤限制为最小权限的工具访问权限。规范化后,每个原子步骤成为带有声明契约的独立实体,可单独进行类型检查、作用域限制、约束、测试、追溯与审计。FAOP代数包含可证正确的等式,将重构与并行化转化为编译器重写;正交扩展添加了已验证终止(+V)、优化(+O)以及时间与成本约束(+B);架构级分类器(0-3)可确定工作流是否需要AI。这些措施使完整性、隔离性、类型化、终止性、成本与优化成为整个流程库的编译时关注点,而非运行时的期望。我们在SkillBase中实现了该理论,SkillBase是一个AOP管理系统(类比PostgreSQL之于数据,SkillBase之于AOPs),同时配备独立执行器在运行时强制执行这些保障措施。一个已完成的金融工作流示例展示了该方法的端到端应用。
英文摘要:
Organizations increasingly encode operational procedures as multi-step agent skills, here called Agent Operating Procedures (AOPs), that must be traceable, auditable, reproducible, access-controlled, and bounded in time and cost, as regulated sectors require. Yet AOPs are typically kept as coarse-grained files, in which steps bundle actions, copied procedures drift apart, any step may reach any tool, and refactoring goes unchecked. We present Functional Agent Operating Procedures (FAOP), a formal theory that brings database-grade discipline to AI agent workflows. FAOP recasts each workflow as a typed function over scoped state and subjects an entire library to four progressive normal forms: Decomposed (FNF-1) splits a workflow into atomic steps, Typed (FNF-2) makes its data flow explicit and type-checked, Factored (FNF-3) gives each shared sub-workflow a single canonical definition so a change propagates instead of drifting, and Scoped (FNF-4) checks that each FAOP lists resources used by its own actions and the FAOPs it calls, while guardrails declared by it and by FAOPs that call it remain attached to their sources. A FAOP algebra of provably sound equalities turns refactoring and parallelization into compiler rewrites; orthogonal extensions add optimization (+O), bounded completion with time and cost limits (+B), and reachability checks (+R); and an architectural-level classifier (0-3) determines whether a workflow needs AI at all. Together, these make integrity, isolation, typing, stopping limits, cost, and optimization compile-time concerns across the whole library, not runtime hopes. We implement the theory in SkillBase, an AOP management system (what PostgreSQL is to data, SkillBase is to AOPs), and a separate executor that loads FAOPs from SkillBase and enforces these guarantees at run time. A worked financial workflow illustrates the approach end to end.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。