{
  "schemaVersion": "1.0",
  "schemaUrl": "https://www.yingxueyuan.cn/ai-directory.schema.json#/$defs/guideContentDocument",
  "name": "Dify 怎么创建 AI Agent？从任务定义到测试发布｜映雪网指南机器可读正文",
  "description": "单篇指南结构化内容，含可见导语、结论、分节正文与逐节来源。",
  "siteUrl": "https://www.yingxueyuan.cn",
  "lastContentUpdate": "2026-10-25",
  "guides": [
    {
      "id": "create-agent-with-dify",
      "contentUrl": "https://www.yingxueyuan.cn/ai-content/create-agent-with-dify.json",
      "title": "Dify 怎么创建 AI Agent？从任务定义到测试发布",
      "author": {
        "@type": "Organization",
        "@id": "https://www.yingxueyuan.cn/#editorial-team",
        "name": "映雪网编辑部",
        "url": "https://www.yingxueyuan.cn/editorial-policy/",
        "parentOrganization": {
          "@id": "https://www.yingxueyuan.cn/#organization"
        }
      },
      "publisher": {
        "@type": "Organization",
        "@id": "https://www.yingxueyuan.cn/#organization",
        "name": "映雪园智能科技",
        "alternateName": "映雪网",
        "brand": {
          "@type": "Brand",
          "@id": "https://www.yingxueyuan.cn/#brand-yingxuewang",
          "name": "映雪网",
          "url": "https://www.yingxueyuan.cn/"
        },
        "url": "https://www.yingxueyuan.cn/company/"
      },
      "description": "按 Dify 官方新版 Agent 教程完成第一版：定义重复任务、用 Build 模式搭建、配置工具、测试行为，再选择网页、嵌入、API 或工作流入口。",
      "summary": "先把一个重复任务写成清晰的职责与验收标准，再用 Dify Build 模式创建 Agent。逐项检查自动生成的技能/说明、谨慎添加工具凭据，并在 Build 与 Preview 中测试后再发布。",
      "intro": "Dify 官方在 2026-08-27 发布了新版 Agent 搭建教程，并将新 Agent 标为 Beta。本文按官方步骤整理一个低风险的起步流程：先选一个重复任务，再配置 Agent、检查能力、做测试，最后选择合适的发布方式。功能、入口和账号权限可能继续变化；开始前请在当前 Dify 工作区确认实际可用选项。",
      "readTime": "8 分钟",
      "updatedAt": "2026-10-25",
      "url": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/",
      "quickAnswer": {
        "text": "从一个重复任务开始：在 Dify 创建空白 Agent、选择模型，用 Build Mode 对话梳理职责与配置；审阅并应用生成的 Skill/Build Note，按需添加工具和文件；先在 Build 和 Preview 测试正常、缺少信息及冲突要求，再发布为网页应用、嵌入或 API，或将 Agent 加入工作流。",
        "source": {
          "label": "Dify 官方：How to Build Your First Agent in Dify",
          "url": "https://dify.ai/blog/build-your-first-agent-in-dify"
        },
        "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#build-agent"
      },
      "relatedGuides": [
        {
          "title": "AI Agent 是什么？和 AI 助手、自动化工作流有什么区别",
          "url": "https://www.yingxueyuan.cn/docs/what-is-ai-agent/"
        },
        {
          "title": "Agent 框架和搭建平台怎么选？Dify、LangGraph、CrewAI 对照",
          "url": "https://www.yingxueyuan.cn/docs/agent-framework-vs-platform/"
        },
        {
          "title": "扣子怎么用？AI 工作台、Agent 协作和扣子编程入口",
          "url": "https://www.yingxueyuan.cn/docs/coze-agent-guide/"
        },
        {
          "title": "怎么安全试用 AI Agent？权限、数据和人工确认清单",
          "url": "https://www.yingxueyuan.cn/docs/choose-ai-agent-safely/"
        },
        {
          "title": "Agent 平台怎么选？含腾讯元器迁移、企业管控与发布方式",
          "url": "https://www.yingxueyuan.cn/docs/choose-agent-builder/"
        }
      ],
      "relatedTools": [
        {
          "name": "Dify",
          "url": "https://www.yingxueyuan.cn/tools/dify/",
          "kind": "ai-product-entry"
        },
        {
          "name": "LangGraph",
          "url": "https://www.yingxueyuan.cn/tools/langgraph/",
          "kind": "ai-product-entry"
        },
        {
          "name": "CrewAI",
          "url": "https://www.yingxueyuan.cn/tools/crewai/",
          "kind": "ai-product-entry"
        }
      ],
      "sources": [
        {
          "label": "Dify 官方：新版 Agent 搭建教程",
          "url": "https://dify.ai/blog/build-your-first-agent-in-dify"
        },
        {
          "label": "Dify 官方：新版 Agent 发布及 Beta 说明",
          "url": "https://dify.ai/blog/a-new-chapter-for-dify-agent"
        },
        {
          "label": "Dify 官方：Workflow Studio 与人工审核、发布方式",
          "url": "https://dify.ai/workflows"
        },
        {
          "label": "Dify 官方平台与部署入口",
          "url": "https://dify.ai/"
        }
      ],
      "sections": [
        {
          "id": "choose-agent-or-workflow",
          "heading": "先判断任务需要 Agent，还是固定工作流",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#choose-agent-or-workflow",
          "paragraphs": [
            "如果任务需要根据输入判断下一步、按需选择工具，可以先尝试 Agent；如果步骤、分支和输出格式都能预先写清，固定工作流通常更容易检查和复现。复杂流程也可以把 Agent 作为其中一个执行环节。不要为了“用 Agent”把本来确定的流程交给模型自由发挥。"
          ],
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "define-task",
          "heading": "先写清 Agent 的工作范围和完成标准",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#define-task",
          "paragraphs": [
            "任务越具体，后续测试越容易。比如“帮助团队做研究”太宽泛；可以改成“根据我提供的三个公开网页，提取产品名称、发布时间与原文链接，无法确认的字段标注未知，不要访问登录账户”。"
          ],
          "prompt": "我要创建一个用于【场景】的 Dify Agent。\n主要用户：【谁会使用】\n重复任务：【Agent 要完成的具体工作】\n输入：【用户会提供什么资料】\n期望结果：【输出格式与质量标准】\n允许使用的资料/工具：【仅列已获准接入的内容】\n禁止事项：【不可执行的动作、不能推断的事实】\n遇到信息不足时：【先提问 / 标记未知 / 暂停并等待确认】\n请先复述任务边界并指出缺少的信息，不要直接连接账号或执行外部操作。",
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "build-agent",
          "heading": "用 Build 模式起步，并审阅生成的配置",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#build-agent",
          "paragraphs": [],
          "bullets": [
            "在 Dify 中进入 Agents 并创建空白 Agent；为它填写容易识别的名称和用途描述。",
            "选择当前账号可用的模型。Dify 官方教程建议考虑推理和原生工具调用能力；实际适配情况仍要用你的任务测试。",
            "用自然语言描述任务，让 Build 模式协助整理初始配置。官方教程提到可能生成 Skill 与 Build Note；应用变更前先检查草稿，有误就继续修改或放弃。",
            "只在反复出现的信息缺口确实需要固定资料时再上传文件，并确认资料获准进入所选服务。"
          ],
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "tools-and-auth",
          "heading": "逐个增加工具，不要一次开放所有权限",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#tools-and-auth",
          "paragraphs": [
            "需要检索或调用外部服务时，可从 Dify Marketplace 查找工具。官方教程提醒，部分工具需要单独授权；只连接当前任务必需的能力，并先弄清它会读取、发送或写入什么。把凭据当作密钥管理，不要粘贴到公开提示词、网页或共享对话中。"
          ],
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "test-agent",
          "heading": "先在 Build 和 Preview 中分别测试",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#test-agent",
          "paragraphs": [],
          "bullets": [
            "Build 模式用于检查 Agent 如何理解任务及调整配置；Preview 模式用于按保存后的配置模拟普通用户使用。",
            "至少测试三类输入：信息完整的正常任务、缺少关键材料的任务、含冲突要求或超出范围的任务。",
            "检查工具调用是否必要、使用的数据是否符合授权范围、来源是否可追溯、遇到未知信息时是否会暂停或标注。",
            "确认结果达到标准前，不要发布给真实客户，也不要连接正式账号或敏感数据。"
          ],
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "publish-agent",
          "heading": "根据使用场景选择发布入口",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#publish-agent",
          "paragraphs": [
            "Dify 官方教程介绍了将 Agent 发布为网页应用、嵌入网站或生成 API，也可以把它作为 Agent 节点加入工作流。工作流页面还列出托管应用、API、MCP-compatible tool 和模板等交付方式。具体入口取决于你创建的产物、账号与当前版本；面向外部用户前，应另行检查鉴权、用量、成本、日志和人工确认机制。"
          ],
          "sources": [],
          "editorialNote": false
        },
        {
          "id": "limits-and-checklist",
          "heading": "上线前快速核对",
          "detailsUrl": "https://www.yingxueyuan.cn/docs/create-agent-with-dify/#limits-and-checklist",
          "paragraphs": [],
          "bullets": [
            "Agent 的任务边界、输入要求和失败时行为是否写清楚？",
            "每个接入工具是否必要；凭据、文件和用户数据的访问范围是否最小？",
            "正常、缺失信息、冲突要求和越权请求是否都做过测试？",
            "网页/API 的鉴权、分享范围、额度、费用及 Beta 状态是否已在当前账号核实？",
            "是否有查看执行记录、发现错误和撤销/关闭入口的负责人？"
          ],
          "note": "Dify 新版 Agent 官方发布资料将其标注为 Beta。本文按 2026-10-02 可查的官方资料整理，不代表映雪网实测或对任何模型、工作区和部署方式的保证。涉及敏感数据或外部副作用时，先在隔离测试环境验证。",
          "sources": [],
          "editorialNote": false
        }
      ]
    }
  ]
}
