跳到主内容
精选75Avi Chawla技巧与观点

Agent 循环的四种结构:回合、目标、定时与主动式

The four types of agent loops:

原文

The four types of agent loops:

智能体循环的四种类型:

Loop engineering keeps getting talked about as one thing, when it’s actually a choice between four structures, each is best suited a different kind of task.

循环工程一直被当作一回事来讨论,但实际上它是在四种结构之间做选择,每种结构分别最适合不同类型的任务。

It requires designing the system that steers the agent, instead of steering it by hand, move by move.

它要求设计出引导智能体的系统,而不是一步一步地手动引导它。

That system always answers two questions: what starts a run, and what decides the work is done.

这个系统始终要回答两个问题:什么启动一次运行,什么决定工作已完成。

In a hand-run session, the human answers both, every single time. Each loop type moves more of that into the system.

在手动运行的会话中,每次都由人来回答这两个问题。每种循环类型都会把其中更多部分移交给系统。

Here’s each type, what triggers it, and when you should consider using each:

以下是每种类型、触发条件,以及你应考虑在何时使用:

1) Turn-based loops, triggered by a user prompt.

1) 基于回合的循环,由用户提示触发。

The agent gathers context, acts, and checks its work inside a single turn. Then a human reviews the output and writes the next prompt.

智能体在单个回合内收集上下文、采取行动并检查自己的工作。然后由人审查输出并编写下一个提示。

Use this when requirements are still forming and every output changes what the next prompt should ask for.

当需求仍在形成中,且每次输出都会改变下一个提示应请求的内容时,使用这种循环。

2) Goal-based loops, triggered by a /goal command that carries success criteria and a budget, like “get the homepage Lighthouse score to 90, stop after 5 tries.”

2) 基于目标的循环,由携带成功标准和预算的 /goal 命令触发,例如“将首页 Lighthouse 分数提高到 90,尝试 5 次后停止”。

When the agent tries to stop, an evaluator model checks whether the goal is met, and it sends it back to work.

当智能体试图停止时,评估模型会检查目标是否达成,并让它回去继续工作。

Use this when the outcome is measurable but the path there doesn’t need human attention.

当结果可衡量,但达成结果的路径不需要人工关注时,使用这种循环。

3) Time-based loops, triggered by a clock.

3) 基于时间的循环,由时钟触发。

An interval fires, the agent runs a fixed prompt like “check the PR, fix CI,” then waits for the next tick. The /loop command runs on the local machine, and /schedule moves it to the cloud so it survives a closed laptop.

间隔触发时,智能体运行一个固定提示,如“检查 PR,修复 CI”,然后等待下一次触发。/loop 命令在本地机器上运行,/schedule 则把它移到云端,这样即使合上笔记本电脑也能继续运行。

Use this for recurring work where the task is known in advance and only the timing repeats.

对于任务事先已知、只有时间安排重复出现的周期性工作,使用这种循环。

4) Proactive loops, triggered by an event or schedule with no human present.

4) 主动循环,由事件或计划触发,无需人在场。

A routine watches a channel and spawns a workflow when something needs handling. That workflow runs a triage agent, a fix agent, and a reviewer who adversarially judges the work before the task closes.

一个例程监视某个渠道,当有事情需要处理时生成一个工作流。该工作流运行一个分诊智能体、一个修复智能体,以及一个在任务关闭前对抗性评判工作的审查者。

Use this for standing responsibilities where nobody can predict what will come in, only that something will.

对于长期职责,即没人能预测会进来什么、只知道一定会有事情进来的情况,使用这种循环。

Each type hands off one more job than the last. - Turn-based keeps both jobs with the human - Goal-based automates the checking - Time-based automates the trigger - And proactive automates both while deciding the workflow shape at runtime.

每种类型都比前一种多移交一项工作。 - 基于回合的循环把两项工作都留给人类 - 基于目标的循环自动化检查 - 基于时间的循环自动化触发 - 主动循环则把两者都自动化,并在运行时决定工作流的形态。

So the mapping question isn’t which loop is most advanced but rather whether the task is exploratory, measurable, recurring, or standing.

因此,映射问题不是哪种循环最先进,而是任务属于探索性、可衡量、周期性还是长期性。

The more you hand off, the less you monitor yourself.

你移交得越多,需要亲自监控的就越少。

To dive deeper, there's an article by my co-founder that covers the full breakdown on loop engineering.

若要深入了解,我的联合创始人有一篇文章,全面介绍了循环工程的详细分解。

Read it below.

请阅读下文。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近