读见

何时该为 AI 智能体自建 Harness

原题When to Build Your Own Agent Harness | Harrison Chase, LangChain

约 2 分钟原文英文

视频由 YouTube 提供

看前速览

5 个要点

Harrison Chase 解释了何时应从通用智能体 harness 转向定制方案,并将这一决策与上下文编排、私有评测、可观察性和轨迹驱动的改进闭环联系起来。

  1. 将 harness 定义为智能体的编排层

    harness 决定哪些固定和动态上下文在何时进入模型,协调模型与工具调用,并把外部观测结果送回智能体循环的下一步。

  2. 先用通用方案,只在必要处定制

    现成 harness 能缩短熟悉任务的价值实现时间;当任务偏离训练分布或需要更强控制时,中间件或定制架构才更有必要。

  3. 用私有评测沉淀组织判断

    私有评测把组织对「好」的定义显式化,为判断模型、上下文或编排的改动是否真正改善结果提供长期基准。

  4. 让上下文组装和执行轨迹可观察

    检查上下文、执行步骤和工具调用,能帮助团队判断失败来自模型行为、信息缺失,还是本可避免的 harness 决策。

  5. 运行从轨迹到实验的改进飞轮

    采集轨迹、整理证据、获取反馈并开展实验,能把智能体运行转化为持续改进 harness、模型或上下文的严谨闭环。

完整摘要

LangChain 联合创始人 Harrison Chase 将智能体 harness 定义为围绕模型、固定与动态上下文、工具调用和外部系统观测结果的编排层。他给出的建议是渐进式的:先用能力足够的通用 harness 快速获得价值;当工作越来越偏离模型训练分布,或需要更强的控制力时,再引入中间件、hooks、skills、文件系统、记忆、沙箱或更明确的架构。他认为评测和可观察性不是事后补充,而是必要前提。私有评测把组织对「好」的判断明确下来,轨迹则揭示失败究竟来自模型、上下文缺失、工具使用还是编排方式。Harbor 与 LangSmith Engine 展示了一条可重复的闭环:运行智能体,采集并整理轨迹,识别模式,开展实验,再依据证据改进 harness、模型或上下文。

文字稿

When to Build Your Own Agent Harness

Harrison Chase argues that an agent is more than a model: it combines a model, the context available to it, and a harness that orchestrates both. The harness decides what context reaches the model, when it arrives, how tools are invoked, and how observations return to the next step of the loop.

For many teams, the practical starting point is a general-purpose, off-the-shelf harness. It offers quicker time to value while models are operating on familiar tasks. As a use case moves further out of distribution, teams can introduce middleware, hooks, tool handling, summarization, memory, sandboxes, sub-agents, or more explicit cognitive architectures. The goal is not to replace the agent loop, but to customize it at the points that matter for a domain.

Chase pairs harness engineering with evaluation and observability. Private evaluations establish what good looks like; traces, feedback, decisions, and institutional context create the raw material for a continuous learning loop. Benchmark runners such as Harbor make it possible to compare models, harnesses, reasoning effort, accuracy, latency, and cost across sandboxed tasks.

Observability is essential because an agent failure may result from the model, but often from insufficient or poorly accumulated context. Teams should make trajectories, tool calls, and context assembly inspectable, collect feedback from product UX and online evaluators, curate trace data, then run experiments. The resulting flywheel is simple in outline: run the agent, collect traces, find patterns, and fix the system.

LangSmith Engine is offered as an example of automating that loop. It examines trace data, creates issue boards, links evidence, and proposes changes to prompts, context, and harness code. In the closing discussion, Chase recommends beginning with standard harnesses such as Deep Agents, Codex, or Claude Code, then moving toward custom designs when a domain needs greater specialization, predictability, or control.

值得记下

harness 的主要工作,是在恰当的时点把上下文带给模型。
先从通用 harness 开始。这是最容易起步的方式,也能最快获得价值。
建立你的私有评测,因为评测定义了组织内部何为优秀。
你构建一个智能体并开始运行,收集大量轨迹,整理这些轨迹数据,再围绕它们开展实验。
任务越偏离训练分布,你就越需要定制 harness。