The Agent Loop Architecture
本文提出AI代理系统的核心架构分为循环、技能和编排器三层,强调持久执行与可观测性对于构建可靠、可演进的代理系统至关重要。

Everyone’s asking “WTF is a loop?” Here’s the question nobody’s asking: what runs the loop?
每个人都在问“WTF 是循环?”这是没人问的问题:什么在运行循环?
The AI discourse has converged on loops as a core primitive of agentic systems. Matt Van Horn (@mvanhorn) traced the lineage of agent loops from ReAct to tool-use to orchestration loops to loops supervising loops. Addy Osmani (@addyosmani) broke down the building blocks inside loops: automations, worktrees, skills, connectors, sub-agents. Van Horn landed on durability, arguing that loops which can’t survive a restart aren’t loops. Osmani’s key thread was orchestration: design the system that prompts the agent instead of you.
AI领域的讨论已达成共识,将循环视为智能体系统的核心原语。Matt Van Horn(@mvanhorn)梳理了从ReAct到工具使用、编排循环、再到循环监督循环的智能体循环发展脉络(lineage of agent loops)。Addy Osmani(@addyosmani)剖析了循环内部的构建模块(building blocks inside loops):自动化、工作树、技能、连接器、子智能体。Van Horn落脚于持久性,认为无法在重启后存续的循环就不是循环。Osmani的关键主线是编排:设计系统来提示智能体,而非由你来提示。
I want to take their points further. Durability isn’t just a property of the loop. It’s the entire execution layer underneath it. The important fact is that durable orchestration is fundamental to building your agent loop architecture. Let’s break down that architecture.
我想进一步探讨他们的观点。持久性不仅是循环的一个属性,更是其底层的整个执行层。关键在于,持久化编排是构建智能体循环架构的基础。下面我们来拆解这个架构。
Where loops break
循环中断的位置
The /loop and /goal patterns handle single-agent, single-session work well. An agent loops until a task is done. That covers a lot of ground. But the next stage (Stage 5 in Van Horn’s framing) is where it falls apart:
/loop 和 /goal 模式能很好地处理单智能体、单会话场景。智能体不断循环直到任务完成——这覆盖了相当广泛的应用场景。但到了下一阶段(按 Van Horn 的框架划分,即第 5 阶段),这套模式就会失效。
- Loops supervising other loops
- Loops running on schedules, not just triggered by a human
- Loops that survive process restarts, deploys, and crashes
- Loops that spawn sub-agents and wait for results (sometimes hours later)
- Loops that need to be observable after the fact
- 监督其他循环的循环
- 按计划运行(而非仅由人工触发)的循环
- 能经受进程重启、部署和崩溃的循环
- 生成子代理并等待结果(有时需等待数小时)的循环
- 需要事后可观察的循环
That’s not a prompting problem. That’s an infrastructure problem.
这不是提示问题,而是基础设施问题。
Van Horn cites @runes_leo: “The costliest thing in AI coding is no longer writing code, it’s managing the agent loop.” A while True in a terminal doesn’t give you any of this. Neither does a long-running process on a VM or sandbox.
Van Horn 引用 @runes_leo 的话:“AI 编程中最昂贵的环节不再是写代码,而是管理 agent 循环。”终端里的一个 while True 不会给你带来任何这些。虚拟机或沙盒上的长时间运行进程也不会。
Think about what happens when you run an agent loop on a server. The process will die or restarts. A deploy, an OOM, a spot instance reclamation. The loop restarts. But what was it doing? Which step was it on? Did it already send that Slack message? Did it already invoke the sub-agent?
考虑一下在服务器上运行一个智能体循环时会发生什么。进程会死亡或重启。一次部署、一次OOM、一次竞价实例回收。循环重启。但它当时在做什么?它执行到哪一步了?它是否已经发送了那条Slack消息?它是否已经调用了子智能体?
You don’t know. It starts over. Re-fetches data it already had. Re-calls the LLM for decisions it already made. Sends a duplicate notification. Spawns a duplicate sub-agent. You wake up to three identical Slack messages and a confused team.
你不知道。它又从头开始。重新获取已有的数据。重复调用LLM去处理已经做过的决策。发送重复的通知。生成重复的子代理。当你醒来时,看到三条一模一样的Slack消息,整个团队都懵了。
The fix isn’t “better error handling” — it’s an execution model where each step is checkpointed, each decision is persisted, and recovery means resuming from the last successful step.
修复方案不是“更好的错误处理”——而是一种执行模型:每一步都设置检查点,每个决策都被持久化,恢复意味着从最后成功的一步继续。
The agent loop architecture in three layers
代理循环架构的三层结构
Three layers. Each one maps to a concrete primitive.
三层。每一层都映射到一个具体的原语。
Layer 1: The Loop
第1层:循环
A loop is a cron plus a decision-maker. It runs on a schedule (or a trigger), evaluates state, and decides what to do next.
循环是一个cron加上一个决策器。它按计划(或触发条件)运行,评估状态,并决定下一步做什么。
This is Van Horn’s definition made concrete: what cron never had is the decision in the middle. The agent decides, not you. The cron is the heartbeat. The LLM is the decision-maker. Steps are the durable execution that checkpoint progress.
这是Van Horn的具体化定义:cron从未拥有的,是中间的决策过程。由代理来做决定,而不是你。cron是心跳,LLM是决策者,Steps则是持久化执行中留下检查点的进度记录。
export const infraHealthCheck = inngest.createFunction(
{ id: "infra-health-check" },
{ cron: "*/30 * * * *" }, // Every 30 minutes
async ({ step }) => {
const metrics = await step.run("fetch-service-metrics", async () => {
return await fetchServiceMetrics(); // error rates, latency, memory, CPU
});
const assessment = await step.run("assess-health", async () => {
return await callLLM({
prompt: \`Given these service metrics, classify overall system health
as "normal", "degraded", or "critical". Explain your reasoning.
Metrics: ${JSON.stringify(metrics)}\`,
});
});
if (assessment.status === "degraded" || assessment.status === "critical") {
await step.invoke("triage-incident", {
function: incidentTriage,
data: { metrics, assessment, services: assessment.affectedServices },
});
}
}
);
Every Monday at 9am, the loop fires. It fetches data, asks the LLM whether a report is warranted, and invokes a skill if yes. If the process restarts between steps, the already-completed steps don’t re-execute. That’s the loop. Not the LLM, the loop around the LLM.
每周一上午9点,循环触发。它会获取数据,询问LLM是否需要生成报告,如果需要则调用一个技能。如果在步骤之间重新启动进程,已完成的步骤不会重新执行。这就是循环。不是LLM,而是围绕LLM的循环。
Layer 2: The Skill
第二层:技能
In this context, a skill is not a prompt. It’s a durable workflow. Multi-step, retryable, composable, independently deployable.
在这个上下文中,技能不是提示词。它是一个持久工作流。多步骤、可重试、可组合、可独立部署。
Van Horn: “The loop is plumbing. The asset is the skill it calls.” This is the part that compounds. Each new skill the system learns makes every loop more capable.
Van Horn: “循环是管道。资产是它所呼唤的技能。” 这就是复利的部分。系统每学会一项新技能,都会让每个循环变得更强大。
export const incidentTriage = inngest.createFunction(
{ id: "incident-triage", retries: 3 },
{ event: "infra.incident.triage" },
async ({ event, step }) => {
const details = await step.run("fetch-detailed-metrics", async () => {
return await fetchDetailedMetrics({ services: event.data.services });
});
const deploys = await step.run("fetch-deploy-history", async () => {
return await fetchRecentDeploys({ since: hoursAgo(2) });
});
const analysis = await step.run("correlate-incident", async () => {
return await callLLM({
prompt: \`Correlate these service metrics with recent deploys.
Identify the likely root cause and severity.
Metrics: ${JSON.stringify(details)}
Recent deploys: ${JSON.stringify(deploys)}\`,
});
});
await step.run("post-triage-summary", async () => {
await slack.postMessage({
channel: "#incidents",
text: formatTriageSummary({
analysis,
affectedServices: event.data.services,
recommendedActions: analysis.recommendations,
}),
});
});
return analysis;
}
);
This skill fetches, classifies, and routes. It’s a unit of work with built-in fault tolerance. The skill can be an AI workflow with an LLM in the middle or deterministic code.
这项技能能够获取、分类和路由。它是一个具有内置容错能力的工作单元。该技能可以是一个中间带有LLM的AI工作流,也可以是确定性代码。
Layer 3: The Orchestrator
第三层:编排器
The orchestrator is the engine that runs everything: schedules crons, executes steps, manages retries, enforces concurrency limits, stores run history, and hot-deploys new functions/workflows without disrupting running ones.
编排器是运行一切的引擎:调度定时任务、执行步骤、管理重试、实施并发限制、存储运行历史,以及热部署新函数/工作流而不中断正在运行的任务。
This is the layer nobody talks about because it’s supposed to be invisible. But it’s foundational.
这是没人谈论的层面,因为它本应是看不见的。但它是基础性的。
Most people think about agents as “LLM + tools.” The agent loop architecture re-frames this as agents are “loops + skills + orchestration.” The LLM + tools are inside the loops. LLMs and tools can be swapped or tweaked while the architecture remains. The orchestration enables the architecture.
大多数人把智能体理解为”大语言模型 + 工具”。而智能体循环架构则重新定义了智能体,将其看作”循环 + 技能 + 编排”。大语言模型和工具是内嵌于循环之中的,它们可以被替换或调整,而架构本身保持不变。编排则让这种架构得以落地。
What happens when things break
当事情出问题时会发生什么
The happy path is easy. But this is software running in production, do things every really go according to plan?
快乐路径很容易。但这是运行在生产环境中的软件,事情真的总能按计划进行吗?
Your incident triage skill fires and the metrics API times out. The read had to go to disk and the in-memory cache didn’t have the data. The step calling this API now retries and hits the API again. The data is now partially cached and the API completes. The skill continues with the next step like nothing ever happened.
你的事件分级技能触发,而指标API超时了。读取操作不得不访问磁盘,内存缓存中没有所需数据。调用该API的步骤现在重试并再次访问API。数据此时已部分缓存,API成功完成。技能继续执行下一步,仿佛什么都没发生过。
Sometimes, it may not be as simple as that. What if an API key expires, or your hosting provider is down for 30 minutes. All of your retries are exhausted. Now what happens? You have to also handle failures.
有时候事情可能没那么简单。如果API密钥过期了,或者你的托管服务商宕机30分钟怎么办?所有重试次数都用完了。那接下来会发生什么?你还得处理失败情况。
export const incidentTriage = inngest.createFunction(
{
id: "incident-triage",
retries: 3,
onFailure: async ({ error, event, step }) => {
// The function failed after exhausting retries.
// We still have the original event data. Nothing is lost.
await step.run("notify-failure", async () => {
await slack.postMessage({
channel: "#agent-ops",
text: \`⚠️ Incident triage failed: ${error.message}. \` +
\`Will retry on next health check cycle. \` +
\`Affected services: ${event.data.services.join(", ")}\`,
});
});
},
},
{ event: "infra.incident.triage" },
async ({ event, step }) => {
/* the same logic as the skill above */
}
);
The `onFailure` handler fires after all retries are exhausted. It posts to an ops channel so someone knows. The event is preserved, nothing is lost. The next scheduled run picks up where the failed one couldn’t.
`onFailure` 处理程序在所有重试耗尽后触发。它会向运维频道发送消息,以便有人知晓。事件会被保留下来,不会丢失任何信息。下一次预定运行时,会从失败上次未能继续的地方继续执行。
Durable orchestration must give you step-level retries for transient errors and failure handling hooks for non-recoverable errors. Without this, things break (as they do), and you find out hours or days later.
持久编排必须提供步骤级重试机制以应对瞬时错误,以及针对不可恢复错误的故障处理钩子。若缺少这些,系统故障在所难免——而你却只能在数小时或数天后才得知。
Transient errors are also expensive. If your skill or agent retries from the beginning, you’re calling LLMs multiple times and burning tokens unnecessarily. The LLM call can be checkpointed. Now multiply this by 10, or 30, agents across your system. That’s expensive.
瞬时错误也很昂贵。如果你的技能或智能体从头开始重试,就会多次调用LLM,不必要地浪费令牌。LLM调用可以设置检查点。现在想象一下,你的系统里跑着10个甚至30个这样的智能体——那代价就高了。
Step-level checkpointing isn’t just a correctness feature. It’s a money saver.
逐级检查点功能不仅仅是为了确保正确性,还能节省成本。
The agent that builds its own skills
构建自身技能的智能体
This is where it gets more interesting. The system is not static, it is designed to evolve and extend itself.
这里就变得更有趣了。系统并非一成不变,而是被设计为可以自行演进和扩展。
The agent doesn’t just run inside loops — it authors new loops and registers them with the orchestration engine. Each deployed function is a durable skill that runs independently, triggerable from a loop or agent or running on a schedule, with its own retry logic. Skills compound.
代理不仅仅在循环内运行——它还创建新的循环并将其注册到编排引擎中。每个部署的函数都是一个持久化的技能,独立运行,可从循环、代理触发,或按计划运行,并带有自己的重试逻辑。技能不断累积。
It’s an orchestration-aware agent.
它是一个编排感知型代理。
Here’s how it works. An AI agent has access to the orchestration SDK as a tool. It can write new functions, register them with the engine, and they start running immediately. The agent process hot-reloads new functions without restarting or disrupting in-flight runs.
工作原理如下。AI 代理可以将编排 SDK 作为工具使用。它可以编写新函数,将其注册到引擎中,这些函数会立即开始运行。代理进程热加载新函数,无需重启或中断正在运行的任务。
Walk through a concrete example:
逐步讲解一个具体示例:
1. A human expresses a need. Engineer says: “Our services keep having latency spikes overnight and nobody notices until morning.” This is the trigger. The agent doesn’t need to infer a vague pattern from ambient data. It has clear instructions.
1. 人类表达需求。 工程师说:“我们的服务在夜间持续出现延迟高峰,但直到早上才有人发现。”这就是触发点。智能体无需从环境数据中推断模糊模式,它拥有清晰的指令。
2. Agent writes a skill. Two multi-step functions: a health check loop that runs every 30 minutes, pulling error rates, latency, and resource usage, with the LLM classifying system health as normal, degraded, or critical. And an incident triage skill that fetches detailed metrics and recent deploy history, correlates root causes with an LLM, and posts a triage summary to Slack with recommended actions. Error handling: if the metrics API is down, back off and retry. If the LLM fails, fall back to rule-based severity classification.
2. Agent 编写技能。 两个多步骤函数:一个健康检查循环,每30分钟运行一次,提取错误率、延迟和资源使用情况,由LLM将系统健康状态分类为正常、降级或严重。另一个是事件分类技能,用于获取详细指标和最近部署历史,通过LLM关联根因,并将分类摘要(含建议操作)发布到Slack。错误处理:如果指标API不可用,则回退并重试;如果LLM失败,则回退到基于规则的严重性分类。
3. Agent deploys the skill. The agent writes the function code that’s picked up by a sidecar process. The new functions are registered automatically. They’re live immediately, with no deploy pipeline, no PR.
3. 代理部署技能。 代理编写函数代码,由侧边车进程接收。新函数自动注册。它们立即生效,无需部署流水线,无需PR。
4. Skill runs autonomously. Every 30 minutes, the engine triggers the health check. If something’s wrong, it invokes the triage skill. No human in the loop. Fully durable.
4. 技能自主运行。 每30分钟,引擎触发健康检查。如果发现异常,则调用分类技能。无需人工介入。完全持久化。
5. Agent iterates on signal. This is the part people gloss over, so let me be specific about what “iterates” means. The agent doesn’t magically notice patterns. It has a separate review loop: a cron-triggered function that runs weekly, reads the run history from the orchestrator, and evaluates performance:
5. 智能体基于信号进行迭代。 这是人们容易一带而过的部分,因此让我具体说明“迭代”的含义。智能体并不会神奇地识别出模式。它有一个独立的审查循环:一个由cron触发的函数,每周运行一次,从编排器读取运行历史,并评估性能:
export const reviewSkillPerformance = inngest.createFunction(
{ id: "review-skill-performance" },
{ cron: "0 10 * * 5" }, // Every Friday at 10am
async ({ step }) => {
const runs = await step.run("fetch-run-history", async () => {
return await getInngestRuns({
functionId: "incident-triage",
since: daysAgo(7),
});
});
const analysis = await step.run("analyze-performance", async () => {
const successRate = runs.filter(r => r.status === "completed").length / runs.length;
const avgDuration = average(runs.map(r => r.duration));
const incidents = await fetchIncidentOutcomes(); // Did incidents correlate with actual outages?
return await callLLM({
prompt: \`Review this skill's performance over the past week.
Success rate: ${successRate}
Avg duration: ${avgDuration}ms
Incidents correlated with real outages: ${incidents.confirmed}/${incidents.total}
False positives: ${incidents.falsePositives}
Team acted on alerts: ${incidents.actedOn}/${incidents.total}
Should we adjust thresholds or classification? What specific changes?\`,
});
});
if (analysis.shouldModify) {
await step.invoke("update-skill", {
function: coreAgent,
data: { prompt: \`Update the incident-triage skills based on the following proposed changes: ${analysis.proposedChanges}\` },
});
}
}
);
The “review” is a function. It reads run history, checks whether incidents correlated with actual outages, and feeds that signal to the LLM. If the health check keeps flagging a service as degraded but the team ignores it because the thresholds are too sensitive, the review loop catches it, and the skill gets updated to adjust the classification. Not magic. A cron job with an LLM in the decision seat.
“review”是一个函数。它会读取运行历史,检查事件是否与实际故障相关,并将这一信号反馈给LLM。如果健康检查持续将某个服务标记为降级,但团队因阈值过于敏感而忽略告警,review循环会捕捉到这种情况,随后技能会被更新以调整分类方式。这并非魔法——不过是一个让LLM充当决策角色的定时任务罢了。
What about validation? The agent writing code is only as good as the guardrails around it. The code can be type checked. The agent can invoke the function itself to test it as it’s able to interact with the orchestration engine itself. While it’s not bulletproof, you are giving the core agent the ability to debug the skills it writes natively within the system it operates. The review loop catches issues that aren’t caught with the initial debugging.
验证方面呢? 编写代码的智能体(agent)的性能取决于其周围的防护措施。代码可以进行类型检查。智能体本身可以调用函数来测试,因为它能够与编排引擎直接交互。虽然这并非万无一失,但你赋予了核心智能体在其运行的系统内原生调试它所编写技能的能力。审查循环能够捕捉到初始调试中未被发现的问题。
Taking this a degree further, the agent can use onFailure hooks to trigger itself to evaluate a given failure itself. It’s a feedback loop that keeps improving.
更进一步,Agent 可以使用 onFailure 钩子来触发自身评估给定的失败。这是一个不断改进的反馈循环。
What about conflicts? Flow controls, specifically, concurrency controls or singletons handle the simple case (concurrency: [{ limit: 1, key: “event.data.service” }]) meaning only one incident triage runs at a time per service. But the deeper question is: what if two health checks both detect issues in the same service simultaneously? The orchestrator queues them. Second triage waits until the first completes. No duplicate alerts, no race conditions. This isn’t theoretical. It’s the same concurrency primitive you’d use in any job queue.
那么冲突呢? 流程控制,具体来说就是并发控制或单例模式处理简单场景(并发:[{ limit: 1, key: "[event.data](https://event.data/).service" }]),这意味着每个服务每次只运行一个事件分类流程。但更深层的问题是:如果两个健康检查同时检测到同一服务的问题怎么办?编排器会将其排队。第二个分类流程会等待第一个完成。不会出现重复告警,也不会产生竞态条件。这并非理论假设——它与你任务队列中使用的并发原语完全相同。
The agent isn’t just executing tasks. It’s building infrastructure for itself. Each skill persists beyond the conversation that created it. Kill the agent process and restart it. The skills keep running. Swap the underlying model. The skills keep running. The agent is ephemeral — its output is durable.
智能体不仅仅在执行任务。它正在为自己构建基础设施。每个技能都能在创造它的对话结束后持续存在。终止智能体进程并重启。技能仍在运行。更换底层模型。技能仍在运行。智能体是短暂的——它的输出是持久的。

Agent loop architecture system overview
Agent循环架构系统概述
The developer’s view
开发者的视角
This matters because if the developer can’t see what the agent deployed, debug what broke, and audit what ran at 3am, the whole architecture is a major liability.
这一点至关重要,因为如果开发者无法查看代理部署了什么、调试故障所在、并审计凌晨3点运行的内容,那么整个架构就是一个重大隐患。
The orchestration engine stores every run, every step, every input, every output, every retry. A skill the agent deployed last Tuesday that failed at 4am? You can see exactly which step failed, what the input was, what error it threw, and how many times it retried before giving up. Full traces down to the step level are the output of the orchestration engine itself.
编排引擎会存储每一次运行、每一步骤、每一个输入、每一个输出、每一次重试。上周二代理部署的一个技能在凌晨4点失败了?你可以确切看到哪个步骤失败,输入是什么,抛出了什么错误,以及在放弃之前重试了多少次。一直到步骤级别的完整追踪是编排引擎自身的输出。
This isn’t a dashboard bolted on after the fact. It’s inherent to durable execution. Every step.run() is a checkpoint. Every checkpoint is observable. When the thing that wrote the code isn’t a human, observability isn’t a nice-to-have — it’s the trust layer.
这不是事后才加装的仪表盘。它是持久化执行固有的。每次 step.run() 调用都是一个检查点。每个检查点都是可观测的。当编写代码的不是人类时,可观测性就不是锦上添花——它是信任层。
Day-to-day, the developer’s workflow looks like this: check the runs dashboard in the morning. See which skills ran overnight, which succeeded, which failed. If a skill the agent wrote is misbehaving, you can read the code directly, edit it, delete it, or tell the agent to fix it. The agent authored it, but you own it. The agent and its skills are still a garden that you should tend to.
每天,开发者的工作流程是这样的:早上查看运行仪表盘,看看哪些技能在夜间运行了,哪些成功了,哪些失败了。如果智能体编写的某个技能运行异常,你可以直接阅读代码、编辑它、删除它,或者让智能体修复它。代码由智能体撰写,但所有权归你。智能体及其技能仍然是一座需要你照料的花园。
Why durability is foundational
为什么耐久性是根本
Van Horn: “These things have to survive a restart.”
范霍恩:“这些东西必须能撑过重启。”
Here’s what durability means in practice:
以下是耐用性在实践中的含义:
| Requirement | What it means | Why basic while loop fails |
|---|---|---|
| Independent step retry | If step 3 of 5 fails, retry step 3, not steps 1 and 2 | A loop restart re-runs everything from scratch |
| Sub-agent lifecycle | Spawn a child task, wait for it (maybe hours), cancel if the parent is cancelled | No built-in parent-child lifecycle management |
| Guaranteed event delivery | If an event fires while the agent is down, it should still be processed | Events are lost if the process isn’t running |
| Post-hoc observability | See what happened after the fact: every step, every decision, every retry | Logs are your only option, and they’re ephemeral |
| Hot-deploy without downtime | Deploy a new function version without killing in-flight runs | Process restart kills everything |
| Concurrency control | Only run N instances of a skill at a time | No built-in concurrency primitives |
“Just run it in a container” gets you uptime. It doesn’t get you correctness. A container that restarts after a crash brings the process back, but every in-flight loop starts over. Every step re-executes. Every LLM call is re-made. The loop looks like it’s running, but it’s running blind.
“只需在容器中运行”能让你获得运行时间,但无法保证正确性。崩溃后重启的容器虽然能恢复进程,但每个正在执行中的循环都会重新开始。每一步都会重新执行,每次 LLM 调用都会重新发起。从表面看循环似乎仍在运行,但实际上它是在盲目运行。
How this compares to existing tools
与现有工具比较
Some tools may offer you a “pretty” turnkey solution to this type of system or you might choose to cobble together some lower level tools and create your own system. Neither choice is wrong, but the right architecture layer should allow you, and your agent, to evolve over time. Flexible, dynamic, durable.
一些工具可能会为你提供”漂亮”的一站式解决方案,来处理此类系统;或者你也可以选择拼凑一些底层工具,打造自己的系统。这两种选择都没有对错之分,但正确的架构层应当能让你——以及你的智能体——随着时间推移不断演进。灵活、动态、持久。
Durable execution primitives that fit nicely for an agent, that and agent can easily write, and the observability and APIs to observe and enable the agent itself to be orchestration aware.
持久执行原语,能够很好地适配智能体,且智能体可轻松编写;同时提供可观测性及API,以便观察并让智能体自身具备编排感知能力。
A working example
一个工作示例
We’re testing these patterns internally at Inngest and you can see a concept of this in the “utah” project repo here: https://github.com/inngest/utah: It’s an agent harness built on top of Inngest’s durable orchestration that also is orchestration-aware.
我们正在 Inngest 内部测试这些模式,你可以在“utah”项目仓库中看到相关概念:https://github.com/inngest/utah:这是一个基于 Inngest 持久化编排构建的 agent 工具集,并且自身也具备编排感知能力。
The system has a sidecar process that enables the main agent to write and edit Inngest functions in it’s own workspace, extending itself with “skills” (in the context of this article). Soon, we’re planning to provide an entire system with starter loops as examples, but the ideas there can demonstrate the ideas in this article a bit more clearly.
系统有一个边车进程,使得主代理可以在自己的工作空间中编写和编辑 Inngest 函数,通过“技能”(在本文的语境下)来扩展自身。很快,我们计划提供一个完整的系统,以启动循环作为示例,但其中的想法可以更清晰地展示本文中的概念。
The compounding loop
复利循环
Satya Nadella’s recent post named something the industry has been feeling: the moat isn’t the model — it’s the loop.
萨提亚·纳德拉最近的一篇帖子点出了行业一直以来的感受:护城河不在于模型——而在于循环。
His framing: there are two types of capital. Human capital, the knowledge and judgment your team built over years. And what he calls token capital, the AI workflows, decision patterns, and learned skills a company builds on top of foundation models.
他的框架:资本有两种类型。人力资本,即你的团队经年积累的知识与判断力。以及他所谓的代币资本,即公司在基础模型之上构建的AI工作流、决策模式与习得技能。
The thesis: these compound together. Every improved workflow generates better signal. Better signal produces sharper AI behavior. Sharper behavior frees up human attention for higher-judgment work. A hill climbing machine.
论点:这些要素复合在一起。每一次改进的工作流程都会产生更强的信号。更强的信号带来更精准的AI行为。更精准的行为释放了人类注意力,用于更高层次的判断工作——这是一台爬坡机器。
This is what the agent loop architecture enables concretely:
这正是代理循环架构所能具体实现的:
- Every durable skill the agent deploys is institutional knowledge encoded as executable infrastructure. It persists. It runs whether or not a human is watching.
- A cron-triggered review loop that evaluates skill performance and iterates. That’s the hill climbing machine made real. Not a flywheel diagram in a deck. A function with a cron trigger.
- If your skills die on process restart, the compounding resets to zero. Durability is what makes the investment persist.
- 智能体部署的每项持久技能都是编码为可执行基础设施的制度化知识。它持续存在。无论是否有人监控,它都会运行。
- 一个由 cron 触发的审查循环,评估技能表现并迭代。这就是现实中的爬山算法。不是演示文稿里的飞轮图。而是一个带 cron 触发器的函数。
- 如果你的技能在进程重启后消失,复利就会重置为零。持久性让投资得以持续。
Nadella’s key point: “A company should be able to switch out a ‘generalist’ model without losing the ‘company veteran’ expertise built into their learning system.” That’s the skill library pattern. Durable functions don’t care which LLM calls them.
纳德拉的核心观点是:“一家公司应该能够更换‘通才’模型,而不会失去植根于其学习系统中的‘公司资深员工’经验。”这就是技能库模式。持久函数不关心是哪个LLM调用它们。
Build accordingly
据此构建
The conversation has been about what agents do: loops, tools, reasoning, context engineering. The next conversation is about what runs the agents.
之前的对话讨论了代理的功能:循环、工具、推理和上下文工程。接下来的对话将探讨什么驱动着这些代理。
Three layers: loop, skill, orchestrator. The loop is the unit of work. The skill is the asset. The orchestration engine is what makes both durable. The sidecar pattern is the model: an agent writes its own durable skills, deploys them, reviews how they perform, and iterates. Not a thought experiment. It’s a working model.
三层:循环、技能、编排引擎。循环是工作单元,技能是资产,编排引擎让两者持久运转。边车模式便是其模型:智能体自行编写持久的技能、部署它们、审视其表现,并不断迭代。这不是空想实验——这是一个实际运行的模型。
We built Inngest to be the orchestration engine for this: step.run(), step.invoke(), cron triggers, event-driven control flow, concurrency controls, and full step-level observability. But the architecture pattern is bigger than any single tool. If you’re building agent loops in production, define the three layers.
我们构建了 Inngest 作为实现这一目标的编排引擎:step.run()、step.invoke()、cron 触发器、事件驱动控制流、并发控制,以及完整的步骤级可观测性。但架构模式比任何单一工具都更宏大。如果你在生产环境中构建 agent 循环,请定义三个层次。
The primitives exist today. Build accordingly.
原始元素已经存在。请据此构建。