# Extending DeerFlow: Theory, Architecture and Source Code Analysis

A Chinese-language technical book that explains the DeerFlow 2.0 agent framework's architecture and source code in depth, aimed at developers who want to extend or customize it.

This book walks through the DeerFlow 2.0 agent framework from theory to source code, aimed at developers doing secondary development on top of it. Every code example is drawn from the actual DeerFlow source so it stays consistent with the real implementation.

Chapters cover core concepts such as Skill versus Tool, sub-agents, sandboxes, memory and context engineering, then move to source-level analysis of the agent core's state system and middleware, the skill security scanner and installer, the sub-agent executor and task state machine, the sandbox provider model, the memory system's profile storage and prompt injection, and MCP server integration including OAuth2 authentication and tool caching. A quick-start section shows running DeerFlow itself with Docker Compose to try the framework alongside the book.

Website: https://hawkli-1994.github.io/deerflow-book
