跳到主内容

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多步骤任务、工具调用
KnowledgeRAG 检索知识库问答
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@565%91%+26%
MRR68%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/mo5 用户、3 workflow、10K runs
Cloud Pro$199/mo无限用户、10 workflow、100K runs
Cloud Enterprise定制SSO + 私有部署 + SLA
Self-Hosted Enterprise询价私有化部署全套

AI 之家 观点

Dify 从 0.x 的「LLMOps 平台」进化到 1.0 的「Agent OS」——核心叙事从"管 LLM 调用"变成"编排 Agent 工作流"。

这次更新三个亮点:

  1. Agent Workflow 可视化——对标 Coze 的编排能力,但开源可自托管
  2. MCP 双向支持——既能暴露工具给 Claude/Cursor,也能消费外部 MCP Server
  3. RAG 混合检索——之前 Dify 的 RAG 是短板(纯向量),1.0 补上了

对国内开发者:Dify 1.0 是目前开源 Agent 平台里最完整的方案。Coze 体验更好但闭源,Dify 自托管 + MCP 生态是差异化优势。

相关阅读

来源

相关对比

Aider vs Claude Code:终端 AI 编程双雄怎么选

Aider vs Claude Code 2026 选型对比:开源 BYOK 多模型 vs Anthropic 订阅长任务 Agent,从编程能力、多模型支持、价格、Git 集成、国内可用性和适合人群判断,帮你选对终端 AI 编程工具。

Augment Code vs Cursor:企业 AI 编程怎么选?Context Engine vs AI IDE 对比

Augment Code vs Cursor 2026 选型对比:Context Engine 全仓索引的企业 AI 平台 vs SpaceX 收购的 AI IDE 天花板,从形态、Context 覆盖、长任务、价格、合规、中文支持和适合人群 8 个维度判断,帮你选对企业 AI 编程工具。

Claude Code vs Cline:CLI AI Agent 怎么选?2026 对比

Claude Code vs Cline 2026 选型对比:Anthropic 官方闭源 CLI Agent vs Apache-2.0 开源 VS Code 插件。从模型绑定、工作流、MCP 支持、价格、隐私和适合人群 6 个维度帮你选对 CLI AI 编程工具。

Claude Code vs Codex CLI:终端 AI Agent 双雄对比

Claude Code vs Codex CLI 2026 选型对比:Anthropic 与 OpenAI 两大官方终端 Agent 的模型、长任务、MCP 生态、Windows 支持、订阅打包价格和国内可用性全方位对比,帮你判断该用哪个终端 AI Agent,以及能不能两个一起用。

Claude Code vs Crush:Anthropic 官方 vs 多模型 TUI(2026 实测选型)

Claude Code vs Crush 2026 选型对比:Anthropic 官方 CLI Agent(Claude only + 长任务最稳 + MCP 一等公民)vs Charmbracelet 开源 TUI Agent(多模型 mid-session 切换 + LSP + FSL-1.1-MIT)。从模型、长任务、生态、价格、国内可用性帮你选对终端 AI 编程工具。

Claude Code vs Gemini CLI:终端 AI Agent 怎么选?(2026 选型指南)

Claude Code 和 Gemini CLI 都是终端原生的 AI 编码 Agent。一句话结论 + 决策树 + 价格 + 国内可用性对比:长任务与 CLAUDE.md 生态选前者,免费额度与接入门槛选后者。

相关评测