deerflow-book

作者 hawkli-1994已验证

本书围绕 DeerFlow 2.0,从理论到源码,系统讲解如何进行二次开发。(精校)

484
Stars
84
Forks
JavaScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/hawkli-1994/deerflow-book

快速入门

使用 deerflow-book 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

《DeerFlow 二次开发:理论、架构与源码剖析》

面向硬核开发者的技术深度解析

在线阅读 GitHub

本书围绕 DeerFlow 2.0,从理论到源码,系统讲解如何进行二次开发。

所有代码示例均基于真实源码,确保与 DeerFlow 实现保持一致。


🚀 开始阅读

📖 在线阅读(推荐)搜索、目录导航、代码高亮、响应式布局
📄 GitHub 阅读适合直接浏览 Markdown 源码

📚 书籍特色

  • 源码级解析 - 每一章都深入 DeerFlow 源码,不是简单的概念介绍
  • 实战导向 - 提供完整的二次开发示例,可直接用于项目
  • 架构思维 - 不仅讲 "怎么用",更讲 "为什么这样设计"
  • 持续更新 - 跟随 DeerFlow 版本迭代,保持内容最新

⚡ 5 分钟快速开始

1. Docker 一键启动

# 克隆 DeerFlow 官方仓库
git clone https://github.com/bytedance/deerflow.git
cd deerflow

# 使用 Docker Compose 启动全套服务
docker-compose up -d

# 检查服务状态
docker-compose ps

2. 第一条对话测试

启动后,打开浏览器访问 http://localhost:2026,在对话窗口中输入:

@web-researcher 请研究 "LangGraph 的 checkpoint 机制",深度:技术细节级别,输出格式:Markdown 报告

DeerFlow 会自动加载 web-researcher Skill,执行网络搜索、信息整合,并返回结构化的研究报告。

3. 环境变量配置

复制配置文件模板并根据需要调整:

cp config.example.yaml config.yaml
cp extensions_config.example.json extensions_config.json

核心环境变量:

变量说明必填
OPENAI_API_KEYLLM API Key
DEERFLOW_DATABASE_URLPostgreSQL 连接串
SANDBOX_MODElocal / docker / provisioner可选,默认 local
MCP_SERVERS_CONFIGMCP Server 配置文件路径可选

详见 附录 A · 配置参考


📖 目录结构

第一部分:理论基础

章节内容亮点
第一章 · 引言DeerFlow 定位、核心特性、技术栈
第二章 · 核心概念Skill vs Tool、Sub-Agent、Sandbox、Memory、Context Engineering
第三章 · 架构总览系统架构图、LangGraph Server、Gateway API、中间件链

第二部分:源码剖析 ⭐️

章节内容亮点源码文件
第四章 · 项目结构目录组织、模块职责、配置体系-
第五章 · Agent 核心ThreadState 类型系统14+ 中间件详解DeerFlowClient SDKagents/thread_state.py, agents/middlewares/
第六章 · Skills 与 ToolsSkill 安全扫描历史管理安装器实现skills/security_scanner.py, skills/manager.py, skills/installer.py
第七章 · Sub-Agent 体系SubagentExecutor任务状态机背景任务管理subagents/executor.py, subagents/config.py
第八章 · Sandbox 环境Provider 模式中间件生命周期安全审计sandbox/sandbox_provider.py, sandbox/middleware.py, sandbox/security.py
第九章 · Memory 系统JSON Profile/FactsLLM 更新MemoryMiddlewarePrompt 注入agents/memory/storage.py, agents/memory/updater.py, agents/middlewares/memory_middleware.py
第十章 · Context Engineering上下文压缩、RAG、Token 预算分配-

第三部分:二次开发实战 ⭐️

章节内容亮点源码文件
第十一章 · MCP Server 集成OAuth 2.0 认证工具缓存多传输方式 (stdio/sse/http)mcp/oauth.py, mcp/cache.py, mcp/client.py
第十二章 · 自定义 Skill 开发多模态输出 Skill(PPT/播客/图片/视频/看板)-
第十三章 · Human-in-the-Loop审批节点设计、审批中间件、审计日志-
第十四章 · 企业级应用案例多租户隔离、RBAC、审计系统、多模态内容平台、知识库集成-

