mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-24 17:06:00 +00:00
fix the lint errors in frontend
This commit is contained in:
@@ -12,7 +12,7 @@ DeerFlow App is configured through two files and a set of environment variables.
|
|||||||
## Configuration files
|
## Configuration files
|
||||||
|
|
||||||
| File | Purpose |
|
| File | Purpose |
|
||||||
|---|---|
|
| ------------------------ | --------------------------------------------------------------------------------------- |
|
||||||
| `config.yaml` | Backend configuration: models, sandbox, tools, skills, memory, and all Harness settings |
|
| `config.yaml` | Backend configuration: models, sandbox, tools, skills, memory, and all Harness settings |
|
||||||
| `extensions_config.json` | MCP servers and skill enable/disable state (managed by the App UI and Gateway API) |
|
| `extensions_config.json` | MCP servers and skill enable/disable state (managed by the App UI and Gateway API) |
|
||||||
|
|
||||||
@@ -144,6 +144,7 @@ sandbox:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Install: `cd backend && uv add 'deerflow-harness[aio-sandbox]'`
|
Install: `cd backend && uv add 'deerflow-harness[aio-sandbox]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -225,7 +226,7 @@ memory:
|
|||||||
Set these before running `pnpm build` or starting the frontend in production:
|
Set these before running `pnpm build` or starting the frontend in production:
|
||||||
|
|
||||||
| Variable | Required | Description |
|
| Variable | Required | Description |
|
||||||
|---|---|---|
|
| --------------------- | -------------------------- | ---------------------------------------------------------------- |
|
||||||
| `BETTER_AUTH_SECRET` | **Required** in production | Secret for session signing. Use `openssl rand -base64 32`. |
|
| `BETTER_AUTH_SECRET` | **Required** in production | Secret for session signing. Use `openssl rand -base64 32`. |
|
||||||
| `BETTER_AUTH_URL` | Recommended | Public-facing base URL (e.g., `https://your-domain.com`) |
|
| `BETTER_AUTH_URL` | Recommended | Public-facing base URL (e.g., `https://your-domain.com`) |
|
||||||
| `SKIP_ENV_VALIDATION` | Optional | Set to `1` to skip env validation during build (not recommended) |
|
| `SKIP_ENV_VALIDATION` | Optional | Set to `1` to skip env validation during build (not recommended) |
|
||||||
@@ -268,6 +269,12 @@ make config-upgrade
|
|||||||
```
|
```
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Deployment Guide" href="/docs/application/deployment-guide" />
|
<Cards.Card
|
||||||
<Cards.Card title="Harness Configuration" href="/docs/harness/configuration" />
|
title="Deployment Guide"
|
||||||
|
href="/docs/application/deployment-guide"
|
||||||
|
/>
|
||||||
|
<Cards.Card
|
||||||
|
title="Harness Configuration"
|
||||||
|
href="/docs/harness/configuration"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ DeerFlow App is the reference implementation of what a production DeerFlow exper
|
|||||||
## What the App provides
|
## What the App provides
|
||||||
|
|
||||||
| Capability | Description |
|
| Capability | Description |
|
||||||
|---|---|
|
| ----------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
| **Web workspace** | Browser-based conversation UI with support for threads, artifacts, file uploads, and skill selection |
|
| **Web workspace** | Browser-based conversation UI with support for threads, artifacts, file uploads, and skill selection |
|
||||||
| **Custom agents** | Create and manage named agents with different models, skills, and tool sets |
|
| **Custom agents** | Create and manage named agents with different models, skills, and tool sets |
|
||||||
| **Thread management** | Persistent conversation threads with checkpointing and history |
|
| **Thread management** | Persistent conversation threads with checkpointing and history |
|
||||||
@@ -59,7 +59,7 @@ The DeerFlow App runs as four services behind a single nginx reverse proxy:
|
|||||||
## Technology stack
|
## Technology stack
|
||||||
|
|
||||||
| Layer | Technology |
|
| Layer | Technology |
|
||||||
|---|---|
|
| ----------------- | -------------------------------------------------------------------- |
|
||||||
| Frontend | Next.js 16, React 19, TypeScript, pnpm |
|
| Frontend | Next.js 16, React 19, TypeScript, pnpm |
|
||||||
| Gateway | FastAPI, Python 3.12, uvicorn |
|
| Gateway | FastAPI, Python 3.12, uvicorn |
|
||||||
| Agent runtime | LangGraph, LangChain, DeerFlow Harness |
|
| Agent runtime | LangGraph, LangChain, DeerFlow Harness |
|
||||||
@@ -68,5 +68,8 @@ The DeerFlow App runs as four services behind a single nginx reverse proxy:
|
|||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Quick Start" href="/docs/application/quick-start" />
|
<Cards.Card title="Quick Start" href="/docs/application/quick-start" />
|
||||||
<Cards.Card title="Deployment Guide" href="/docs/application/deployment-guide" />
|
<Cards.Card
|
||||||
|
title="Deployment Guide"
|
||||||
|
href="/docs/application/deployment-guide"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ This page covers day-to-day operational tasks and solutions to common problems w
|
|||||||
All services write logs to the `logs/` directory when started with `make dev`:
|
All services write logs to the `logs/` directory when started with `make dev`:
|
||||||
|
|
||||||
| File | Service |
|
| File | Service |
|
||||||
|---|---|
|
| -------------------- | ------------------------------------ |
|
||||||
| `logs/langgraph.log` | LangGraph / DeerFlow Harness runtime |
|
| `logs/langgraph.log` | LangGraph / DeerFlow Harness runtime |
|
||||||
| `logs/gateway.log` | FastAPI Gateway API |
|
| `logs/gateway.log` | FastAPI Gateway API |
|
||||||
| `logs/frontend.log` | Next.js frontend dev server |
|
| `logs/frontend.log` | Next.js frontend dev server |
|
||||||
@@ -171,6 +171,9 @@ make dev
|
|||||||
Individual service restart scripts are in `scripts/`. For targeted restarts, you can kill and relaunch individual processes manually using the PIDs in the log files.
|
Individual service restart scripts are in `scripts/`. For targeted restarts, you can kill and relaunch individual processes manually using the PIDs in the log files.
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Deployment Guide" href="/docs/application/deployment-guide" />
|
<Cards.Card
|
||||||
|
title="Deployment Guide"
|
||||||
|
href="/docs/application/deployment-guide"
|
||||||
|
/>
|
||||||
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ make check
|
|||||||
Required:
|
Required:
|
||||||
|
|
||||||
| Tool | Minimum version |
|
| Tool | Minimum version |
|
||||||
|---|---|
|
| ------- | ------------------ |
|
||||||
| Python | 3.12 |
|
| Python | 3.12 |
|
||||||
| uv | latest |
|
| uv | latest |
|
||||||
| Node.js | 22 |
|
| Node.js | 22 |
|
||||||
@@ -87,6 +87,7 @@ make dev
|
|||||||
```
|
```
|
||||||
|
|
||||||
This starts:
|
This starts:
|
||||||
|
|
||||||
- LangGraph server on port `2024`
|
- LangGraph server on port `2024`
|
||||||
- Gateway API on port `8001`
|
- Gateway API on port `8001`
|
||||||
- Frontend on port `3000`
|
- Frontend on port `3000`
|
||||||
@@ -111,7 +112,7 @@ make stop
|
|||||||
Log files:
|
Log files:
|
||||||
|
|
||||||
| Service | Log file |
|
| Service | Log file |
|
||||||
|---|---|
|
| --------- | -------------------- |
|
||||||
| LangGraph | `logs/langgraph.log` |
|
| LangGraph | `logs/langgraph.log` |
|
||||||
| Gateway | `logs/gateway.log` |
|
| Gateway | `logs/gateway.log` |
|
||||||
| Frontend | `logs/frontend.log` |
|
| Frontend | `logs/frontend.log` |
|
||||||
@@ -124,6 +125,9 @@ Log files:
|
|||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Deployment Guide" href="/docs/application/deployment-guide" />
|
<Cards.Card
|
||||||
|
title="Deployment Guide"
|
||||||
|
href="/docs/application/deployment-guide"
|
||||||
|
/>
|
||||||
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ If you have created custom agents, use the **Agent** selector in the input bar t
|
|||||||
Custom agents may have different models, skills, tool sets, and system prompts. See [Agents and Threads](/docs/application/agents-and-threads) for how to create and manage custom agents.
|
Custom agents may have different models, skills, tool sets, and system prompts. See [Agents and Threads](/docs/application/agents-and-threads) for how to create and manage custom agents.
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Agents and Threads" href="/docs/application/agents-and-threads" />
|
<Cards.Card
|
||||||
|
title="Agents and Threads"
|
||||||
|
href="/docs/application/agents-and-threads"
|
||||||
|
/>
|
||||||
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
<Cards.Card title="Configuration" href="/docs/application/configuration" />
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ This merges new fields from `config.example.yaml` into your existing `config.yam
|
|||||||
The following table maps each top-level `config.yaml` section to its documentation page:
|
The following table maps each top-level `config.yaml` section to its documentation page:
|
||||||
|
|
||||||
| Section | Description | Documentation |
|
| Section | Description | Documentation |
|
||||||
|---|---|---|
|
| ----------------- | ------------------------------------------------ | -------------------------------------------------------- |
|
||||||
| `log_level` | Logging level (`debug`/`info`/`warning`/`error`) | — |
|
| `log_level` | Logging level (`debug`/`info`/`warning`/`error`) | — |
|
||||||
| `models` | Available LLM models | [Lead Agent](/docs/harness/lead-agent) |
|
| `models` | Available LLM models | [Lead Agent](/docs/harness/lead-agent) |
|
||||||
| `token_usage` | Token tracking per model call | [Middlewares](/docs/harness/middlewares) |
|
| `token_usage` | Token tracking per model call | [Middlewares](/docs/harness/middlewares) |
|
||||||
@@ -157,6 +157,12 @@ tools:
|
|||||||
Start from `config.example.yaml` in the repository root and uncomment the sections you need.
|
Start from `config.example.yaml` in the repository root and uncomment the sections you need.
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Deployment Guide" href="/docs/application/deployment-guide" />
|
<Cards.Card
|
||||||
<Cards.Card title="Application Configuration" href="/docs/application/configuration" />
|
title="Deployment Guide"
|
||||||
|
href="/docs/application/deployment-guide"
|
||||||
|
/>
|
||||||
|
<Cards.Card
|
||||||
|
title="Application Configuration"
|
||||||
|
href="/docs/application/configuration"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ guardrails:
|
|||||||
For custom guardrail logic, implement a class with `evaluate()` and `aevaluate()` methods and reference it via `use:`.
|
For custom guardrail logic, implement a class with `evaluate()` and `aevaluate()` methods and reference it via `use:`.
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Integration Guide" href="/docs/harness/integration-guide" />
|
<Cards.Card
|
||||||
|
title="Integration Guide"
|
||||||
|
href="/docs/harness/integration-guide"
|
||||||
|
/>
|
||||||
<Cards.Card title="Configuration" href="/docs/harness/configuration" />
|
<Cards.Card title="Configuration" href="/docs/harness/configuration" />
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ Environment variable interpolation (`api_key: $OPENAI_API_KEY`) keeps secrets ou
|
|||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
| Principle | What it means in practice |
|
| Principle | What it means in practice |
|
||||||
|---|---|
|
| --------------------------- | -------------------------------------------------------------- |
|
||||||
| Harness, not framework | Ready-to-run runtime with all the infrastructure already wired |
|
| Harness, not framework | Ready-to-run runtime with all the infrastructure already wired |
|
||||||
| Long-horizon first | Architecture assumes multi-step, multi-tool, multi-turn tasks |
|
| Long-horizon first | Architecture assumes multi-step, multi-tool, multi-turn tasks |
|
||||||
| Middleware over inheritance | Behavior is composed from small, isolated plugins |
|
| Middleware over inheritance | Behavior is composed from small, isolated plugins |
|
||||||
|
|||||||
@@ -141,9 +141,9 @@ The same Lead Agent runtime powers both the default agent and any custom agents
|
|||||||
Custom agents are created through the DeerFlow App UI or via the `/api/agents` endpoint. Their configuration is stored in `agents/{name}/config.yaml` relative to the backend directory.
|
Custom agents are created through the DeerFlow App UI or via the `/api/agents` endpoint. Their configuration is stored in `agents/{name}/config.yaml` relative to the backend directory.
|
||||||
|
|
||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
When a custom agent is selected in a thread, the Lead Agent loads that
|
When a custom agent is selected in a thread, the Lead Agent loads that agent's
|
||||||
agent's config at runtime. Switching models or skills for a specific agent
|
config at runtime. Switching models or skills for a specific agent does not
|
||||||
does not require restarting the server.
|
require restarting the server.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## Bootstrap mode
|
## Bootstrap mode
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ The default location is the project root (same directory as `config.yaml`). The
|
|||||||
```
|
```
|
||||||
|
|
||||||
Each server entry supports:
|
Each server entry supports:
|
||||||
|
|
||||||
- `command`: the executable to run (e.g., `npx`, `uvx`, `python`)
|
- `command`: the executable to run (e.g., `npx`, `uvx`, `python`)
|
||||||
- `args`: command arguments as an array
|
- `args`: command arguments as an array
|
||||||
- `enabled`: whether the server is active (can be toggled without removing the entry)
|
- `enabled`: whether the server is active (can be toggled without removing the entry)
|
||||||
@@ -92,6 +93,7 @@ With tool search enabled, MCP tools are listed by name in the system prompt but
|
|||||||
Some MCP servers require OAuth authentication. DeerFlow's `mcp/oauth.py` handles the OAuth flow for servers that declare OAuth requirements in their capability headers.
|
Some MCP servers require OAuth authentication. DeerFlow's `mcp/oauth.py` handles the OAuth flow for servers that declare OAuth requirements in their capability headers.
|
||||||
|
|
||||||
When an OAuth-protected MCP server is connected, DeerFlow will:
|
When an OAuth-protected MCP server is connected, DeerFlow will:
|
||||||
|
|
||||||
1. Detect the OAuth requirement from the server's capability headers
|
1. Detect the OAuth requirement from the server's capability headers
|
||||||
2. Build the appropriate authorization headers using `get_initial_oauth_headers()`
|
2. Build the appropriate authorization headers using `get_initial_oauth_headers()`
|
||||||
3. Wrap tool calls with an OAuth interceptor via `build_oauth_tool_interceptor()`
|
3. Wrap tool calls with an OAuth interceptor via `build_oauth_tool_interceptor()`
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ summarization:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Trigger types**:
|
**Trigger types**:
|
||||||
|
|
||||||
- `tokens`: triggers when the total token count in the conversation exceeds `value`.
|
- `tokens`: triggers when the total token count in the conversation exceeds `value`.
|
||||||
- `messages`: triggers when the number of messages exceeds `value`.
|
- `messages`: triggers when the number of messages exceeds `value`.
|
||||||
- `fraction`: triggers when the context reaches `value` fraction of the model's maximum input token limit.
|
- `fraction`: triggers when the context reaches `value` fraction of the model's maximum input token limit.
|
||||||
@@ -189,6 +190,7 @@ summarization:
|
|||||||
Multiple triggers can be listed; summarization runs when **any** of them fires.
|
Multiple triggers can be listed; summarization runs when **any** of them fires.
|
||||||
|
|
||||||
**Keep types**:
|
**Keep types**:
|
||||||
|
|
||||||
- `messages`: keep the last `value` messages after summarization.
|
- `messages`: keep the last `value` messages after summarization.
|
||||||
- `tokens`: keep up to `value` tokens of recent history.
|
- `tokens`: keep up to `value` tokens of recent history.
|
||||||
- `fraction`: keep up to `value` fraction of the model's max input token limit.
|
- `fraction`: keep up to `value` fraction of the model's max input token limit.
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ agent = create_deerflow_agent(
|
|||||||
Common parameters:
|
Common parameters:
|
||||||
|
|
||||||
| Parameter | Description |
|
| Parameter | Description |
|
||||||
|---|---|
|
| ------------------ | ----------------------------------------------- |
|
||||||
| `tools` | Additional tools available to the agent |
|
| `tools` | Additional tools available to the agent |
|
||||||
| `system_prompt` | Custom system prompt |
|
| `system_prompt` | Custom system prompt |
|
||||||
| `features` | Enable or replace built-in runtime features |
|
| `features` | Enable or replace built-in runtime features |
|
||||||
@@ -109,7 +109,10 @@ Use `DeerFlowClient` when you want the higher-level embedded app interface, such
|
|||||||
## Next steps
|
## Next steps
|
||||||
|
|
||||||
<Cards num={3}>
|
<Cards num={3}>
|
||||||
<Cards.Card title="Design Principles" href="/docs/harness/design-principles" />
|
<Cards.Card
|
||||||
|
title="Design Principles"
|
||||||
|
href="/docs/harness/design-principles"
|
||||||
|
/>
|
||||||
<Cards.Card title="Lead Agent" href="/docs/harness/lead-agent" />
|
<Cards.Card title="Lead Agent" href="/docs/harness/lead-agent" />
|
||||||
<Cards.Card title="Configuration" href="/docs/harness/configuration" />
|
<Cards.Card title="Configuration" href="/docs/harness/configuration" />
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { Callout, Cards, Tabs } from "nextra/components";
|
|||||||
|
|
||||||
<Callout type="info" emoji="📦">
|
<Callout type="info" emoji="📦">
|
||||||
The sandbox is the isolated workspace where the agent does file and
|
The sandbox is the isolated workspace where the agent does file and
|
||||||
command-based work. It is what makes DeerFlow capable of real action, not
|
command-based work. It is what makes DeerFlow capable of real action, not just
|
||||||
just conversation.
|
conversation.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
The sandbox gives the Lead Agent a controlled environment where it can read files, write outputs, run shell commands, and produce artifacts. Without a sandbox, the agent can only generate text. With a sandbox, it can write and execute code, process data files, generate charts, and build deliverables.
|
The sandbox gives the Lead Agent a controlled environment where it can read files, write outputs, run shell commands, and produce artifacts. Without a sandbox, the agent can only generate text. With a sandbox, it can write and execute code, process data files, generate charts, and build deliverables.
|
||||||
@@ -84,7 +84,7 @@ The provisioner service is included in `docker/docker-compose-dev.yaml` and mana
|
|||||||
The sandbox uses path mappings to bridge the host filesystem and the container's virtual filesystem. Two key mappings are always configured:
|
The sandbox uses path mappings to bridge the host filesystem and the container's virtual filesystem. Two key mappings are always configured:
|
||||||
|
|
||||||
| Host path | Container path | Access |
|
| Host path | Container path | Access |
|
||||||
|---|---|---|
|
| ------------------------------------------- | -------------------------------------------- | ---------- |
|
||||||
| `skills/` (from `skills.path`) | `/mnt/skills` (from `skills.container_path`) | Read-only |
|
| `skills/` (from `skills.path`) | `/mnt/skills` (from `skills.container_path`) | Read-only |
|
||||||
| `.deer-flow/threads/{thread_id}/user-data/` | `/mnt/user-data/` | Read-write |
|
| `.deer-flow/threads/{thread_id}/user-data/` | `/mnt/user-data/` | Read-write |
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ The `SKILL.md` file is the authoritative definition of the skill. It is parsed b
|
|||||||
DeerFlow ships with the following public skills:
|
DeerFlow ships with the following public skills:
|
||||||
|
|
||||||
| Skill | Description |
|
| Skill | Description |
|
||||||
|---|---|
|
| ------------------------------ | -------------------------------------------------------------------------------- |
|
||||||
| `deep-research` | Multi-step research with source gathering, cross-checking, and structured output |
|
| `deep-research` | Multi-step research with source gathering, cross-checking, and structured output |
|
||||||
| `data-analysis` | Data exploration, statistical analysis, and insight generation |
|
| `data-analysis` | Data exploration, statistical analysis, and insight generation |
|
||||||
| `chart-visualization` | Chart and graph creation from data |
|
| `chart-visualization` | Chart and graph creation from data |
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ The Lead Agent invokes ACP agents through the `invoke_acp_agent` built-in tool.
|
|||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
ACP agents run as child processes managed by DeerFlow. They communicate over
|
ACP agents run as child processes managed by DeerFlow. They communicate over
|
||||||
the ACP wire protocol. The standard CLI tools (like the plain `claude` or
|
the ACP wire protocol. The standard CLI tools (like the plain `claude` or
|
||||||
`codex` commands) are not ACP-compatible by default — use the adapter
|
`codex` commands) are not ACP-compatible by default — use the adapter packages
|
||||||
packages listed above or a compatible ACP wrapper.
|
listed above or a compatible ACP wrapper.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## Custom agents as subagents
|
## Custom agents as subagents
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ Searches for tools by name or description and loads them into the agent's contex
|
|||||||
The following tools interact with the sandbox filesystem. They require a sandbox to be configured and active.
|
The following tools interact with the sandbox filesystem. They require a sandbox to be configured and active.
|
||||||
|
|
||||||
| Tool | Description |
|
| Tool | Description |
|
||||||
|---|---|
|
| ------------- | --------------------------------------------------------------------------------- |
|
||||||
| `ls` | List files in a directory |
|
| `ls` | List files in a directory |
|
||||||
| `read_file` | Read file contents |
|
| `read_file` | Read file contents |
|
||||||
| `glob` | Find files matching a pattern |
|
| `glob` | Find files matching a pattern |
|
||||||
@@ -124,6 +124,7 @@ tools:
|
|||||||
High-quality search with structured results. Requires a [Tavily](https://tavily.com) API key.
|
High-quality search with structured results. Requires a [Tavily](https://tavily.com) API key.
|
||||||
|
|
||||||
Install: `cd backend && uv add 'deerflow-harness[tavily]'`
|
Install: `cd backend && uv add 'deerflow-harness[tavily]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -134,6 +135,7 @@ tools:
|
|||||||
Semantic search with neural retrieval. Requires an [Exa](https://exa.ai) API key.
|
Semantic search with neural retrieval. Requires an [Exa](https://exa.ai) API key.
|
||||||
|
|
||||||
Install: `cd backend && uv add 'deerflow-harness[exa]'`
|
Install: `cd backend && uv add 'deerflow-harness[exa]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -152,6 +154,7 @@ tools:
|
|||||||
Firecrawl-powered search and crawl. Requires a [Firecrawl](https://firecrawl.dev) API key.
|
Firecrawl-powered search and crawl. Requires a [Firecrawl](https://firecrawl.dev) API key.
|
||||||
|
|
||||||
Install: `cd backend && uv add 'deerflow-harness[firecrawl]'`
|
Install: `cd backend && uv add 'deerflow-harness[firecrawl]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
@@ -159,33 +162,22 @@ Install: `cd backend && uv add 'deerflow-harness[firecrawl]'`
|
|||||||
|
|
||||||
<Tabs items={["Jina AI (default)", "Exa", "InfoQuest", "Firecrawl"]}>
|
<Tabs items={["Jina AI (default)", "Exa", "InfoQuest", "Firecrawl"]}>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.jina_ai.tools:web_fetch_tool
|
||||||
tools:
|
api_key: $JINA_API_KEY # optional; anonymous usage has rate limits ```
|
||||||
- use: deerflow.community.jina_ai.tools:web_fetch_tool
|
Converts web pages to clean Markdown. Works without an API key at reduced
|
||||||
api_key: $JINA_API_KEY # optional; anonymous usage has rate limits
|
rate limits.
|
||||||
```
|
|
||||||
Converts web pages to clean Markdown. Works without an API key at reduced rate limits.
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.exa.tools:web_fetch_tool api_key:
|
||||||
tools:
|
$EXA_API_KEY ```
|
||||||
- use: deerflow.community.exa.tools:web_fetch_tool
|
|
||||||
api_key: $EXA_API_KEY
|
|
||||||
```
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.infoquest.tools:web_fetch_tool
|
||||||
tools:
|
api_key: $INFOQUEST_API_KEY ```
|
||||||
- use: deerflow.community.infoquest.tools:web_fetch_tool
|
|
||||||
api_key: $INFOQUEST_API_KEY
|
|
||||||
```
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.firecrawl.tools:web_fetch_tool
|
||||||
tools:
|
api_key: $FIRECRAWL_API_KEY ```
|
||||||
- use: deerflow.community.firecrawl.tools:web_fetch_tool
|
|
||||||
api_key: $FIRECRAWL_API_KEY
|
|
||||||
```
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ Press Enter to send.
|
|||||||
### Watch the agent work
|
### Watch the agent work
|
||||||
|
|
||||||
You will see the agent start working:
|
You will see the agent start working:
|
||||||
|
|
||||||
- Expand the **thinking steps** to see which tools it is calling
|
- Expand the **thinking steps** to see which tools it is calling
|
||||||
- Watch search results stream in
|
- Watch search results stream in
|
||||||
- Wait for the final report to be generated
|
- Wait for the final report to be generated
|
||||||
@@ -42,6 +43,7 @@ You will see the agent start working:
|
|||||||
### Interact with the result
|
### Interact with the result
|
||||||
|
|
||||||
Once the report is generated, you can:
|
Once the report is generated, you can:
|
||||||
|
|
||||||
- Ask for more detail on a specific section
|
- Ask for more detail on a specific section
|
||||||
- Ask to export the report as a file (the agent will use the `present_files` tool)
|
- Ask to export the report as a file (the agent will use the `present_files` tool)
|
||||||
- Ask to create a chart based on the research findings
|
- Ask to create a chart based on the research findings
|
||||||
@@ -51,6 +53,7 @@ Once the report is generated, you can:
|
|||||||
## What just happened
|
## What just happened
|
||||||
|
|
||||||
The agent used the DeerFlow Harness to:
|
The agent used the DeerFlow Harness to:
|
||||||
|
|
||||||
1. Receive your message and add it to the thread state
|
1. Receive your message and add it to the thread state
|
||||||
2. Run the middleware chain (memory injection, title generation)
|
2. Run the middleware chain (memory injection, title generation)
|
||||||
3. Call the LLM, which decided to search the web
|
3. Call the LLM, which decided to search the web
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ tools:
|
|||||||
Enable skills through the DeerFlow app's extensions panel, or edit `extensions_config.json` directly.
|
Enable skills through the DeerFlow app's extensions panel, or edit `extensions_config.json` directly.
|
||||||
|
|
||||||
**Via the app UI:**
|
**Via the app UI:**
|
||||||
|
|
||||||
1. Open the DeerFlow app
|
1. Open the DeerFlow app
|
||||||
2. Click the Extensions/Skills icon in the sidebar
|
2. Click the Extensions/Skills icon in the sidebar
|
||||||
3. Find `deep-research` and toggle it on
|
3. Find `deep-research` and toggle it on
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ Memory works automatically through `MemoryMiddleware`:
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
**First conversation:**
|
**First conversation:**
|
||||||
|
|
||||||
```
|
```
|
||||||
I am a Python backend developer primarily using FastAPI and PostgreSQL.
|
I am a Python backend developer primarily using FastAPI and PostgreSQL.
|
||||||
My team follows PEP 8 and prefers type annotations everywhere.
|
My team follows PEP 8 and prefers type annotations everywhere.
|
||||||
@@ -39,6 +40,7 @@ Please remember this for future code suggestions.
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Later conversation** (no need to repeat background):
|
**Later conversation** (no need to repeat background):
|
||||||
|
|
||||||
```
|
```
|
||||||
Help me write a user authentication module
|
Help me write a user authentication module
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards, Steps } from "nextra/components";
|
|||||||
# Agent 与线程
|
# Agent 与线程
|
||||||
|
|
||||||
<Callout type="info" emoji="🤖">
|
<Callout type="info" emoji="🤖">
|
||||||
Agent 是配置单元——它们定义了一组能力。线程是对话实例,带有持久化状态和历史记录。
|
Agent
|
||||||
|
是配置单元——它们定义了一组能力。线程是对话实例,带有持久化状态和历史记录。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## 自定义 Agent
|
## 自定义 Agent
|
||||||
@@ -115,5 +116,8 @@ checkpointer:
|
|||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="工作区使用" href="/docs/application/workspace-usage" />
|
<Cards.Card title="工作区使用" href="/docs/application/workspace-usage" />
|
||||||
<Cards.Card title="运维与排障" href="/docs/application/operations-and-troubleshooting" />
|
<Cards.Card
|
||||||
|
title="运维与排障"
|
||||||
|
href="/docs/application/operations-and-troubleshooting"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ models:
|
|||||||
启用扩展思考:
|
启用扩展思考:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: claude-extended-thinking
|
- name: claude-extended-thinking
|
||||||
use: langchain_anthropic:ChatAnthropic
|
use: langchain_anthropic:ChatAnthropic
|
||||||
model: claude-sonnet-4-5
|
model: claude-sonnet-4-5
|
||||||
api_key: $ANTHROPIC_API_KEY
|
api_key: $ANTHROPIC_API_KEY
|
||||||
@@ -57,6 +57,7 @@ models:
|
|||||||
type: enabled
|
type: enabled
|
||||||
budget_tokens: 10000
|
budget_tokens: 10000
|
||||||
```
|
```
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -103,6 +104,7 @@ models:
|
|||||||
```bash
|
```bash
|
||||||
ollama pull llama3.3
|
ollama pull llama3.3
|
||||||
```
|
```
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ checkpointer:
|
|||||||
前端通过 `.env.local`(本地开发)或 Docker Compose 环境中的环境变量配置。
|
前端通过 `.env.local`(本地开发)或 Docker Compose 环境中的环境变量配置。
|
||||||
|
|
||||||
| 变量 | 必需 | 描述 |
|
| 变量 | 必需 | 描述 |
|
||||||
|---|---|---|
|
| --------------------- | ---------- | -------------------------------------------------- |
|
||||||
| `BETTER_AUTH_SECRET` | 是(生产) | 会话管理的密钥(最少 32 个字符) |
|
| `BETTER_AUTH_SECRET` | 是(生产) | 会话管理的密钥(最少 32 个字符) |
|
||||||
| `BETTER_AUTH_URL` | 推荐 | 你的应用公开 URL(例如 `https://your-domain.com`) |
|
| `BETTER_AUTH_URL` | 推荐 | 你的应用公开 URL(例如 `https://your-domain.com`) |
|
||||||
| `SKIP_ENV_VALIDATION` | 否 | 设为 `1` 跳过构建时环境变量验证 |
|
| `SKIP_ENV_VALIDATION` | 否 | 设为 `1` 跳过构建时环境变量验证 |
|
||||||
@@ -176,7 +178,8 @@ BETTER_AUTH_SECRET=local-dev-secret-at-least-32-chars
|
|||||||
```
|
```
|
||||||
|
|
||||||
<Callout type="warning">
|
<Callout type="warning">
|
||||||
不要在生产中使用 <code>SKIP_ENV_VALIDATION=1</code>。为 <code>BETTER_AUTH_SECRET</code> 设置一个真实值。
|
不要在生产中使用 <code>SKIP_ENV_VALIDATION=1</code>。为{" "}
|
||||||
|
<code>BETTER_AUTH_SECRET</code> 设置一个真实值。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## extensions_config.json
|
## extensions_config.json
|
||||||
@@ -208,7 +211,7 @@ BETTER_AUTH_SECRET=local-dev-secret-at-least-32-chars
|
|||||||
这些变量在 DeerFlow 进程中设置(通过 `.env`、Docker 环境或 shell):
|
这些变量在 DeerFlow 进程中设置(通过 `.env`、Docker 环境或 shell):
|
||||||
|
|
||||||
| 变量 | 默认值 | 描述 |
|
| 变量 | 默认值 | 描述 |
|
||||||
|---|---|---|
|
| ----------------------- | ---------------- | ------------------------------------------------ |
|
||||||
| `DEER_FLOW_CONFIG_PATH` | 自动发现 | `config.yaml` 的绝对路径 |
|
| `DEER_FLOW_CONFIG_PATH` | 自动发现 | `config.yaml` 的绝对路径 |
|
||||||
| `LOG_LEVEL` | `info` | 日志详细程度(`debug`/`info`/`warning`/`error`) |
|
| `LOG_LEVEL` | `info` | 日志详细程度(`debug`/`info`/`warning`/`error`) |
|
||||||
| `DEER_FLOW_ROOT` | 仓库根目录 | 用于 Docker 中的技能和线程挂载 |
|
| `DEER_FLOW_ROOT` | 仓库根目录 | 用于 Docker 中的技能和线程挂载 |
|
||||||
|
|||||||
@@ -22,13 +22,14 @@ make dev
|
|||||||
启动的服务:
|
启动的服务:
|
||||||
|
|
||||||
| 服务 | 端口 | 描述 |
|
| 服务 | 端口 | 描述 |
|
||||||
|---|---|---|
|
| ----------- | ---- | ----------------------- |
|
||||||
| LangGraph | 2024 | DeerFlow Harness 运行时 |
|
| LangGraph | 2024 | DeerFlow Harness 运行时 |
|
||||||
| Gateway API | 8001 | FastAPI 后端 |
|
| Gateway API | 8001 | FastAPI 后端 |
|
||||||
| 前端 | 3000 | Next.js 界面 |
|
| 前端 | 3000 | Next.js 界面 |
|
||||||
| nginx | 2026 | 统一反向代理 |
|
| nginx | 2026 | 统一反向代理 |
|
||||||
|
|
||||||
访问地址:**http://localhost:2026**
|
访问地址:**http://localhost:2026**
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```bash
|
```bash
|
||||||
@@ -36,6 +37,7 @@ make stop
|
|||||||
```
|
```
|
||||||
|
|
||||||
停止所有四个服务。即使某个服务没有运行也可以安全执行。
|
停止所有四个服务。即使某个服务没有运行也可以安全执行。
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```
|
```
|
||||||
@@ -46,9 +48,11 @@ logs/nginx.log # nginx 访问/错误日志
|
|||||||
```
|
```
|
||||||
|
|
||||||
实时追踪日志:
|
实时追踪日志:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
tail -f logs/langgraph.log
|
tail -f logs/langgraph.log
|
||||||
```
|
```
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
@@ -86,7 +90,8 @@ BETTER_AUTH_SECRET=your-secret-here-min-32-chars
|
|||||||
`docker-compose*.yaml` 文件包含 `env_file: ../.env` 指令,会自动加载该文件。
|
`docker-compose*.yaml` 文件包含 `env_file: ../.env` 指令,会自动加载该文件。
|
||||||
|
|
||||||
<Callout type="warning">
|
<Callout type="warning">
|
||||||
在部署前始终将 <code>BETTER_AUTH_SECRET</code> 设置为强随机字符串。没有它,前端构建会使用一个公开已知的默认值。
|
在部署前始终将 <code>BETTER_AUTH_SECRET</code>{" "}
|
||||||
|
设置为强随机字符串。没有它,前端构建会使用一个公开已知的默认值。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
### 数据持久化
|
### 数据持久化
|
||||||
@@ -105,7 +110,7 @@ BETTER_AUTH_SECRET=your-secret-here-min-32-chars
|
|||||||
### 沙箱模式选择
|
### 沙箱模式选择
|
||||||
|
|
||||||
| 沙箱 | 使用场景 |
|
| 沙箱 | 使用场景 |
|
||||||
|---|---|
|
| -------------------------------------- | -------------------------- |
|
||||||
| `LocalSandboxProvider` | 单用户、受信任的本地工作流 |
|
| `LocalSandboxProvider` | 单用户、受信任的本地工作流 |
|
||||||
| `AioSandboxProvider`(Docker) | 多用户、中等隔离需求 |
|
| `AioSandboxProvider`(Docker) | 多用户、中等隔离需求 |
|
||||||
| `AioSandboxProvider` + K8s Provisioner | 生产环境、强隔离、多用户 |
|
| `AioSandboxProvider` + K8s Provisioner | 生产环境、强隔离、多用户 |
|
||||||
@@ -154,7 +159,7 @@ SKILLS_PVC_NAME=deer-flow-skills-pvc
|
|||||||
nginx 路由所有流量,控制路由的关键环境变量:
|
nginx 路由所有流量,控制路由的关键环境变量:
|
||||||
|
|
||||||
| 变量 | 默认值 | 描述 |
|
| 变量 | 默认值 | 描述 |
|
||||||
|---|---|---|
|
| -------------------- | ---------------- | ----------------------------- |
|
||||||
| `LANGGRAPH_UPSTREAM` | `langgraph:2024` | LangGraph 服务地址 |
|
| `LANGGRAPH_UPSTREAM` | `langgraph:2024` | LangGraph 服务地址 |
|
||||||
| `LANGGRAPH_REWRITE` | `/` | LangGraph 路由的 URL 重写前缀 |
|
| `LANGGRAPH_REWRITE` | `/` | LangGraph 路由的 URL 重写前缀 |
|
||||||
|
|
||||||
@@ -175,7 +180,7 @@ openssl rand -base64 32
|
|||||||
### 资源建议
|
### 资源建议
|
||||||
|
|
||||||
| 服务 | 最低配置 | 推荐配置 |
|
| 服务 | 最低配置 | 推荐配置 |
|
||||||
|---|---|---|
|
| ------------------------- | ---------------- | ---------------- |
|
||||||
| LangGraph(Agent 运行时) | 2 vCPU、4 GB RAM | 4 vCPU、8 GB RAM |
|
| LangGraph(Agent 运行时) | 2 vCPU、4 GB RAM | 4 vCPU、8 GB RAM |
|
||||||
| Gateway | 0.5 vCPU、512 MB | 1 vCPU、1 GB |
|
| Gateway | 0.5 vCPU、512 MB | 1 vCPU、1 GB |
|
||||||
| 前端 | 0.5 vCPU、512 MB | 1 vCPU、1 GB |
|
| 前端 | 0.5 vCPU、512 MB | 1 vCPU、1 GB |
|
||||||
@@ -200,5 +205,8 @@ curl http://localhost:2026/api/models
|
|||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="配置" href="/docs/application/configuration" />
|
<Cards.Card title="配置" href="/docs/application/configuration" />
|
||||||
<Cards.Card title="运维与排障" href="/docs/application/operations-and-troubleshooting" />
|
<Cards.Card
|
||||||
|
title="运维与排障"
|
||||||
|
href="/docs/application/operations-and-troubleshooting"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# DeerFlow 应用
|
# DeerFlow 应用
|
||||||
|
|
||||||
<Callout type="info" emoji="🚀">
|
<Callout type="info" emoji="🚀">
|
||||||
DeerFlow 应用是构建在 DeerFlow Harness 之上的完整 Super Agent 应用。它将运行时能力打包成一个可部署的产品,包含 Web 界面、API Gateway 和运维工具。
|
DeerFlow 应用是构建在 DeerFlow Harness 之上的完整 Super Agent
|
||||||
|
应用。它将运行时能力打包成一个可部署的产品,包含 Web 界面、API Gateway
|
||||||
|
和运维工具。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 应用是 DeerFlow 生产体验的参考实现。它将 Harness 运行时、基于 Web 的对话工作区、API Gateway 和反向代理组合成一个可部署的完整系统。
|
DeerFlow 应用是 DeerFlow 生产体验的参考实现。它将 Harness 运行时、基于 Web 的对话工作区、API Gateway 和反向代理组合成一个可部署的完整系统。
|
||||||
@@ -16,7 +18,7 @@ DeerFlow 应用是 DeerFlow 生产体验的参考实现。它将 Harness 运行
|
|||||||
## 应用提供什么
|
## 应用提供什么
|
||||||
|
|
||||||
| 能力 | 描述 |
|
| 能力 | 描述 |
|
||||||
|---|---|
|
| ---------------- | ----------------------------------------------------- |
|
||||||
| **Web 工作区** | 浏览器对话界面,支持线程、产出物、文件上传和技能选择 |
|
| **Web 工作区** | 浏览器对话界面,支持线程、产出物、文件上传和技能选择 |
|
||||||
| **自定义 Agent** | 创建和管理具有不同模型、技能和工具集的命名 Agent |
|
| **自定义 Agent** | 创建和管理具有不同模型、技能和工具集的命名 Agent |
|
||||||
| **线程管理** | 带检查点和历史记录的持久化对话线程 |
|
| **线程管理** | 带检查点和历史记录的持久化对话线程 |
|
||||||
@@ -57,7 +59,7 @@ DeerFlow 应用以四个服务的形式运行,通过单个 nginx 反向代理
|
|||||||
## 技术栈
|
## 技术栈
|
||||||
|
|
||||||
| 层次 | 技术 |
|
| 层次 | 技术 |
|
||||||
|---|---|
|
| ------------ | ------------------------------------------------------- |
|
||||||
| 前端 | Next.js 16、React 19、TypeScript、pnpm |
|
| 前端 | Next.js 16、React 19、TypeScript、pnpm |
|
||||||
| Gateway | FastAPI、Python 3.12、uvicorn |
|
| Gateway | FastAPI、Python 3.12、uvicorn |
|
||||||
| Agent 运行时 | LangGraph、LangChain、DeerFlow Harness |
|
| Agent 运行时 | LangGraph、LangChain、DeerFlow Harness |
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
DeerFlow 应用在 `logs/` 目录中写入每个服务的日志:
|
DeerFlow 应用在 `logs/` 目录中写入每个服务的日志:
|
||||||
|
|
||||||
| 文件 | 内容 |
|
| 文件 | 内容 |
|
||||||
|---|---|
|
| -------------------- | -------------------------------------- |
|
||||||
| `logs/langgraph.log` | Agent 运行时、工具调用、LangGraph 错误 |
|
| `logs/langgraph.log` | Agent 运行时、工具调用、LangGraph 错误 |
|
||||||
| `logs/gateway.log` | API 请求/响应、Gateway 错误 |
|
| `logs/gateway.log` | API 请求/响应、Gateway 错误 |
|
||||||
| `logs/frontend.log` | Next.js 服务器日志 |
|
| `logs/frontend.log` | Next.js 服务器日志 |
|
||||||
@@ -66,12 +66,14 @@ make config-upgrade
|
|||||||
**症状**:Agent 在响应第一条消息时报错,日志中有 API 认证错误。
|
**症状**:Agent 在响应第一条消息时报错,日志中有 API 认证错误。
|
||||||
|
|
||||||
**诊断**:
|
**诊断**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 检查 LangGraph 日志中的模型错误
|
# 检查 LangGraph 日志中的模型错误
|
||||||
grep -i "error\|apikey\|unauthorized" logs/langgraph.log | tail -20
|
grep -i "error\|apikey\|unauthorized" logs/langgraph.log | tail -20
|
||||||
```
|
```
|
||||||
|
|
||||||
**解决**:
|
**解决**:
|
||||||
|
|
||||||
1. 验证 `config.yaml` 中 API key 字段名称正确(例如 `$OPENAI_API_KEY`)。
|
1. 验证 `config.yaml` 中 API key 字段名称正确(例如 `$OPENAI_API_KEY`)。
|
||||||
2. 确认对应的环境变量已设置(`echo $OPENAI_API_KEY`)。
|
2. 确认对应的环境变量已设置(`echo $OPENAI_API_KEY`)。
|
||||||
3. 检查 `base_url`(如有)是否与提供商的实际端点匹配。
|
3. 检查 `base_url`(如有)是否与提供商的实际端点匹配。
|
||||||
@@ -83,12 +85,14 @@ grep -i "error\|apikey\|unauthorized" logs/langgraph.log | tail -20
|
|||||||
**症状**:工具报"文件未找到"或权限错误,即使 Agent 声称已创建文件。
|
**症状**:工具报"文件未找到"或权限错误,即使 Agent 声称已创建文件。
|
||||||
|
|
||||||
**诊断**:
|
**诊断**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 检查线程用户数据目录是否存在且可写
|
# 检查线程用户数据目录是否存在且可写
|
||||||
ls -la backend/.deer-flow/threads/
|
ls -la backend/.deer-flow/threads/
|
||||||
```
|
```
|
||||||
|
|
||||||
**解决**:
|
**解决**:
|
||||||
|
|
||||||
1. 确保 `backend/.deer-flow/` 对运行 DeerFlow 的进程可写。
|
1. 确保 `backend/.deer-flow/` 对运行 DeerFlow 的进程可写。
|
||||||
2. 在 Docker 部署中,验证卷挂载路径正确(`DEER_FLOW_ROOT` 设置为绝对路径)。
|
2. 在 Docker 部署中,验证卷挂载路径正确(`DEER_FLOW_ROOT` 设置为绝对路径)。
|
||||||
3. 如果使用基于容器的沙箱,确认 Docker 已运行并且容器镜像已拉取。
|
3. 如果使用基于容器的沙箱,确认 Docker 已运行并且容器镜像已拉取。
|
||||||
@@ -100,6 +104,7 @@ ls -la backend/.deer-flow/threads/
|
|||||||
**症状**:`make install` 或前端构建步骤失败,提示 `BETTER_AUTH_SECRET` 错误。
|
**症状**:`make install` 或前端构建步骤失败,提示 `BETTER_AUTH_SECRET` 错误。
|
||||||
|
|
||||||
**解决**:
|
**解决**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 选项 1:设置环境变量(推荐)
|
# 选项 1:设置环境变量(推荐)
|
||||||
export BETTER_AUTH_SECRET=your-secret-here-at-least-32-chars
|
export BETTER_AUTH_SECRET=your-secret-here-at-least-32-chars
|
||||||
@@ -116,12 +121,14 @@ SKIP_ENV_VALIDATION=1 pnpm build
|
|||||||
**症状**:MCP 工具未出现,`logs/langgraph.log` 中有超时错误。
|
**症状**:MCP 工具未出现,`logs/langgraph.log` 中有超时错误。
|
||||||
|
|
||||||
**诊断**:
|
**诊断**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 检查 MCP 相关错误
|
# 检查 MCP 相关错误
|
||||||
grep -i "mcp\|timeout" logs/langgraph.log | tail -20
|
grep -i "mcp\|timeout" logs/langgraph.log | tail -20
|
||||||
```
|
```
|
||||||
|
|
||||||
**解决**:
|
**解决**:
|
||||||
|
|
||||||
1. 验证 `extensions_config.json` 中 MCP 服务器的 `command` 和 `args` 在服务器外部正常工作(手动运行命令)。
|
1. 验证 `extensions_config.json` 中 MCP 服务器的 `command` 和 `args` 在服务器外部正常工作(手动运行命令)。
|
||||||
2. 确认 MCP 服务器的依赖(如 `npx`、`uvx`)已安装并在 PATH 中。
|
2. 确认 MCP 服务器的依赖(如 `npx`、`uvx`)已安装并在 PATH 中。
|
||||||
3. 检查 MCP 服务器是否需要网络访问或特定环境变量。
|
3. 检查 MCP 服务器是否需要网络访问或特定环境变量。
|
||||||
@@ -133,6 +140,7 @@ grep -i "mcp\|timeout" logs/langgraph.log | tail -20
|
|||||||
**症状**:沙箱工具请求挂起,日志中有连接拒绝错误。
|
**症状**:沙箱工具请求挂起,日志中有连接拒绝错误。
|
||||||
|
|
||||||
**解决**:
|
**解决**:
|
||||||
|
|
||||||
1. 验证 `config.yaml` 中 `provisioner_url` 正确且 Provisioner Pod 运行正常。
|
1. 验证 `config.yaml` 中 `provisioner_url` 正确且 Provisioner Pod 运行正常。
|
||||||
2. 检查 `K8S_NAMESPACE` 和 RBAC 配置是否允许 Provisioner 创建 Pod。
|
2. 检查 `K8S_NAMESPACE` 和 RBAC 配置是否允许 Provisioner 创建 Pod。
|
||||||
3. 验证 `SANDBOX_IMAGE` 可以从 K8s 节点拉取。
|
3. 验证 `SANDBOX_IMAGE` 可以从 K8s 节点拉取。
|
||||||
@@ -140,6 +148,7 @@ grep -i "mcp\|timeout" logs/langgraph.log | tail -20
|
|||||||
## 数据备份
|
## 数据备份
|
||||||
|
|
||||||
DeerFlow 将持久化数据存储在:
|
DeerFlow 将持久化数据存储在:
|
||||||
|
|
||||||
- **线程数据**:`backend/.deer-flow/threads/` — 每个线程的上传文件、输出和工作区文件
|
- **线程数据**:`backend/.deer-flow/threads/` — 每个线程的上传文件、输出和工作区文件
|
||||||
- **检查点**:取决于检查点器配置(SQLite:`backend/.deer-flow/checkpoints.db`,Redis:外部存储)
|
- **检查点**:取决于检查点器配置(SQLite:`backend/.deer-flow/checkpoints.db`,Redis:外部存储)
|
||||||
- **记忆**:`backend/.deer-flow/memory.json`(以及 `agents/*/memory.json`)
|
- **记忆**:`backend/.deer-flow/memory.json`(以及 `agents/*/memory.json`)
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards, Steps } from "nextra/components";
|
|||||||
# 快速上手
|
# 快速上手
|
||||||
|
|
||||||
<Callout type="info" emoji="⚡">
|
<Callout type="info" emoji="⚡">
|
||||||
大约 10 分钟即可在本地运行 DeerFlow 应用。你需要一台安装了 Python 3.12+、Node.js 22+ 的机器,以及至少一个 LLM API Key。
|
大约 10 分钟即可在本地运行 DeerFlow 应用。你需要一台安装了 Python
|
||||||
|
3.12+、Node.js 22+ 的机器,以及至少一个 LLM API Key。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
本指南引导你使用 `make dev` 工作流在本地机器上启动 DeerFlow 应用。所有四个服务(LangGraph、Gateway、前端、nginx)一起启动,通过单个 URL 访问。
|
本指南引导你使用 `make dev` 工作流在本地机器上启动 DeerFlow 应用。所有四个服务(LangGraph、Gateway、前端、nginx)一起启动,通过单个 URL 访问。
|
||||||
@@ -24,7 +25,7 @@ make check
|
|||||||
必需工具:
|
必需工具:
|
||||||
|
|
||||||
| 工具 | 最低版本 |
|
| 工具 | 最低版本 |
|
||||||
|---|---|
|
| ------- | ------------ |
|
||||||
| Python | 3.12 |
|
| Python | 3.12 |
|
||||||
| uv | 最新版 |
|
| uv | 最新版 |
|
||||||
| Node.js | 22 |
|
| Node.js | 22 |
|
||||||
@@ -86,6 +87,7 @@ make dev
|
|||||||
```
|
```
|
||||||
|
|
||||||
这会启动:
|
这会启动:
|
||||||
|
|
||||||
- LangGraph 服务,端口 `2024`
|
- LangGraph 服务,端口 `2024`
|
||||||
- Gateway API,端口 `8001`
|
- Gateway API,端口 `8001`
|
||||||
- 前端,端口 `3000`
|
- 前端,端口 `3000`
|
||||||
@@ -110,14 +112,16 @@ make stop
|
|||||||
日志文件:
|
日志文件:
|
||||||
|
|
||||||
| 服务 | 日志文件 |
|
| 服务 | 日志文件 |
|
||||||
|---|---|
|
| --------- | -------------------- |
|
||||||
| LangGraph | `logs/langgraph.log` |
|
| LangGraph | `logs/langgraph.log` |
|
||||||
| Gateway | `logs/gateway.log` |
|
| Gateway | `logs/gateway.log` |
|
||||||
| 前端 | `logs/frontend.log` |
|
| 前端 | `logs/frontend.log` |
|
||||||
| nginx | `logs/nginx.log` |
|
| nginx | `logs/nginx.log` |
|
||||||
|
|
||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
如果有问题,先检查日志文件。大多数启动错误(缺失 API Key、配置解析失败)会出现在 <code>logs/langgraph.log</code> 或 <code>logs/gateway.log</code> 中。
|
如果有问题,先检查日志文件。大多数启动错误(缺失 API
|
||||||
|
Key、配置解析失败)会出现在 <code>logs/langgraph.log</code> 或{" "}
|
||||||
|
<code>logs/gateway.log</code> 中。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 工作区使用
|
# 工作区使用
|
||||||
|
|
||||||
<Callout type="info" emoji="💬">
|
<Callout type="info" emoji="💬">
|
||||||
DeerFlow 工作区是你与 Agent 交互的地方。本页面涵盖主要用户界面工作流——创建对话、上传文件、查看产出物和使用技能。
|
DeerFlow 工作区是你与 Agent
|
||||||
|
交互的地方。本页面涵盖主要用户界面工作流——创建对话、上传文件、查看产出物和使用技能。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 工作区是一个基于浏览器的对话界面,你可以在其中向 Agent 发送消息、上传文件、查看中间步骤,以及下载生成的产出物。
|
DeerFlow 工作区是一个基于浏览器的对话界面,你可以在其中向 Agent 发送消息、上传文件、查看中间步骤,以及下载生成的产出物。
|
||||||
@@ -41,13 +42,15 @@ DeerFlow 工作区是一个基于浏览器的对话界面,你可以在其中
|
|||||||
拖放文件到消息输入区域,或点击附件图标上传。上传的文件挂载在沙箱的 `/mnt/user-data/uploads/` 路径下,Agent 可以直接读取和处理。
|
拖放文件到消息输入区域,或点击附件图标上传。上传的文件挂载在沙箱的 `/mnt/user-data/uploads/` 路径下,Agent 可以直接读取和处理。
|
||||||
|
|
||||||
**支持的操作**:
|
**支持的操作**:
|
||||||
|
|
||||||
- 读取和分析文件内容
|
- 读取和分析文件内容
|
||||||
- 处理数据文件(CSV、JSON、Excel)
|
- 处理数据文件(CSV、JSON、Excel)
|
||||||
- 提取 PDF 内容
|
- 提取 PDF 内容
|
||||||
- 分析图像(需要支持视觉的模型)
|
- 分析图像(需要支持视觉的模型)
|
||||||
|
|
||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
上传大文件时,告诉 Agent 文件的具体内容,以便获得更好的结果(例如"分析这个包含季度销售数据的 CSV")。
|
上传大文件时,告诉 Agent
|
||||||
|
文件的具体内容,以便获得更好的结果(例如"分析这个包含季度销售数据的 CSV")。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## 使用技能
|
## 使用技能
|
||||||
@@ -72,6 +75,7 @@ DeerFlow 工作区是一个基于浏览器的对话界面,你可以在其中
|
|||||||
当 Agent 生成文件(报告、图表、代码文件、演示文稿)时,它们会以**产出物**的形式出现在对话中。
|
当 Agent 生成文件(报告、图表、代码文件、演示文稿)时,它们会以**产出物**的形式出现在对话中。
|
||||||
|
|
||||||
点击产出物卡片:
|
点击产出物卡片:
|
||||||
|
|
||||||
- 在浏览器中预览文件。
|
- 在浏览器中预览文件。
|
||||||
- 下载文件到本地机器。
|
- 下载文件到本地机器。
|
||||||
- 复制文件内容。
|
- 复制文件内容。
|
||||||
@@ -87,6 +91,12 @@ DeerFlow 工作区是一个基于浏览器的对话界面,你可以在其中
|
|||||||
**删除线程**:从线程侧边栏菜单中选择删除。这会移除线程状态和所有相关的用户数据文件。
|
**删除线程**:从线程侧边栏菜单中选择删除。这会移除线程状态和所有相关的用户数据文件。
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
<Cards.Card title="Agent 与线程" href="/docs/application/agents-and-threads" />
|
<Cards.Card
|
||||||
<Cards.Card title="运维与排障" href="/docs/application/operations-and-troubleshooting" />
|
title="Agent 与线程"
|
||||||
|
href="/docs/application/agents-and-threads"
|
||||||
|
/>
|
||||||
|
<Cards.Card
|
||||||
|
title="运维与排障"
|
||||||
|
href="/docs/application/operations-and-troubleshooting"
|
||||||
|
/>
|
||||||
</Cards>
|
</Cards>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 配置
|
# 配置
|
||||||
|
|
||||||
<Callout type="info" emoji="⚙️">
|
<Callout type="info" emoji="⚙️">
|
||||||
所有 DeerFlow Harness 行为都由 <code>config.yaml</code> 驱动。一个文件控制哪些模型可用、沙箱如何运行、加载哪些工具,以及每个子系统的行为。
|
所有 DeerFlow Harness 行为都由 <code>config.yaml</code>{" "}
|
||||||
|
驱动。一个文件控制哪些模型可用、沙箱如何运行、加载哪些工具,以及每个子系统的行为。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 的配置系统围绕一个目标设计:每一个有意义的行为都应该可以在配置文件中表达,而不是硬编码在应用程序中。这使部署可重现、可审计,并且易于按环境定制。
|
DeerFlow 的配置系统围绕一个目标设计:每一个有意义的行为都应该可以在配置文件中表达,而不是硬编码在应用程序中。这使部署可重现、可审计,并且易于按环境定制。
|
||||||
@@ -103,7 +104,7 @@ make config-upgrade
|
|||||||
下表将 `config.yaml` 中的每个顶层章节映射到其文档页面:
|
下表将 `config.yaml` 中的每个顶层章节映射到其文档页面:
|
||||||
|
|
||||||
| 章节 | 描述 | 文档 |
|
| 章节 | 描述 | 文档 |
|
||||||
|---|---|---|
|
| ----------------- | -------------------------------------------- | ---------------------------------------------------- |
|
||||||
| `log_level` | 日志级别(`debug`/`info`/`warning`/`error`) | — |
|
| `log_level` | 日志级别(`debug`/`info`/`warning`/`error`) | — |
|
||||||
| `models` | 可用的 LLM 模型 | [Lead Agent](/docs/harness/lead-agent) |
|
| `models` | 可用的 LLM 模型 | [Lead Agent](/docs/harness/lead-agent) |
|
||||||
| `token_usage` | 每次模型调用的 token 追踪 | [中间件](/docs/harness/middlewares) |
|
| `token_usage` | 每次模型调用的 token 追踪 | [中间件](/docs/harness/middlewares) |
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 自定义与扩展
|
# 自定义与扩展
|
||||||
|
|
||||||
<Callout type="info" emoji="🔧">
|
<Callout type="info" emoji="🔧">
|
||||||
DeerFlow 设计为可适配的。你可以通过编写自定义中间件、添加新工具、构建技能包以及通过 config.yaml 的 <code>use:</code> 字段替换任何内置组件来扩展 Agent 行为。
|
DeerFlow
|
||||||
|
设计为可适配的。你可以通过编写自定义中间件、添加新工具、构建技能包以及通过
|
||||||
|
config.yaml 的 <code>use:</code> 字段替换任何内置组件来扩展 Agent 行为。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 的可插拔架构意味着系统的大多数部分都可以在不 fork 核心的情况下被替换或扩展。本页面列举了扩展点,并解释如何使用每一个。
|
DeerFlow 的可插拔架构意味着系统的大多数部分都可以在不 fork 核心的情况下被替换或扩展。本页面列举了扩展点,并解释如何使用每一个。
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 设计理念
|
# 设计理念
|
||||||
|
|
||||||
<Callout type="info" emoji="🏗️">
|
<Callout type="info" emoji="🏗️">
|
||||||
DeerFlow 围绕一个核心思想构建:Agent 行为应该由小型、可观察、可替换的组件组合而成——而不是硬编码到固定的工作流图中。
|
DeerFlow 围绕一个核心思想构建:Agent
|
||||||
|
行为应该由小型、可观察、可替换的组件组合而成——而不是硬编码到固定的工作流图中。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
了解 DeerFlow Harness 背后的设计理念,有助于你有效地使用它、自信地扩展它,并推断 Agent 在生产环境中的行为方式。
|
了解 DeerFlow Harness 背后的设计理念,有助于你有效地使用它、自信地扩展它,并推断 Agent 在生产环境中的行为方式。
|
||||||
@@ -102,7 +103,7 @@ DeerFlow 中所有有意义的行为都通过 `config.yaml` 控制。系统的
|
|||||||
## 总结
|
## 总结
|
||||||
|
|
||||||
| 设计原则 | 实践含义 |
|
| 设计原则 | 实践含义 |
|
||||||
|---|---|
|
| ---------------------- | ---------------------------------------- |
|
||||||
| Harness 而非 Framework | 开箱即用的运行时,所有基础设施已预先连接 |
|
| Harness 而非 Framework | 开箱即用的运行时,所有基础设施已预先连接 |
|
||||||
| 长时序优先 | 架构假设多步骤、多工具、多轮次任务 |
|
| 长时序优先 | 架构假设多步骤、多工具、多轮次任务 |
|
||||||
| 中间件优于继承 | 行为由小型、隔离的插件组合而成 |
|
| 中间件优于继承 | 行为由小型、隔离的插件组合而成 |
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 安装 DeerFlow Harness
|
# 安装 DeerFlow Harness
|
||||||
|
|
||||||
<Callout type="info" emoji="📦">
|
<Callout type="info" emoji="📦">
|
||||||
DeerFlow Harness Python 包将以 <code>deerflow</code> 名称发布。目前尚未正式发布,安装方式<strong>即将推出</strong>。
|
DeerFlow Harness Python 包将以 <code>deerflow</code>{" "}
|
||||||
|
名称发布。目前尚未正式发布,安装方式<strong>即将推出</strong>。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow Harness 是构建自己 Super Agent 系统的 Python SDK 和运行时基础。
|
DeerFlow Harness 是构建自己 Super Agent 系统的 Python SDK 和运行时基础。
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 集成指南
|
# 集成指南
|
||||||
|
|
||||||
<Callout type="info" emoji="🔌">
|
<Callout type="info" emoji="🔌">
|
||||||
DeerFlow Harness 可以嵌入任何 Python 应用程序。本指南涵盖在你自己的系统中将 DeerFlow 作为库使用的集成模式。
|
DeerFlow Harness 可以嵌入任何 Python 应用程序。本指南涵盖在你自己的系统中将
|
||||||
|
DeerFlow 作为库使用的集成模式。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow Harness 不仅仅是一个独立应用程序——它是一个可以导入并在你自己的后端、API 服务器、自动化系统或多 Agent 协调器中使用的 Python 库。
|
DeerFlow Harness 不仅仅是一个独立应用程序——它是一个可以导入并在你自己的后端、API 服务器、自动化系统或多 Agent 协调器中使用的 Python 库。
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import { Callout, Cards, Steps } from "nextra/components";
|
|||||||
# Lead Agent
|
# Lead Agent
|
||||||
|
|
||||||
<Callout type="info" emoji="🧠">
|
<Callout type="info" emoji="🧠">
|
||||||
Lead Agent 是每个 DeerFlow 线程中的主要推理和编排单元。它决定要做什么、调用工具、委派子 Agent,并返回产出物。
|
Lead Agent 是每个 DeerFlow
|
||||||
|
线程中的主要推理和编排单元。它决定要做什么、调用工具、委派子
|
||||||
|
Agent,并返回产出物。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
Lead Agent 是 DeerFlow 线程中的核心执行者。每个对话、任务和工作流都通过它进行。理解它的工作方式有助于你有效地配置它,并在需要时扩展它。
|
Lead Agent 是 DeerFlow 线程中的核心执行者。每个对话、任务和工作流都通过它进行。理解它的工作方式有助于你有效地配置它,并在需要时扩展它。
|
||||||
@@ -122,7 +124,8 @@ models:
|
|||||||
自定义 Agent 通过 DeerFlow 应用界面或 `/api/agents` 端点创建。其配置存储在后端目录的 `agents/{name}/config.yaml` 中。
|
自定义 Agent 通过 DeerFlow 应用界面或 `/api/agents` 端点创建。其配置存储在后端目录的 `agents/{name}/config.yaml` 中。
|
||||||
|
|
||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
当在线程中选择自定义 Agent 时,Lead Agent 在运行时加载该 Agent 的配置。为特定 Agent 切换模型或技能不需要重启服务器。
|
当在线程中选择自定义 Agent 时,Lead Agent 在运行时加载该 Agent 的配置。为特定
|
||||||
|
Agent 切换模型或技能不需要重启服务器。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 记忆系统
|
# 记忆系统
|
||||||
|
|
||||||
<Callout type="info" emoji="💾">
|
<Callout type="info" emoji="💾">
|
||||||
记忆让 DeerFlow 在多个会话中保留有用信息。Agent 记住用户偏好、项目背景和反复出现的事实,这样它可以在不每次从零开始的情况下给出更好的响应。
|
记忆让 DeerFlow 在多个会话中保留有用信息。Agent
|
||||||
|
记住用户偏好、项目背景和反复出现的事实,这样它可以在不每次从零开始的情况下给出更好的响应。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
记忆是 DeerFlow Harness 的一个运行时功能。它不是简单的对话日志,而是跨多个独立会话持久化、在未来对话中影响 Agent 行为的结构化事实和上下文摘要存储。
|
记忆是 DeerFlow Harness 的一个运行时功能。它不是简单的对话日志,而是跨多个独立会话持久化、在未来对话中影响 Agent 行为的结构化事实和上下文摘要存储。
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import { Callout } from "nextra/components";
|
|||||||
# 中间件
|
# 中间件
|
||||||
|
|
||||||
<Callout type="info" emoji="🔌">
|
<Callout type="info" emoji="🔌">
|
||||||
中间件包裹 Lead Agent 中的每次 LLM 调用。它们是添加跨领域行为(如记忆、摘要压缩、澄清和 token 追踪)的主要扩展点。
|
中间件包裹 Lead Agent 中的每次 LLM
|
||||||
|
调用。它们是添加跨领域行为(如记忆、摘要压缩、澄清和 token
|
||||||
|
追踪)的主要扩展点。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
每次 Lead Agent 调用 LLM 时,都会先后执行一条**中间件链**。中间件可以读取和修改 Agent 的状态、向系统提示注入内容、拦截工具调用,并对模型输出做出反应。
|
每次 Lead Agent 调用 LLM 时,都会先后执行一条**中间件链**。中间件可以读取和修改 Agent 的状态、向系统提示注入内容、拦截工具调用,并对模型输出做出反应。
|
||||||
@@ -172,11 +174,13 @@ summarization:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**触发类型**:
|
**触发类型**:
|
||||||
|
|
||||||
- `tokens`:当对话中总 token 数超过 `value` 时触发。
|
- `tokens`:当对话中总 token 数超过 `value` 时触发。
|
||||||
- `messages`:当消息数超过 `value` 时触发。
|
- `messages`:当消息数超过 `value` 时触发。
|
||||||
- `fraction`:当上下文达到模型最大输入 token 限制的 `value` 比例时触发。
|
- `fraction`:当上下文达到模型最大输入 token 限制的 `value` 比例时触发。
|
||||||
|
|
||||||
**保留类型**:
|
**保留类型**:
|
||||||
|
|
||||||
- `messages`:摘要后保留最后 `value` 条消息。
|
- `messages`:摘要后保留最后 `value` 条消息。
|
||||||
- `tokens`:保留最近 `value` 个 token 的历史。
|
- `tokens`:保留最近 `value` 个 token 的历史。
|
||||||
- `fraction`:保留模型最大输入 token 限制的 `value` 比例的最近历史。
|
- `fraction`:保留模型最大输入 token 限制的 `value` 比例的最近历史。
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ agent = create_deerflow_agent(
|
|||||||
常用参数:
|
常用参数:
|
||||||
|
|
||||||
| 参数 | 说明 |
|
| 参数 | 说明 |
|
||||||
|---|---|
|
| ------------------ | -------------------------- |
|
||||||
| `tools` | 提供给 Agent 的额外工具 |
|
| `tools` | 提供给 Agent 的额外工具 |
|
||||||
| `system_prompt` | 自定义系统提示词 |
|
| `system_prompt` | 自定义系统提示词 |
|
||||||
| `features` | 启用或替换内置运行时能力 |
|
| `features` | 启用或替换内置运行时能力 |
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards, Tabs } from "nextra/components";
|
|||||||
# 沙箱
|
# 沙箱
|
||||||
|
|
||||||
<Callout type="info" emoji="📦">
|
<Callout type="info" emoji="📦">
|
||||||
沙箱是 Agent 进行文件和命令操作的隔离工作区。它让 DeerFlow 能够采取真实行动,而不仅仅是对话。
|
沙箱是 Agent 进行文件和命令操作的隔离工作区。它让 DeerFlow
|
||||||
|
能够采取真实行动,而不仅仅是对话。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
沙箱为 Lead Agent 提供一个受控环境,在其中可以读取文件、写入输出、运行 Shell 命令并生成产出物。没有沙箱,Agent 只能生成文本;有了沙箱,它可以编写和执行代码、处理数据文件、生成图表并构建交付物。
|
沙箱为 Lead Agent 提供一个受控环境,在其中可以读取文件、写入输出、运行 Shell 命令并生成产出物。没有沙箱,Agent 只能生成文本;有了沙箱,它可以编写和执行代码、处理数据文件、生成图表并构建交付物。
|
||||||
@@ -73,7 +74,7 @@ sandbox:
|
|||||||
沙箱使用路径映射来桥接主机文件系统和容器的虚拟文件系统。始终配置两个关键映射:
|
沙箱使用路径映射来桥接主机文件系统和容器的虚拟文件系统。始终配置两个关键映射:
|
||||||
|
|
||||||
| 主机路径 | 容器路径 | 访问权限 |
|
| 主机路径 | 容器路径 | 访问权限 |
|
||||||
|---|---|---|
|
| ------------------------------------------- | --------------------------------------------- | -------- |
|
||||||
| `skills/`(来自 `skills.path`) | `/mnt/skills`(来自 `skills.container_path`) | 只读 |
|
| `skills/`(来自 `skills.path`) | `/mnt/skills`(来自 `skills.container_path`) | 只读 |
|
||||||
| `.deer-flow/threads/{thread_id}/user-data/` | `/mnt/user-data/` | 读写 |
|
| `.deer-flow/threads/{thread_id}/user-data/` | `/mnt/user-data/` | 读写 |
|
||||||
|
|
||||||
@@ -94,7 +95,8 @@ sandbox:
|
|||||||
|
|
||||||
<Callout type="warning">
|
<Callout type="warning">
|
||||||
自定义挂载的 <code>container_path</code> 不能与保留前缀冲突:
|
自定义挂载的 <code>container_path</code> 不能与保留前缀冲突:
|
||||||
<code>/mnt/skills</code>、<code>/mnt/acp-workspace</code> 或 <code>/mnt/user-data</code>。
|
<code>/mnt/skills</code>、<code>/mnt/acp-workspace</code> 或{" "}
|
||||||
|
<code>/mnt/user-data</code>。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## 输出截断
|
## 输出截断
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards, FileTree, Steps } from "nextra/components";
|
|||||||
# 技能
|
# 技能
|
||||||
|
|
||||||
<Callout type="info" emoji="🎯">
|
<Callout type="info" emoji="🎯">
|
||||||
技能是面向任务的能力包,教会 Agent 如何完成特定类型的工作。基础 Agent 保持通用;技能在需要时提供专业化。
|
技能是面向任务的能力包,教会 Agent 如何完成特定类型的工作。基础 Agent
|
||||||
|
保持通用;技能在需要时提供专业化。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
技能不仅仅是提示词。它是一个自包含的能力包,可以包含结构化指令、分步工作流、领域最佳实践、支撑资源和工具配置。技能按需加载——在任务需要时注入内容,否则不影响上下文。
|
技能不仅仅是提示词。它是一个自包含的能力包,可以包含结构化指令、分步工作流、领域最佳实践、支撑资源和工具配置。技能按需加载——在任务需要时注入内容,否则不影响上下文。
|
||||||
@@ -40,7 +41,7 @@ import { Callout, Cards, FileTree, Steps } from "nextra/components";
|
|||||||
DeerFlow 内置以下公共技能:
|
DeerFlow 内置以下公共技能:
|
||||||
|
|
||||||
| 技能 | 描述 |
|
| 技能 | 描述 |
|
||||||
|---|---|
|
| ------------------------------ | -------------------------------------------- |
|
||||||
| `deep-research` | 带来源收集、交叉验证和结构化输出的多步骤研究 |
|
| `deep-research` | 带来源收集、交叉验证和结构化输出的多步骤研究 |
|
||||||
| `data-analysis` | 数据探索、统计分析和洞察生成 |
|
| `data-analysis` | 数据探索、统计分析和洞察生成 |
|
||||||
| `chart-visualization` | 从数据创建图表和可视化 |
|
| `chart-visualization` | 从数据创建图表和可视化 |
|
||||||
@@ -137,7 +138,9 @@ skill_evolution:
|
|||||||
```
|
```
|
||||||
|
|
||||||
<Callout type="warning">
|
<Callout type="warning">
|
||||||
只在你信任 Agent 输出的环境中启用技能进化。新创建的技能在加载前会经过安全扫描,但该功能给予 Agent 对技能目录的写访问权限。
|
只在你信任 Agent
|
||||||
|
输出的环境中启用技能进化。新创建的技能在加载前会经过安全扫描,但该功能给予
|
||||||
|
Agent 对技能目录的写访问权限。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
## 编写自定义技能
|
## 编写自定义技能
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 子 Agent
|
# 子 Agent
|
||||||
|
|
||||||
<Callout type="info" emoji="👥">
|
<Callout type="info" emoji="👥">
|
||||||
子 Agent 是 Lead Agent 委派子任务的专注执行者。它们以隔离的上下文运行,在处理并行或专业工作的同时保持主对话清晰。
|
子 Agent 是 Lead Agent
|
||||||
|
委派子任务的专注执行者。它们以隔离的上下文运行,在处理并行或专业工作的同时保持主对话清晰。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
当一个任务对单个推理线程来说太宽泛,或者部分任务可以并行完成时,Lead Agent 将工作委派给**子 Agent**。子 Agent 是一个独立的 Agent 调用,接收特定任务、执行并返回结果。
|
当一个任务对单个推理线程来说太宽泛,或者部分任务可以并行完成时,Lead Agent 将工作委派给**子 Agent**。子 Agent 是一个独立的 Agent 调用,接收特定任务、执行并返回结果。
|
||||||
@@ -115,7 +116,9 @@ acp_agents:
|
|||||||
Lead Agent 通过 `invoke_acp_agent` 内置工具调用 ACP Agent。
|
Lead Agent 通过 `invoke_acp_agent` 内置工具调用 ACP Agent。
|
||||||
|
|
||||||
<Callout type="tip">
|
<Callout type="tip">
|
||||||
ACP Agent 作为 DeerFlow 管理的子进程运行,通过 ACP 协议通信。标准 CLI 工具(如原始的 `claude` 或 `codex` 命令)默认不兼容 ACP——请使用上面列出的适配器包或兼容的 ACP 封装器。
|
ACP Agent 作为 DeerFlow 管理的子进程运行,通过 ACP 协议通信。标准 CLI
|
||||||
|
工具(如原始的 `claude` 或 `codex` 命令)默认不兼容
|
||||||
|
ACP——请使用上面列出的适配器包或兼容的 ACP 封装器。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
<Cards num={2}>
|
<Cards num={2}>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards, Tabs } from "nextra/components";
|
|||||||
# 工具
|
# 工具
|
||||||
|
|
||||||
<Callout type="info" emoji="🔧">
|
<Callout type="info" emoji="🔧">
|
||||||
工具是 Lead Agent 可以采取的行动。DeerFlow 提供内置工具、社区集成、MCP 工具和技能工具——全部通过 <code>config.yaml</code> 控制。
|
工具是 Lead Agent 可以采取的行动。DeerFlow 提供内置工具、社区集成、MCP
|
||||||
|
工具和技能工具——全部通过 <code>config.yaml</code> 控制。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
Lead Agent 是一个工具调用 Agent。工具是它与世界交互的方式:搜索网络、读写文件、运行命令、委派任务以及向用户呈现输出。
|
Lead Agent 是一个工具调用 Agent。工具是它与世界交互的方式:搜索网络、读写文件、运行命令、委派任务以及向用户呈现输出。
|
||||||
@@ -75,7 +76,7 @@ task(agent="general-purpose", task="...", context="...")
|
|||||||
以下工具与沙箱文件系统交互,需要配置并激活沙箱。
|
以下工具与沙箱文件系统交互,需要配置并激活沙箱。
|
||||||
|
|
||||||
| 工具 | 描述 |
|
| 工具 | 描述 |
|
||||||
|---|---|
|
| ------------- | ---------------------------------------------------------- |
|
||||||
| `ls` | 列出目录中的文件 |
|
| `ls` | 列出目录中的文件 |
|
||||||
| `read_file` | 读取文件内容 |
|
| `read_file` | 读取文件内容 |
|
||||||
| `glob` | 查找匹配模式的文件 |
|
| `glob` | 查找匹配模式的文件 |
|
||||||
@@ -120,6 +121,7 @@ tools:
|
|||||||
高质量搜索,带结构化结果。需要 [Tavily](https://tavily.com) API Key。
|
高质量搜索,带结构化结果。需要 [Tavily](https://tavily.com) API Key。
|
||||||
|
|
||||||
安装:`cd backend && uv add 'deerflow-harness[tavily]'`
|
安装:`cd backend && uv add 'deerflow-harness[tavily]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -130,6 +132,7 @@ tools:
|
|||||||
带神经检索的语义搜索。需要 [Exa](https://exa.ai) API Key。
|
带神经检索的语义搜索。需要 [Exa](https://exa.ai) API Key。
|
||||||
|
|
||||||
安装:`cd backend && uv add 'deerflow-harness[exa]'`
|
安装:`cd backend && uv add 'deerflow-harness[exa]'`
|
||||||
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml
|
||||||
@@ -145,19 +148,13 @@ Firecrawl 驱动的搜索和爬取。需要 [Firecrawl](https://firecrawl.dev) A
|
|||||||
|
|
||||||
<Tabs items={["Jina AI(默认)", "Exa"]}>
|
<Tabs items={["Jina AI(默认)", "Exa"]}>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.jina_ai.tools:web_fetch_tool
|
||||||
tools:
|
api_key: $JINA_API_KEY # 可选;匿名使用有速率限制 ``` 将网页转换为干净的
|
||||||
- use: deerflow.community.jina_ai.tools:web_fetch_tool
|
Markdown。无 API Key 也可使用,但有更严格的速率限制。
|
||||||
api_key: $JINA_API_KEY # 可选;匿名使用有速率限制
|
|
||||||
```
|
|
||||||
将网页转换为干净的 Markdown。无 API Key 也可使用,但有更严格的速率限制。
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab>
|
<Tabs.Tab>
|
||||||
```yaml
|
```yaml tools: - use: deerflow.community.exa.tools:web_fetch_tool api_key:
|
||||||
tools:
|
$EXA_API_KEY ```
|
||||||
- use: deerflow.community.exa.tools:web_fetch_tool
|
|
||||||
api_key: $EXA_API_KEY
|
|
||||||
```
|
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|||||||
@@ -63,4 +63,3 @@ Harness 章节是技术文档的核心,面向想要构建基于 DeerFlow 系
|
|||||||
### 参考
|
### 参考
|
||||||
|
|
||||||
参考章节提供详细的查阅资料,包括配置、运行时模式、API 和代码映射。
|
参考章节提供详细的查阅资料,包括配置、运行时模式、API 和代码映射。
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 核心概念
|
# 核心概念
|
||||||
|
|
||||||
<Callout type="important" emoji="🧠">
|
<Callout type="important" emoji="🧠">
|
||||||
如果你将 DeerFlow 理解为一个长时序 Agent 的运行时,而不仅仅是聊天界面或工作流图,它将最易于理解。
|
如果你将 DeerFlow 理解为一个长时序 Agent
|
||||||
|
的运行时,而不仅仅是聊天界面或工作流图,它将最易于理解。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
在深入了解 DeerFlow 之前,先建立一些贯穿整个系统的核心概念。这些概念解释了 DeerFlow 的优化目标以及其架构设计的原因。
|
在深入了解 DeerFlow 之前,先建立一些贯穿整个系统的核心概念。这些概念解释了 DeerFlow 的优化目标以及其架构设计的原因。
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# Harness 与应用
|
# Harness 与应用
|
||||||
|
|
||||||
<Callout type="info" emoji="⚙️">
|
<Callout type="info" emoji="⚙️">
|
||||||
DeerFlow 应用是构建在 DeerFlow Harness 之上的最佳实践 Super Agent 应用,而 DeerFlow Harness 是构建自己 Agent 系统的 Python SDK 和运行时基础。
|
DeerFlow 应用是构建在 DeerFlow Harness 之上的最佳实践 Super Agent 应用,而
|
||||||
|
DeerFlow Harness 是构建自己 Agent 系统的 Python SDK 和运行时基础。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 有两个紧密相关但服务于不同目的的层次:
|
DeerFlow 有两个紧密相关但服务于不同目的的层次:
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import { Callout, Cards } from "nextra/components";
|
|||||||
# 为什么选择 DeerFlow
|
# 为什么选择 DeerFlow
|
||||||
|
|
||||||
<Callout type="info" emoji="🦌">
|
<Callout type="info" emoji="🦌">
|
||||||
DeerFlow 起源于深度研究,但逐渐演化为一个通用的长时序 Agent 运行时——支持技能、记忆、工具和协作调度。
|
DeerFlow 起源于深度研究,但逐渐演化为一个通用的长时序 Agent
|
||||||
|
运行时——支持技能、记忆、工具和协作调度。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
DeerFlow 的诞生是因为现代 Agent 系统需要的不仅仅是一个聊天循环。一个真正有用的 Agent 必须能够进行长时序规划、将任务拆解为子任务、使用工具、操作文件、安全地运行代码,并在复杂任务中保持足够的上下文连贯性。DeerFlow 正是为提供这样的运行时基础而构建的。
|
DeerFlow 的诞生是因为现代 Agent 系统需要的不仅仅是一个聊天循环。一个真正有用的 Agent 必须能够进行长时序规划、将任务拆解为子任务、使用工具、操作文件、安全地运行代码,并在复杂任务中保持足够的上下文连贯性。DeerFlow 正是为提供这样的运行时基础而构建的。
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ description: 本教程引导你在 DeerFlow 中完成第一次完整的 Agent
|
|||||||
### 3. 观察 Agent 的工作过程
|
### 3. 观察 Agent 的工作过程
|
||||||
|
|
||||||
你将看到 Agent 进入工作状态:
|
你将看到 Agent 进入工作状态:
|
||||||
|
|
||||||
- 展开**思考步骤**查看它调用了哪些工具
|
- 展开**思考步骤**查看它调用了哪些工具
|
||||||
- 观察网络搜索结果的流入
|
- 观察网络搜索结果的流入
|
||||||
- 等待最终报告生成
|
- 等待最终报告生成
|
||||||
@@ -38,6 +39,7 @@ description: 本教程引导你在 DeerFlow 中完成第一次完整的 Agent
|
|||||||
### 4. 与结果互动
|
### 4. 与结果互动
|
||||||
|
|
||||||
报告生成后,你可以:
|
报告生成后,你可以:
|
||||||
|
|
||||||
- 要求对某部分进行详细说明
|
- 要求对某部分进行详细说明
|
||||||
- 要求将报告导出为文件(Agent 会使用 `present_files` 工具)
|
- 要求将报告导出为文件(Agent 会使用 `present_files` 工具)
|
||||||
- 要求基于研究结果创建图表
|
- 要求基于研究结果创建图表
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ memory:
|
|||||||
## 示例
|
## 示例
|
||||||
|
|
||||||
**第一次对话**:
|
**第一次对话**:
|
||||||
|
|
||||||
```
|
```
|
||||||
我是一名 Python 后端开发者,主要使用 FastAPI 和 PostgreSQL。
|
我是一名 Python 后端开发者,主要使用 FastAPI 和 PostgreSQL。
|
||||||
我的团队遵循 PEP 8 代码规范,偏好类型注解。
|
我的团队遵循 PEP 8 代码规范,偏好类型注解。
|
||||||
@@ -37,6 +38,7 @@ memory:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**后续对话**(无需重复背景):
|
**后续对话**(无需重复背景):
|
||||||
|
|
||||||
```
|
```
|
||||||
帮我写一个用户认证模块
|
帮我写一个用户认证模块
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user