文章目录
- Agent Runtime:AI Agent 的“操作系统”
- 一、什么是 Agent Runtime
- 二、为什么 Agent 一定需要 Runtime
- 三、Agent Runtime 的核心架构
- 四、Runtime 的核心组件
-
- 1. Event Loop(事件循环)
- 2. State Management(状态管理)
- 3. Tool Runtime
- 4. Workflow Engine
- 五、Agent Runtime 与 Workflow Engine 的关系
- 六、为什么 Durable Execution 很重要
- Durable Runtime
- 七、现代 Runtime 的关键能力
-
- 1. Context Window 管理
- 2. Async Execution
- 3. Human-in-the-Loop
- 4. Multi-Agent Communication
- 八、Agent Runtime 与 MCP 的关系
- 九、典型 Runtime 架构(生产级)
- 十、主流 Agent Runtime / Framework
-
- 1. LangGraph
- 2. Temporal
- 3. AutoGen
- 4. CrewAI
- 十一、未来趋势:Runtime 正在成为 AI OS
- 十二、总结
Agent Runtime:AI Agent 的“操作系统”
当大家讨论 AI Agent 时,往往会聊:
- Prompt
- Tool Calling
- Memory
- Multi-Agent
- Planning
- RAG
但真正决定一个 Agent 能否稳定运行的,往往不是模型本身,而是:
Agent Runtime(Agent 运行时)
它是 Agent 背后的执行环境。
如果说:
- LLM 是“大脑”
- Prompt 是“思维方式”
- Tool 是“手脚”
那么:
Runtime 就是 Agent 的“操作系统 + 调度中心 + 生命周期管理器”。
一、什么是 Agent Runtime
Agent Runtime 本质上是:
一个负责驱动 Agent 生命周期、状态、任务执行、工具调度、上下文管理的运行环境。
它类似:
- JVM 对 Java
- Node.js 对 JavaScript
- Kubernetes 对容器
- Temporal 对工作流
Agent Runtime 负责:
| 生命周期管理 | Agent 创建、暂停、恢复、销毁 |
| 状态管理 | Memory / Context / Session |
| Tool 调度 | 调用外部 API / MCP / 函数 |
| Workflow 执行 | 推理链、任务图、DAG |
| 多 Agent 协作 | Agent 间通信 |
| 事件驱动 | Event Loop |
| 任务恢复 | Retry / Checkpoint |
| 并发控制 | Async / Queue |
| 可观测性 | Tracing / Logging |
| Sandbox | 安全隔离 |
二、为什么 Agent 一定需要 Runtime
很多人刚接触 Agent 时会觉得:
response = llm.invoke(prompt)
不就是 Agent 吗?
实际上:
这只是一次推理调用。
真正的 Agent 通常需要:
- 长生命周期
- 持续状态
- 多轮执行
- 工具调用
- 错误恢复
- 异步任务
- 计划执行
- 多步骤工作流
例如:
用户:
帮我分析 AWS 成本并生成优化方案
Agent 可能需要:
1. 调 AWS Billing API
2. 获取 CloudWatch Metrics
3. 调 Athena 查询日志
4. 分析热点资源
5. 生成建议
6. 输出报告
7. 等待用户反馈
8. 二次迭代
这已经不是一次 LLM 调用。
而是:
一个长期运行的智能工作流系统。
这时候就必须有 Runtime。
三、Agent Runtime 的核心架构
典型 Runtime:
#mermaid-svg-U72rd0iheb9iKuyS{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-U72rd0iheb9iKuyS .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-U72rd0iheb9iKuyS .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-U72rd0iheb9iKuyS .error-icon{fill:#552222;}#mermaid-svg-U72rd0iheb9iKuyS .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-U72rd0iheb9iKuyS .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-U72rd0iheb9iKuyS .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-U72rd0iheb9iKuyS .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-U72rd0iheb9iKuyS .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-U72rd0iheb9iKuyS .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-U72rd0iheb9iKuyS .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-U72rd0iheb9iKuyS .marker{fill:#333333;stroke:#333333;}#mermaid-svg-U72rd0iheb9iKuyS .marker.cross{stroke:#333333;}#mermaid-svg-U72rd0iheb9iKuyS svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-U72rd0iheb9iKuyS p{margin:0;}#mermaid-svg-U72rd0iheb9iKuyS .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-U72rd0iheb9iKuyS .cluster-label text{fill:#333;}#mermaid-svg-U72rd0iheb9iKuyS .cluster-label span{color:#333;}#mermaid-svg-U72rd0iheb9iKuyS .cluster-label span p{background-color:transparent;}#mermaid-svg-U72rd0iheb9iKuyS .label text,#mermaid-svg-U72rd0iheb9iKuyS span{fill:#333;color:#333;}#mermaid-svg-U72rd0iheb9iKuyS .node rect,#mermaid-svg-U72rd0iheb9iKuyS .node circle,#mermaid-svg-U72rd0iheb9iKuyS .node ellipse,#mermaid-svg-U72rd0iheb9iKuyS .node polygon,#mermaid-svg-U72rd0iheb9iKuyS .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-U72rd0iheb9iKuyS .rough-node .label text,#mermaid-svg-U72rd0iheb9iKuyS .node .label text,#mermaid-svg-U72rd0iheb9iKuyS .image-shape .label,#mermaid-svg-U72rd0iheb9iKuyS .icon-shape .label{text-anchor:middle;}#mermaid-svg-U72rd0iheb9iKuyS .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-U72rd0iheb9iKuyS .rough-node .label,#mermaid-svg-U72rd0iheb9iKuyS .node .label,#mermaid-svg-U72rd0iheb9iKuyS .image-shape .label,#mermaid-svg-U72rd0iheb9iKuyS .icon-shape .label{text-align:center;}#mermaid-svg-U72rd0iheb9iKuyS .node.clickable{cursor:pointer;}#mermaid-svg-U72rd0iheb9iKuyS .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-U72rd0iheb9iKuyS .arrowheadPath{fill:#333333;}#mermaid-svg-U72rd0iheb9iKuyS .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-U72rd0iheb9iKuyS .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-U72rd0iheb9iKuyS .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-U72rd0iheb9iKuyS .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-U72rd0iheb9iKuyS .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-U72rd0iheb9iKuyS .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-U72rd0iheb9iKuyS .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-U72rd0iheb9iKuyS .cluster text{fill:#333;}#mermaid-svg-U72rd0iheb9iKuyS .cluster span{color:#333;}#mermaid-svg-U72rd0iheb9iKuyS div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-U72rd0iheb9iKuyS .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-U72rd0iheb9iKuyS rect.text{fill:none;stroke-width:0;}#mermaid-svg-U72rd0iheb9iKuyS .icon-shape,#mermaid-svg-U72rd0iheb9iKuyS .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-U72rd0iheb9iKuyS .icon-shape p,#mermaid-svg-U72rd0iheb9iKuyS .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-U72rd0iheb9iKuyS .icon-shape .label rect,#mermaid-svg-U72rd0iheb9iKuyS .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-U72rd0iheb9iKuyS .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-U72rd0iheb9iKuyS .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-U72rd0iheb9iKuyS :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
User
Runtime
Planner
Memory
ToolExecutor
WorkflowEngine
EventBus
StateStore
LLM
ExternalTools
Tasks
Redis
Postgres
VectorDB
四、Runtime 的核心组件
1. Event Loop(事件循环)
这是 Runtime 的核心。
类似 Node.js:
while True:
event = queue.get()
handle(event)
Agent Runtime 也是:
收到用户消息
→ 推理
→ 调工具
→ 等待结果
→ 更新状态
→ 继续执行
很多 Runtime 本质都是:
Event-Driven Architecture(EDA)
2. State Management(状态管理)
Agent 最关键的问题之一:
“它怎么记住之前发生的事情?”
Runtime 会维护:
Session State
Conversation State
Workflow State
Tool State
Memory State
例如:
state = {
"user_goal": "…",
"completed_tasks": [],
"tool_outputs": [],
}
3. Tool Runtime
现代 Agent 几乎都依赖 Tool Calling。
Runtime 负责:
Tool Discovery
Tool Registration
Permission
Execution
Retry
Timeout
Sandbox
例如:
@tool
async def search_docs(query: str):
...
Runtime 会:
注册工具
参数校验
调度执行
错误恢复
返回结果
4. Workflow Engine
这是现在 Agent Runtime 最重要的部分之一。
因为:
Agent 不再只是 Chat。
而是 Workflow。
例如:
#mermaid-svg-bSRyXzo4q9PsXczh{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-bSRyXzo4q9PsXczh .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-bSRyXzo4q9PsXczh .error-icon{fill:#552222;}#mermaid-svg-bSRyXzo4q9PsXczh .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-bSRyXzo4q9PsXczh .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-bSRyXzo4q9PsXczh .marker{fill:#333333;stroke:#333333;}#mermaid-svg-bSRyXzo4q9PsXczh .marker.cross{stroke:#333333;}#mermaid-svg-bSRyXzo4q9PsXczh svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-bSRyXzo4q9PsXczh p{margin:0;}#mermaid-svg-bSRyXzo4q9PsXczh .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-bSRyXzo4q9PsXczh .cluster-label text{fill:#333;}#mermaid-svg-bSRyXzo4q9PsXczh .cluster-label span{color:#333;}#mermaid-svg-bSRyXzo4q9PsXczh .cluster-label span p{background-color:transparent;}#mermaid-svg-bSRyXzo4q9PsXczh .label text,#mermaid-svg-bSRyXzo4q9PsXczh span{fill:#333;color:#333;}#mermaid-svg-bSRyXzo4q9PsXczh .node rect,#mermaid-svg-bSRyXzo4q9PsXczh .node circle,#mermaid-svg-bSRyXzo4q9PsXczh .node ellipse,#mermaid-svg-bSRyXzo4q9PsXczh .node polygon,#mermaid-svg-bSRyXzo4q9PsXczh .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-bSRyXzo4q9PsXczh .rough-node .label text,#mermaid-svg-bSRyXzo4q9PsXczh .node .label text,#mermaid-svg-bSRyXzo4q9PsXczh .image-shape .label,#mermaid-svg-bSRyXzo4q9PsXczh .icon-shape .label{text-anchor:middle;}#mermaid-svg-bSRyXzo4q9PsXczh .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-bSRyXzo4q9PsXczh .rough-node .label,#mermaid-svg-bSRyXzo4q9PsXczh .node .label,#mermaid-svg-bSRyXzo4q9PsXczh .image-shape .label,#mermaid-svg-bSRyXzo4q9PsXczh .icon-shape .label{text-align:center;}#mermaid-svg-bSRyXzo4q9PsXczh .node.clickable{cursor:pointer;}#mermaid-svg-bSRyXzo4q9PsXczh .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-bSRyXzo4q9PsXczh .arrowheadPath{fill:#333333;}#mermaid-svg-bSRyXzo4q9PsXczh .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-bSRyXzo4q9PsXczh .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-bSRyXzo4q9PsXczh .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-bSRyXzo4q9PsXczh .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-bSRyXzo4q9PsXczh .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-bSRyXzo4q9PsXczh .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-bSRyXzo4q9PsXczh .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-bSRyXzo4q9PsXczh .cluster text{fill:#333;}#mermaid-svg-bSRyXzo4q9PsXczh .cluster span{color:#333;}#mermaid-svg-bSRyXzo4q9PsXczh div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-bSRyXzo4q9PsXczh .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-bSRyXzo4q9PsXczh rect.text{fill:none;stroke-width:0;}#mermaid-svg-bSRyXzo4q9PsXczh .icon-shape,#mermaid-svg-bSRyXzo4q9PsXczh .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-bSRyXzo4q9PsXczh .icon-shape p,#mermaid-svg-bSRyXzo4q9PsXczh .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-bSRyXzo4q9PsXczh .icon-shape .label rect,#mermaid-svg-bSRyXzo4q9PsXczh .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-bSRyXzo4q9PsXczh .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-bSRyXzo4q9PsXczh .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-bSRyXzo4q9PsXczh :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
分析需求
生成计划
调用工具
总结结果
生成最终输出
Runtime 负责:
- DAG 执行
- 状态转移
- 节点调度
- Retry
- Checkpoint
这也是为什么:
很多 Agent Framework 开始融合:
- Workflow Engine
- Durable Execution
- DAG Engine
五、Agent Runtime 与 Workflow Engine 的关系
很多人会混淆:
| 更底层 | 更偏任务编排 |
| 管理生命周期 | 管理流程 |
| 管理状态 | 管理节点 |
| 管理上下文 | 管理执行图 |
实际上:
现代 Agent Runtime 往往内置 Workflow Engine。
例如:
- LangGraph
- Temporal
- AutoGen
- CrewAI
都在逐渐 Runtime 化。
六、为什么 Durable Execution 很重要
LLM Agent 有个天然问题:
执行时间很长。
例如:
Agent:
– 调 API
– 等待审批
– 人工确认
– 执行任务
可能持续:
- 10 分钟
- 2 小时
- 3 天
如果进程挂了怎么办?
于是出现:
Durable Runtime
核心思想:
任何步骤都可恢复
例如:
Checkpoint
Event Sourcing
State Replay
Persistent Workflow
典型代表:
- Temporal
- Prefect
- Dagster
七、现代 Runtime 的关键能力
1. Context Window 管理
因为 LLM Context 有限制。
Runtime 会:
裁剪历史
摘要
长期记忆
向量检索
分层记忆
否则:
Agent 很快就“失忆”。
2. Async Execution
很多 Tool 很慢:
await browser.search()
await db.query()
await api.call()
Runtime 必须支持:
- async
- queue
- concurrent execution
否则 Agent 会非常卡。
3. Human-in-the-Loop
现代 Agent 常常需要:
Agent:
需要删除生产数据库,是否确认?
Runtime 需要支持:
- Pause
- Resume
- Approval
- Interrupt
4. Multi-Agent Communication
多个 Agent:
Planner Agent
Coder Agent
Reviewer Agent
Executor Agent
Runtime 要解决:
消息传递
共享状态
任务路由
冲突处理
八、Agent Runtime 与 MCP 的关系
现在很多人会把:
- MCP
- Agent Runtime
混为一谈。
实际上:
| Tool 协议 | 执行环境 |
| 类似 USB | 类似 OS |
| 负责连接工具 | 负责运行 Agent |
MCP 解决:
Agent 怎么访问工具
Runtime 解决:
Agent 怎么活着
九、典型 Runtime 架构(生产级)
现代生产级 Agent Runtime:
#mermaid-svg-AXExBojMvM7mHhz2{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-AXExBojMvM7mHhz2 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-AXExBojMvM7mHhz2 .error-icon{fill:#552222;}#mermaid-svg-AXExBojMvM7mHhz2 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-AXExBojMvM7mHhz2 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-AXExBojMvM7mHhz2 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-AXExBojMvM7mHhz2 .marker.cross{stroke:#333333;}#mermaid-svg-AXExBojMvM7mHhz2 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-AXExBojMvM7mHhz2 p{margin:0;}#mermaid-svg-AXExBojMvM7mHhz2 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-AXExBojMvM7mHhz2 .cluster-label text{fill:#333;}#mermaid-svg-AXExBojMvM7mHhz2 .cluster-label span{color:#333;}#mermaid-svg-AXExBojMvM7mHhz2 .cluster-label span p{background-color:transparent;}#mermaid-svg-AXExBojMvM7mHhz2 .label text,#mermaid-svg-AXExBojMvM7mHhz2 span{fill:#333;color:#333;}#mermaid-svg-AXExBojMvM7mHhz2 .node rect,#mermaid-svg-AXExBojMvM7mHhz2 .node circle,#mermaid-svg-AXExBojMvM7mHhz2 .node ellipse,#mermaid-svg-AXExBojMvM7mHhz2 .node polygon,#mermaid-svg-AXExBojMvM7mHhz2 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-AXExBojMvM7mHhz2 .rough-node .label text,#mermaid-svg-AXExBojMvM7mHhz2 .node .label text,#mermaid-svg-AXExBojMvM7mHhz2 .image-shape .label,#mermaid-svg-AXExBojMvM7mHhz2 .icon-shape .label{text-anchor:middle;}#mermaid-svg-AXExBojMvM7mHhz2 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-AXExBojMvM7mHhz2 .rough-node .label,#mermaid-svg-AXExBojMvM7mHhz2 .node .label,#mermaid-svg-AXExBojMvM7mHhz2 .image-shape .label,#mermaid-svg-AXExBojMvM7mHhz2 .icon-shape .label{text-align:center;}#mermaid-svg-AXExBojMvM7mHhz2 .node.clickable{cursor:pointer;}#mermaid-svg-AXExBojMvM7mHhz2 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-AXExBojMvM7mHhz2 .arrowheadPath{fill:#333333;}#mermaid-svg-AXExBojMvM7mHhz2 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-AXExBojMvM7mHhz2 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-AXExBojMvM7mHhz2 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-AXExBojMvM7mHhz2 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-AXExBojMvM7mHhz2 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-AXExBojMvM7mHhz2 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-AXExBojMvM7mHhz2 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-AXExBojMvM7mHhz2 .cluster text{fill:#333;}#mermaid-svg-AXExBojMvM7mHhz2 .cluster span{color:#333;}#mermaid-svg-AXExBojMvM7mHhz2 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-AXExBojMvM7mHhz2 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-AXExBojMvM7mHhz2 rect.text{fill:none;stroke-width:0;}#mermaid-svg-AXExBojMvM7mHhz2 .icon-shape,#mermaid-svg-AXExBojMvM7mHhz2 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-AXExBojMvM7mHhz2 .icon-shape p,#mermaid-svg-AXExBojMvM7mHhz2 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-AXExBojMvM7mHhz2 .icon-shape .label rect,#mermaid-svg-AXExBojMvM7mHhz2 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-AXExBojMvM7mHhz2 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-AXExBojMvM7mHhz2 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-AXExBojMvM7mHhz2 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
Client
API
Runtime
Queue
Scheduler
StateStore
MemoryStore
ToolRegistry
Workers
LLM
MCP
APIs
Postgres
VectorDB
Observability
十、主流 Agent Runtime / Framework
1. LangGraph
特点:
- DAG Agent
- Stateful
- Multi-step workflow
- Human-in-the-loop
适合:
- 复杂工作流
- 多步骤 Agent
2. Temporal
特点:
- Durable Execution
- Checkpoint
- Retry
- Recovery
适合:
- 长任务 Agent
- 企业级执行
3. AutoGen
特点:
- Multi-Agent Conversation
- Agent-to-Agent
适合:
- Agent 协作
4. CrewAI
特点:
- Role-based Agent
- Task Delegation
适合:
- 团队型 Agent
十一、未来趋势:Runtime 正在成为 AI OS
现在整个行业正在从:
Prompt Engineering
走向:
Agent Infrastructure Engineering
未来真正的竞争点:
已经不只是模型。
而是:
Runtime
Memory
Workflow
Tool Ecosystem
Durability
Observability
Scheduling
最终:
Agent Runtime 很可能会演化成 AI 时代的“操作系统”。
就像:
- Linux 管理进程
- Kubernetes 管理容器
未来:
Runtime 将管理 Agent。
十二、总结
Agent Runtime 本质是:
AI Agent 的执行基础设施。
它负责:
- 生命周期
- 状态
- 工具调用
- 工作流
- Durable Execution
- 多 Agent 协作
- Context 管理
没有 Runtime:
Agent 只是:
LLM(prompt)
有了 Runtime:
才真正变成:
可持续运行的智能系统
这也是为什么:
未来 AI 工程里最重要的方向之一,已经开始从:
Prompt Engineering
逐渐转向:
Agent Runtime Engineering