附录

✅ 标记表示本章已基于 DeerFlow 最新源码进行深度更新


🎯 阅读建议

不同读者的阅读路径

🆕 Agent 开发新手

第一章 → 第二章 → 第三章 → 第十二章 (快速上手 Skill 开发)

🔧 二次开发工程师

第四章 → 第五章 → 第六章 → 第七章 → 第十一章 (核心架构)

🏢 企业级应用开发者

第五章 → 第八章 → 第九章 → 第十三章 → 第十四章 (生产环境)

🔬 源码贡献者

通读全书 + 附录 B + 直接阅读 DeerFlow 源码

📋 阅读前置要求

  • Python 3.12+ - 熟悉类型注解、异步编程
  • LangChain / LangGraph - 了解基本概念(Graph、State、Node)
  • Agent / LLM 应用开发 - 有实际项目经验更佳
  • Docker - 理解容器基础(用于 Sandbox 章节)

🔄 最新更新

2026-06-21 重大更新

基于 DeerFlow 2.0 当前源码,对 Memory 相关内容进行了校正:

章节更新内容
Chapter 02明确内置 Memory 不使用 embedding、向量数据库或相似度检索
Chapter 09重写 Memory 系统章节,改为 JSON profile/facts、LLM 更新、MemoryMiddleware、prompt 注入
Chapter 10将 Memory 检索示例改为 JSON facts 注入,并区分外部 RAG 扩展
Appendix A/D更新 Memory 配置与术语解释

2026-05-02 重大更新

基于 DeerFlow 2.0 最新版本进展(2026 年 4 月),对以下章节进行了更新:

章节更新内容
Chapter 01新增核心特性:Progressive Skill Loading、InfoQuest、多模态输出
Chapter 03新增渐进式 Skill 加载在架构中的位置(3.9 节)
Chapter 06新增渐进式 Skill 加载机制、InfoQuest 集成
Chapter 12新增多模态输出 Skill 开发(PPT/播客/图片/视频/看板)
Chapter 14新增企业级多模态内容生成平台(14.9 节)

2026-04-09 重大更新

基于 DeerFlow 最新源码,对以下章节进行了深度更新:

章节更新内容
Chapter 05新增 ThreadState 类型系统 (NotRequired/Annotated)、14+ 中间件完整列表、DeerFlowClient SDK
Chapter 06新增 Skill 安全扫描、历史管理、安装器实现
Chapter 07新增 SubagentExecutor、任务状态机、背景任务管理
Chapter 08新增 Sandbox Provider 模式、中间件生命周期、安全审计
Chapter 11新增 OAuth 2.0 认证、MCP 工具缓存、多传输方式

🤝 参与贡献

本书是开源的,欢迎提交 PR:

  1. 内容修正 - 发现与源码不符的地方
  2. 章节补充 - 增加新的源码解析
  3. 示例代码 - 提供更清晰的代码示例
  4. 翻译 - 翻译成其他语言

详见 附录 B · 贡献指南


📌 版本信息

  • DeerFlow 版本: 2.0
  • 书籍版本: 2026.06
  • 最后更新: 2026-06-21

📄 许可证

本书采用 MIT 许可证 开源。

DeerFlow 是 ByteDance 的开源项目,本书为社区贡献的二次开发指南。

常见问题

What is deerflow-book?

deerflow-book is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by hawkli-1994. 本书围绕 DeerFlow 2.0,从理论到源码,系统讲解如何进行二次开发。(精校). It has 484 GitHub stars.

Is deerflow-book safe to use?

Yes. deerflow-book passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install deerflow-book?

Clone the repository with "git clone https://github.com/hawkli-1994/deerflow-book" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is deerflow-book written in?

deerflow-book is primarily written in JavaScript. It is open-source under hawkli-1994 on GitHub, so you can review or fork the full source.

Are there alternatives to deerflow-book?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh deerflow-book against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情