copilot-swe-agent[bot] 2d5f6f1b3d docs: complete all English and Chinese documentation pages
Agent-Logs-Url: https://github.com/bytedance/deer-flow/sessions/a5f192e7-8034-4e46-af22-60b90ee27d40

Co-authored-by: foreleven <4785594+foreleven@users.noreply.github.com>
2026-04-11 16:56:32 +08:00

89 lines
3.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 代码映射
本页面将 DeerFlow 的核心概念映射到其在代码库中的实现位置,帮助你快速定位特定功能的代码。
## 后端核心路径
```
backend/
├── app/
│ └── gateway/ # FastAPI Gateway API
│ ├── routers/
│ │ ├── agents.py # 自定义 Agent CRUD
│ │ ├── extensions.py # MCP/技能启用禁用
│ │ ├── memory.py # 记忆读取/清除
│ │ ├── threads.py # 线程管理
│ │ └── uploads.py # 文件上传
│ └── main.py # FastAPI 应用入口
└── packages/harness/deerflow/
├── agents/
│ ├── lead_agent/
│ │ ├── agent.py # make_lead_agent() 工厂
│ │ └── prompt.py # 系统提示模板
│ ├── middlewares/ # 所有中间件实现
│ ├── memory/
│ │ ├── middleware.py # MemoryMiddleware
│ │ └── storage.py # 记忆文件存储
│ └── thread_state.py # ThreadState 数据类
├── config/
│ ├── app_config.py # AppConfig顶层配置
│ ├── model_config.py # ModelConfig
│ ├── paths.py # 路径解析工具
│ └── *.py # 各模块配置类
├── mcp/
│ ├── cache.py # 基于 mtime 的工具缓存
│ └── oauth.py # MCP OAuth 支持
├── models/
│ └── factory.py # create_chat_model() LLM 工厂
├── sandbox/
│ ├── local/ # LocalSandboxProvider
│ └── sandbox.py # Sandbox 基类
├── skills/
│ ├── loader.py # load_skills()(热重载)
│ ├── parser.py # SKILL.md 解析
│ ├── installer.py # 依赖安装
│ └── manager.py # 技能生命周期
├── subagents/
│ └── registry.py # 子 Agent 查找与配置覆盖
└── tools/
└── builtins/ # 内置工具实现
```
## 前端核心路径
```
frontend/src/
├── app/ # Next.js 路由
├── components/
│ └── workspace/ # 工作区 UI 组件
├── core/
│ ├── agents/ # Agent 类型和 API 客户端
│ ├── messages/ # 消息类型和工具调用处理
│ └── threads/ # 线程状态管理
└── content/ # 文档内容MDX
├── en/ # 英文文档
└── zh/ # 中文文档
```
## 关键文件快速索引
| 目标 | 文件 |
|---|---|
| Lead Agent 创建 | `agents/lead_agent/agent.py` |
| 系统提示模板 | `agents/lead_agent/prompt.py` |
| 所有中间件 | `agents/middlewares/` |
| 配置加载 | `config/app_config.py` |
| 模型工厂 | `models/factory.py` |
| 技能加载(热重载) | `skills/loader.py` |
| MCP 工具缓存 | `mcp/cache.py` |
| 文件上传处理 | `uploads/manager.py` |
| Gateway 主路由器 | `app/gateway/main.py` |