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>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-11 05:37:06 +00:00
committed by JeffJiang
parent 716cae20c6
commit 814a488bcb
54 changed files with 4890 additions and 37 deletions
@@ -0,0 +1,21 @@
import type { MetaRecord } from "nextra";
const meta: MetaRecord = {
"first-conversation": {
title: "第一次对话",
},
"create-your-first-harness": {
title: "创建你的第一个 Harness",
},
"use-tools-and-skills": {
title: "使用工具和技能",
},
"work-with-memory": {
title: "使用记忆系统",
},
"deploy-your-own-deerflow": {
title: "部署你的 DeerFlow",
},
};
export default meta;
@@ -0,0 +1,83 @@
# 创建你的第一个 Harness
本教程介绍如何以编程方式使用 DeerFlow Harness Python SDK——直接在你的 Python 代码中导入和使用 DeerFlow,而不是通过 Web 界面。
## 前置条件
- Python 3.12+
- 已安装 `uv`
- 已克隆 DeerFlow 仓库
## 安装
```bash
cd deer-flow/backend
uv sync
```
## 创建配置
创建一个最小的 `config.yaml`
```yaml
config_version: 6
models:
- name: gpt-4o
use: langchain_openai:ChatOpenAI
model: gpt-4o
api_key: $OPENAI_API_KEY
sandbox:
use: deerflow.sandbox.local:LocalSandboxProvider
tools:
- use: deerflow.community.ddg_search.tools:web_search_tool
- use: deerflow.sandbox.tools:read_file_tool
- use: deerflow.sandbox.tools:write_file_tool
```
## 编写代码
创建 `my_agent.py`
```python
import asyncio
import os
from deerflow.client import DeerFlowClient
from deerflow.config import load_config
# 设置 API Key
os.environ["OPENAI_API_KEY"] = "sk-..."
# 加载配置
load_config()
client = DeerFlowClient()
async def main():
async for event in client.astream(
thread_id="my-first-thread",
message="用 Python 写一个斐波那契数列函数,包含文档字符串",
config={
"configurable": {
"model_name": "gpt-4o",
}
},
):
print(event)
asyncio.run(main())
```
## 运行
```bash
cd backend
uv run python my_agent.py
```
## 下一步
- [使用工具和技能](/docs/tutorials/use-tools-and-skills)
- [快速上手](/docs/harness/quick-start)
@@ -0,0 +1,67 @@
# 部署你的 DeerFlow
本教程引导你将 DeerFlow 部署到生产环境,使用 Docker Compose 进行多用户访问。
## 前置条件
- 已安装 Docker 和 Docker Compose
- 服务器或 VMLinux 推荐)
- LLM API Key
## 步骤
### 1. 克隆仓库
```bash
git clone https://github.com/bytedance/deer-flow.git
cd deer-flow
```
### 2. 创建配置文件
```bash
cp config.example.yaml config.yaml
```
编辑 `config.yaml` 添加你的模型配置。
### 3. 创建环境变量文件
```bash
cat > .env << EOF
OPENAI_API_KEY=sk-your-key-here
DEER_FLOW_ROOT=$(pwd)
BETTER_AUTH_SECRET=$(openssl rand -base64 32)
BETTER_AUTH_URL=https://your-domain.com
EOF
```
### 4. 启动服务
```bash
docker compose -f docker/docker-compose-dev.yaml up -d
```
### 5. 验证部署
```bash
# 检查所有服务健康状态
curl http://localhost:2026/api/models
# 查看服务日志
docker compose -f docker/docker-compose-dev.yaml logs -f
```
访问 `http://your-server:2026` 开始使用。
## 生产注意事项
- 为 nginx 配置 HTTPS/TLS 证书
- 将 `BETTER_AUTH_SECRET` 设置为强随机字符串
- 配置防火墙只允许必要端口
- 定期备份 `backend/.deer-flow/` 目录
## 下一步
- [部署指南(完整版)](/docs/application/deployment-guide)
- [运维与排障](/docs/application/operations-and-troubleshooting)
@@ -0,0 +1,43 @@
# 第一次对话
本教程引导你在 DeerFlow 中完成第一次完整的 Agent 对话,从启动应用到与 Agent 进行实质性任务交互。
## 前置条件
- DeerFlow 应用已运行(参见[快速上手](/docs/application/quick-start)
- 至少在 `config.yaml` 中配置了一个模型
## 步骤
### 1. 打开工作区
在浏览器中访问 [http://localhost:2026](http://localhost:2026),你将看到对话工作区。
### 2. 发送第一条消息
在输入框中输入问题,例如:
```
研究 2024 年三大最受欢迎的开源大语言模型框架,并对比它们的优缺点。
```
按回车发送。
### 3. 观察 Agent 的工作过程
你将看到 Agent 进入工作状态:
- 展开**思考步骤**查看它调用了哪些工具
- 观察网络搜索结果的流入
- 等待最终报告生成
### 4. 与结果互动
报告生成后,你可以:
- 要求对某部分进行详细说明
- 要求将报告导出为文件(Agent 会使用 `present_files` 工具)
- 要求基于研究结果创建图表
## 下一步
- [使用工具和技能](/docs/tutorials/use-tools-and-skills)
- [工作区使用](/docs/application/workspace-usage)
@@ -0,0 +1,47 @@
# 使用工具和技能
本教程介绍如何在 DeerFlow 中配置和使用工具(Tools)与技能(Skills),让 Agent 能够访问搜索、文件操作和特定领域能力。
## 配置工具
在 `config.yaml` 中添加工具:
```yaml
tools:
# 网络搜索
- use: deerflow.community.ddg_search.tools:web_search_tool
# 网页内容抓取
- use: deerflow.community.jina_ai.tools:web_fetch_tool
# 沙箱文件操作
- use: deerflow.sandbox.tools:ls_tool
- use: deerflow.sandbox.tools:read_file_tool
- use: deerflow.sandbox.tools:write_file_tool
- use: deerflow.sandbox.tools:bash_tool
```
## 启用技能
通过 DeerFlow 应用界面的技能面板启用技能,或直接编辑 `extensions_config.json`。
示例:启用深度研究技能
1. 打开 DeerFlow 应用
2. 点击侧边栏中的扩展/技能图标
3. 找到 `deep-research`,切换为启用
## 使用技能进行研究
启用 `deep-research` 技能后,在对话中选择该技能,然后发送研究请求:
```
对量子计算的最新进展进行深度研究,重点关注实用化应用前景
```
Agent 将执行多步骤研究工作流,包括搜索、信息汇总和报告生成。
## 下一步
- [使用记忆系统](/docs/tutorials/work-with-memory)
- [技能文档](/docs/harness/skills)
@@ -0,0 +1,52 @@
# 使用记忆系统
本教程介绍如何在 DeerFlow 中启用和使用记忆系统,让 Agent 在多次会话中记住关于你的重要信息。
## 启用记忆
在 `config.yaml` 中启用记忆:
```yaml
memory:
enabled: true
injection_enabled: true
max_injection_tokens: 2000
debounce_seconds: 30
```
## 记忆的工作方式
记忆通过 `MemoryMiddleware` 自动工作:
1. **第一次对话**:告诉 Agent 关于你的偏好、项目或背景。
2. **自动学习**:Agent 在后台提取并保存重要事实。
3. **后续对话**:记忆事实自动注入到系统提示中,Agent 无需你重新解释背景。
## 示例
**第一次对话**
```
我是一名 Python 后端开发者,主要使用 FastAPI 和 PostgreSQL。
我的团队遵循 PEP 8 代码规范,偏好类型注解。
请记住这些信息,在以后的代码建议中遵循这些规范。
```
**后续对话**(无需重复背景):
```
帮我写一个用户认证模块
```
Agent 会自动生成符合 FastAPI 风格、带类型注解的代码。
## 查看记忆
记忆存储在 `backend/.deer-flow/memory.json`,你可以直接查看和编辑:
```bash
cat backend/.deer-flow/memory.json
```
## 下一步
- [部署你的 DeerFlow](/docs/tutorials/deploy-your-own-deerflow)
- [记忆系统文档](/docs/harness/memory)