Agent Harnesses Evolve From Chains to Graphs and Code
InfoQ 中文 AI&大模型 examines three agent Harness paradigms: chained prompts, graph-based workflows, and code-driven execution. LinkedIn examples show how chains offer speed and low overhead, graphs add branching, retries, explicit state and validation, while code Harnesses use sandboxed execution, deterministic checks and iterative refinement to improve reliability and auditability. The article recommends choosing the simplest architecture that meets a task’s reliability, observability, latency and cost requirements.
The comparison provides practical guidance for production agent design, emphasizing verification, observability and controlled execution over unnecessary architectural complexity.

在过去几年里,基于大语言模型构建的智能体经历了翻天覆地的变化。最初只是用粘合代码拼凑起来的临时提示词,如今已逐渐演变为我们所说的智能体 Harness 框架,也叫结构化执行框架——它们围绕概率模型搭建起脚手架,让模型变得稳定、可观测,达到生产级水准。
这一演变并非一蹴而就,而是渐进式的,由真实业务场景不断增长的需求推动。在这条变革弧线上,先后出现了三种截然不同的范式,每一种都反映出人们对如何约束非确定性智能、并将其落地为可靠软件系统更深的理解。
链式范式:提示词编排
最初的智能体系统围绕简单的线性工作流构建,我们称之为“链”。这种方法直观、落地快,能够快速上线。你把一系列提示词串起来,第一步的输出作为第二步的输入,依此类推。Harness 框架不过是工具调用、对话记忆的粘合代码,最终把 LLM 当作一个黑盒函数来对待:文本进、文本出,外加一些语法糖。