Dify 1.0 正式发布:从 LLMOps 到 Agent OS 的进化
2026-06-19 · Dify 官方
要点
- Agent Workflow:可视化编排多 Agent 协作,拖拽配置条件和循环
- MCP 原生支持:Dify 可作为 MCP Server 暴露工具,也可消费外部 MCP Server
- RAG 重构:新增混合检索(向量 + 关键词 + 重排序),准确率提升 30%
- 多模型 A/B:同一 workflow 分流到不同模型对比效果
- 企业版:SSO + RBAC + 审计日志,私有化部署
核心升级解读
1. Agent Workflow 可视化编排
1.0 把工作流编排从代码级提升到了「拖拽级」:
工作流画布:
┌─────────────────────────────────────────────────────────────────┐
│ Dify 1.0 Agent Workflow │
│ │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ 开始 │ ───► │ LLM 1 │ ───► │ Agent │ ───► │ 结束 │ │
│ │ Trigger│ │ (分类) │ │ (执行) │ │ Response│ │
│ └────────┘ └────────┘ └────────┘ └────────┘ │
│ │ │ │
│ ▼ │ │
│ ┌──────────┐ │ │
│ │ 条件分支 │ │ │
│ │ A: 意图A │ ───► Agent A │ │
│ │ B: 意图B │ ───► Agent B │ │
│ │ C: 其他 │ ───► Fallback │ │
│ └──────────┘ │ │
└─────────────────────────────────────────────────────────────────┘
支持的节点类型:
| 节点类型 | 说明 | 适用场景 |
|---|---|---|
| LLM | 调用大模型 | 分类、生成、总结 |
| Agent | 自主决策 Agent | 多步骤任务、工具调用 |
| Knowledge | RAG 检索 | 知识库问答 |
| HTTP | 调用外部 API | 接入第三方服务 |
| Condition | 条件分支 | 意图路由 |
| Loop | 循环节点 | 批量处理、迭代 |
| Code | 自定义代码 | 复杂逻辑 |
| Template | 模板渲染 | 格式化输出 |
2. MCP 双向支持
1.0 实现 MCP 双向连接:
# 方式 1:Dify 作为 MCP Server(暴露工具)
# 其他 Agent(如 Claude Code)可以调用 Dify 里的 workflow
server:
name: dify-workflow
tools:
- name: customer-support
description: 处理客户咨询流程
input: { query: string }
output: { response: string, confidence: float }
- name: order-status
description: 查询订单状态
input: { order_id: string }
output: { status: string, details: object }
# 方式 2:Dify 消费外部 MCP Server
clients:
- name: github
server_url: https://github.com/mcp/servers/github
tools: [create-issue, search-repo, get-pr]
- name: slack
server_url: https://github.com/mcp/servers/slack
tools: [send-message, list-channels]
实际应用:
- Claude Code 通过 MCP 调用 Dify 里的客户咨询 workflow
- Dify workflow 里调用 GitHub MCP 获取代码库信息
- Slack MCP 发消息通知
3. RAG Pipeline 重构
1.0 的 RAG 从「向量检索」升级到「混合检索 + 重排序」:
# 之前:纯向量检索
query_embedding = embed("如何配置 SSL")
results = vector_db.search(query_embedding, top_k=5)
# 问题:关键词不匹配时效果差
# 现在:混合检索 + 重排序
# Step 1: 向量检索
vector_results = vector_db.search(embed(query), top_k=20)
# Step 2: 关键词检索
bm25_results = bm25.search(query, top_k=20)
# Step 3: RRF 融合
fused_results = reciprocal_rank_fusion(vector_results, bm25_results, top_k=10)
# Step 4: LLM 重排序
reranked = llm_rerank(query, fused_results, top_k=5)
# 输出最相关的 5 条
实测提升:
| 指标 | 0.x 纯向量 | 1.0 混合 + 重排序 | 提升 |
|---|---|---|---|
| 召回率 | 72% | 89% | +17% |
| Precision@5 | 65% | 91% | +26% |
| MRR | 68% | 88% | +20% |
4. 多模型 A/B 测试
1.0 支持同一个 workflow 同时跑多个模型:
# A/B 测试配置
ab_test:
enabled: true
routes:
- name: Claude-Sonnet
provider: anthropic
model: sonnet-4.5
weight: 50%
- name: GPT-5
provider: openai
model: gpt-5
weight: 50%
metrics:
- name: 用户满意度
type: thumbs_up_down
- name: 响应准确率
type: manual_review
- name: 响应延迟
type: latency_ms
auto_switch: true
winner_metric: 用户满意度
threshold: 95% confidence
定价
| 套餐 | 价格 | 说明 |
|---|---|---|
| Community | 免费 | 开源版,自托管 |
| Cloud Starter | $59/mo | 5 用户、3 workflow、10K runs |
| Cloud Pro | $199/mo | 无限用户、10 workflow、100K runs |
| Cloud Enterprise | 定制 | SSO + 私有部署 + SLA |
| Self-Hosted Enterprise | 询价 | 私有化部署全套 |
AIHO 观点
Dify 从 0.x 的「LLMOps 平台」进化到 1.0 的「Agent OS」——核心叙事从"管 LLM 调用"变成"编排 Agent 工作流"。
这次更新三个亮点:
- Agent Workflow 可视化——对标 Coze 的编排能力,但开源可自托管
- MCP 双向支持——既能暴露工具给 Claude/Cursor,也能消费外部 MCP Server
- RAG 混合检索——之前 Dify 的 RAG 是短板(纯向量),1.0 补上了
对国内开发者:Dify 1.0 是目前开源 Agent 平台里最完整的方案。Coze 体验更好但闭源,Dify 自托管 + MCP 生态是差异化优势。