arXiv:2605.12239cs.PLcs.AI2026-05

用范畴论统一建模大模型智能体的工程架构,实现可验证的系统设计。

Harness Engineering as Categorical Architecture

  • 基于范畴三元组(G, Know, Phi)形式化智能体架构,明确各组件的数学对应关系。
  • 编译器通过结构重演保证完整性、质量提升等三类证书在不同框架间一致。
  • 适用于需要可验证、可复现的智能体系统设计者,尤其适合多框架集成场景。

智能体马具(harness)——即围绕模型的提示、工具、记忆和编排逻辑系统层——已成为大模型智能体的核心工程抽象。然而,马具设计仍属非正式实践,缺乏关于组合性、编译后属性保持及跨框架系统比较的形式化理论。本文表明,ArchAgents框架中的范畴架构三元组 (G, Know, Phi) 正是这一形式化。智能体外部化的四大支柱(记忆、技能、协议、马具工程)分别对应三元组的组成部分:记忆为共代数状态,技能为操作符复合对象,协议为语法连接 G,完整马具即架构本身。结构保障(如完整性门控、基于质量的升级、支持的收敛检查)作为 Know 层级证书,其保持依赖于结构重演:我们的编译器仅检查身份与验证器重演,而非输出层正确性或模型行为。通过一个参考实现,针对 Swarms、DeerFlow、Ralph、Scion 与 LangGraph 的编译器函子验证了该对应关系:四个配置编译器通过身份或重演保留三种命名证书;而 LangGraph 编译器则通过共享阶段执行路径保持相同证书。该编译器为每个阶段创建单一节点,复用原生运行时的阶段方法,实现原生可观测性且无需重写马具逻辑。一项端到端升级实验使用真实大模型智能体证实,在双模型单任务设置下,质量导向的升级控制路径具有模型参数敏感性。结果确立了范畴架构作为马具工程的形式理论基础。

原文摘要 · Abstract (English)

The agent harness, the system layer comprising prompts, tools, memory, and orchestration logic that surrounds the model, has emerged as the central engineering abstraction for LLMbased agents. Yet harness design remains ad hoc, with no formal theory governing composition, preservation of properties under compilation, or systematic comparison across frameworks. We show that the categorical Architecture triple (G, Know, Phi) from the ArchAgents framework provides exactly this formalization. The four pillars of agent externalization (Memory, Skills, Protocols, Harness Engineering) map onto the triple's components: Memory as coalgebraic state, Skills as operad-composed objects, Protocols as syntactic wiring G, and the full Harness as the Architecture itself. Structural guarantees-integrity gates, quality-based escalation, supported convergence checks-are Know-level certificates whose preservation is structural replay: our compiler checks identity and verifier replay, not output-layer correctness or model behavior. We validate this correspondence with a reference implementation featuring compiler functors targeting Swarms, DeerFlow, Ralph, Scion, and LangGraph: the four configuration compilers preserve three named certificate types by identity or replay, and LangGraph preserves the same certificates through its shared per-stage execution path. The LangGraph compiler creates one node per stage using the same per-stage method as the native runtime, providing LangGraph-native observability without reimplementing harness logic. An end-to-end escalation experiment with real LLM agents confirms that the quality-based escalation control path is model-parametric in this two-model, one-task experiment. The result positions categorical architecture as the formal theory behind harness engineering.

大模型智能体范畴论系统架构可验证设计

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