Anthropic 刚刚修复了图工程的最大缺陷
Original · Anthropic Just Fixed Graph Engineering's Greatest Flaw
Key Takeaway
构建稳健图工程的关键在于避免低成本模型误报引起的链式错误,并利用主控编排技能调度指定 Opus 模型的多维度隔离验证节点。
Highlights
图结构通过多 Agent 并列运行提升处理速度,但 Token 消耗量大幅增加,无法依赖 monthly 20 美元的 AI 基础套餐。
图工程由节点(隔离上下文的子任务 Agent)与边(控制数据流向与传递时机的连接)构成。
审查节点使用 Haiku 等低成本模型会产生大量误报,导致后续节点浪费资源修复无缺陷的代码,把关环节必须使用 Opus 模型。
通过 `-p` 参数启动独立 Claude Code 会话运行 Second Opinion 技能,能够排除历史上下文干扰并提供客观的第三方审查。
采用 Chrome Headless Shell 替代完整版 Chrome 进行自动化 UI 截图检查,可大幅节省系统内存与渲染时间。
编排技能(Orchestrator skill)通过单一入口为主控流程并行调度多维度审查 Agent,并将结果汇总为统一报告交由修复 Agent 处理。
Timeline
循环工程与图工程的性能与成本权衡
循环工程要求 Agent 在单条时间线上边做边调整,即使步骤之间没有依赖关系也必须依次等待。图工程改用并行架构,将大任务解构为独立节点并分发给不同 Agent 处理。这种模式允许针对简单任务使用低成本模型,从而降低单个子任务的费用,但整体并行并发会成倍增加 Token 使用量。
- 循环工程采用单线串行模式,各个步骤必须无条件等待前一步骤完成。
- 图工程将主任务拆分为子任务分发给并行 Agent,大幅提升执行效率。
- 图结构支持按子任务挑选合适模型,但多 Agent 同时运行会导致 Token 消耗极快。
图工程的核心构成与典型架构形态
每个图结构均依赖节点与边协同工作。节点代表在独立上下文窗口中运行的 Agent,边决定数据从一个节点流向下一个节点的时机与路径。菱形结构适合多视角分析后的成果汇总,而屏障扇入图(Fan-in at a Barrier)则在扇出分发任务后设置拦截屏障,确保所有评估同步完成后再统一展开代码修复。
- 图的基本单元由负责执行隔离子任务的节点和控制数据流向的边组成。
- 菱形图通过顶层拆分、并行执行与底层汇总整合最终答案。
- 屏障扇入图要求所有审查 Agent 全部完成汇报后才统一触发修复步骤。
图结构的错误放大风险与模型选择机制
多 Agent 并行推进会导致错误在复杂依赖网络中迅速扩散,使人工审查变得极其困难。使用 Haiku 等低价模型做审查时,模型容易忽略上下文逻辑并将保留设计标记为缺陷,导致后续节点浪费大量 Token 修复正常功能。将把关节点替换为 Opus 模型能够有效识别潜在逻辑,大幅降低误报率。
- 图结构运行产生海量并发输出,极易引发定位困难的黑盒化排查危机。
- 低估审查节点的智商要求会导致大量误报,引发无意义的链式修复消耗。
- 在 `Claude.md` 中预设项目运行指令可省去 Agent 重复猜解配置的开销。
验证技能的三种类型与轻量化渲染优化
验证技能根据触发机制划分为独立技能与嵌入式技能。独立技能需要手动调用,专门针对成熟成果展开全面排查;嵌入式技能直接织入日常工作流,在代码提交时自动运行规则比对。对于需要 UI 截图的视觉验证,使用 Chrome Headless Shell 替代传统浏览器能显着降低内存开销并加快执行节奏。
- 独立技能适用于开发完成后的全局深度复盘,避免在中途频繁触发造成浪费。
- 嵌入式技能在功能实现过程中自动校验规则,未通过检查前禁止结束任务。
- Chrome Headless Shell 剥离了非必要组件,能大幅提升自动化视觉检查的运行速度。
上下文隔离交叉验证与主控技能编排
编写代码的 Agent 自带思维定势,无法进行客观审查。通过 `-p` 标志在后台建立完全独立的 Opus 会话运行 Second Opinion 技能,可以在无上下文偏见的前提下提供客观评估。为了防止指令过载,应为代码审查、设计比对和代码简化分别建立专有技能,并由一个主控编排技能统一分发任务与汇总修复报告。
- 启动带有 `-p` 参数的独立 Claude 会话能消除历史上下文对审查结果的干扰。
- 针对代码、设计与简化等不同维度构建单一职责技能比混合编写效果更好。
- 主控编排技能统一调度多个审查 Agent 并生成一份综合报告交由修复 Agent 统一处理。
Description
Graph engineering, the upgrade to loop engineering for AI agents. Get started with SerpApi using 250 free credits: https://serpapi.com/?utm_source=youtube&utm_campaign=ailabs_july_2026 Graph engineering runs one task across many AI agents at once instead of one loop. Not the knowledge graph kind. Loop engineering built agent loops that go in a straight line, graphs go wide, and here's Anthropic's fix for when one broken node ruins the whole output. Community with All Resources: http://ailabspro.io The Roundup, our daily newsletter covering the AI stories that matter. Join now: https://www.theroundup.so/ If you've been asking what is loop engineering, we start there. A loop is a working cycle you hand to the agent. You give it the end goal instead of prompting every step, and it gets there on its own, adjusting as it goes. That's loop engineering, and it's what most people are still running. The problem is the shape of it. A loop does a piece of work, verifies it, then moves to the next step. Everything runs in a straight line, so every step waits on the one before it even when the two have nothing to do with each other. Graph engineering fixes that. Instead of a straight line, a graph splits the main task into smaller parts and gives each part its own agent. You get speed, because several agents cover the work at once, and you get some cost control per agent, because you pick which model each node runs on and stop burning your most expensive model on the parts that never needed it. A fair warning though: a graph burns far more tokens overall than a single agent. On API pricing, don't run graphs at all. On a subscription plan, expect your limits to arrive much sooner than you're used to. This video was sponsored by SerpApi We cover what a graph is actually made of, nodes and edges, and the shapes those pieces get arranged into. That includes the diamond (fan out to sub-agents, then narrow back into one agent that pulls everything into a single answer) and the fan in at a barrier shape, where the same problem goes out to several agents each looking through a different lens, and nothing moves forward until all of them report back. If you've used dynamic workflows in Claude Code, you've already run a graph without calling it one. Then the part that actually decides whether your graph works: verification. One error in a small node disturbs the entire output that comes back, and it's hard to trace because all you get at the end is the finished result. That's the exact problem Anthropic's article addresses, and this ai graph engineering breakdown walks through their fix. We go over the built-in options in Claude Code, including the Verify skill, tool chaining, code review skills, and hooking checks into GitHub Actions, and why the verification that works best is the one you build yourself. Most of the video is spent building that. We use the Skill Creator plugin to build a verification skill, and cover the three kinds: standalone skills you run yourself for a deep pass on finished work, embedded skills that fire automatically as part of the workflow, and chains of skills with an orchestrator sitting above them. We also show a real result from our own community website build. Running the reviewer on Haiku returned a long list of issues, and Opus flagged far fewer, but the Haiku findings were mostly things we'd left there on purpose. Inside a graph, that's agents burning tokens fixing things that were never broken. The node that does the judging is the one place where saving tokens costs you everything. Also covered: the Second Opinion skill and why the agent that built the thing is the worst one to review it, using the -p flag to launch a fresh Claude session with none of the original context, Chrome Headless Shell for fast visual verification instead of a full browser, and how Anthropic's own team chains Code Review, Simplify, Verify, and a design skill together for a review coming from four directions. Anthropic graph engineering is the current frame, but the underlying loop engineering workflow ideas are tool-agnostic. We demo everything in Claude Code, so this doubles as a loop engineering Claude Code walkthrough, but the graph structure itself applies to any agent you run, whether that's loop engineering Codex, a custom setup, or anything else. If you came here for ai loop engineering and want the deeper setups, we have a full video on loop engineering on the channel. All the skills shown in this video are available in AI Labs Pro, our community. If you've found value in what we do and want to support the channel, that's the best way to do it. Hashtags: #ai #aiagents #loopengineering #aitutorial #graphengineering #claudecode #codex
