Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/skills/dify-docs-guides/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ In the self-host copy:
```

4. Exclude from the user guide: default values, the "why" behind each variable, deployment-specific mechanics, and variable interactions — anything the reader finds one click into the reference.
5. Link a variable name only when it has its own heading anchor in the reference (`#var_name`). Table-row variables stay plain code — a link would land at the page or section top while promising the variable; each self-contained unit that names them (a bullet, a callout) carries its own "See [Environment Variables](…) for details." reference — placed with the variables, never as a section-level closing line.
2 changes: 2 additions & 0 deletions .claude/skills/dify-docs-terminology-check/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Every bolded term and every heading is a candidate. Step 5 decides deterministic

The codebase i18n is the source of truth for UI labels: `web/i18n/en-US/` (flat JSON files with dot-flattened keys, e.g. `"menus.apps": "Studio"`), plus `zh-Hans/` and `ja-JP/` siblings. The glossary's `i18n Key` column maps to them: `common.menus.apps` → file `common.json`, key `"menus.apps"`.

A key's value counts as the visible label only after checking its render site: `git grep` the key under `web/` and confirm it lands in on-screen text. Values feeding `aria-label`, tooltips, or placeholders are not the label, and shared generic keys (`common.operation.*`) often supply the visible text instead — the Skills section's add button renders `operation.add` ("Add") while `skills.add` ("Add skill") is its aria-label. A product or staging screenshot outranks any code inference.

For each candidate term (use the English term; for zh/ja files, take the candidate from the same position in the en sibling):

1. If the term has a `## UI Labels` row in the glossary, read its `i18n Key`; skip to substep 3 to confirm the codebase still agrees.
Expand Down
2 changes: 1 addition & 1 deletion en/self-host/deploy/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ The remaining variables configure the bundled services or derive from your exist
| `DIFY_AGENT_REDIS_PREFIX` | `dify-agent` | Key prefix for the agent backend's Redis entries. |
| `DIFY_AGENT_SHUTDOWN_GRACE_SECONDS` | `30` | How long a stopping agent backend waits for in-flight runs to finish. |
| `DIFY_AGENT_RUN_RETENTION_SECONDS` | `259200` | How long finished run records are retained (3 days by default). |
| `DIFY_AGENT_RUN_TIMEOUT_SECONDS` | `3600` | Wall-clock deadline for one agent run's model and tool work. A run that exceeds it fails with `agent_run_limit_exceeded`. Replaces the former `AGENT_BACKEND_RUN_TIMEOUT_SECONDS`.<br/><br/>On the `e2b` backend the sandbox's `DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS` (ceiling 3600) still applies, so values above an hour only take effect on the `local` backend. |
| `DIFY_AGENT_RUN_TIMEOUT_SECONDS` | `3600` | Wall-clock deadline for one agent run's model and tool work. A run that exceeds it fails with `agent_run_limit_exceeded`. Replaces the former `AGENT_BACKEND_RUN_TIMEOUT_SECONDS`.<br/><br/>The API-side `APP_MAX_EXECUTION_TIME` and `WORKFLOW_MAX_EXECUTION_TIME` (default `1200`) stop runs earlier unless raised to match.<br/><br/>On the `e2b` backend the sandbox's `DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS` (ceiling 3600) still applies, so values above an hour only take effect on the `local` backend. |
| `AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS` | `30` | Read timeout for one SSE connection to the agent backend. |
| `AGENT_BACKEND_STREAM_MAX_RECONNECTS` | `3` | How many times the API reconnects a dropped agent-backend stream before failing the run. |
| `DIFY_AGENT_PLUGIN_DAEMON_URL` | (empty; derives from `PLUGIN_DAEMON_URL`) | Plugin daemon address the agent backend calls tools through. |
Expand Down
14 changes: 8 additions & 6 deletions en/self-host/use-dify/build/new-agent/build.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Size limits depend on file type; each is a default you can adjust with [environm
You can also have the agent create files and save them here in [Build mode](#build-by-chatting).

<Info>
Files the agent creates and saves are capped at 50 MB each by default, adjustable with [`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/en/self-host/deploy/configuration/environments#new-agent-beta).
Files the agent creates and saves are capped at 50 MB each by default, adjustable with `DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`. See [Environment Variables](/en/self-host/deploy/configuration/environments) for details.
</Info>

### Tools
Expand All @@ -114,7 +114,7 @@ Say your agent's skills all work with the same order system: one checks stock, o
Import a `.env` file to add several at once. You can also have the agent set them up in [Build mode](#build-by-chatting).

<Note>
Values stored here can surface in command output the agent reads. To mask sensitive strings from it, set [`DIFY_AGENT_SHELL_REDACT_PATTERNS`](/en/self-host/deploy/configuration/environments#new-agent-beta).
Values stored here can surface in command output the agent reads. To mask sensitive strings from it, set `DIFY_AGENT_SHELL_REDACT_PATTERNS`. See [Environment Variables](/en/self-host/deploy/configuration/environments#new-agent-beta) for details.
</Note>

## Build by Chatting
Expand Down Expand Up @@ -200,9 +200,11 @@ To share the agent across workspaces, export it as a DSL file. The exported file

- **Time**

A single agent run is stopped after 1 hour by default, whichever access point it starts from (web app, service API, or a workflow), and the unfinished reply is discarded.
A single agent run is stopped after 20 minutes by default, whichever access point it starts from (web app, service API, or a workflow), and the unfinished reply is discarded.

If a run gets cut off, try again or break the task into smaller steps. If your agent's tasks routinely run longer, raise [`DIFY_AGENT_RUN_TIMEOUT_SECONDS`](/en/self-host/deploy/configuration/environments#new-agent-beta).
If a run gets cut off, try again or break the task into smaller steps. To allow runs up to an hour, raise `APP_MAX_EXECUTION_TIME` and `WORKFLOW_MAX_EXECUTION_TIME` to `3600`; for longer runs, raise those two and `DIFY_AGENT_RUN_TIMEOUT_SECONDS` above the duration you need.

See [Environment Variables](/en/self-host/deploy/configuration/environments) for details on these variables.

- **Model requests**

Expand All @@ -214,15 +216,15 @@ To share the agent across workspaces, export it as a DSL file. The exported file

Each file the agent sends back in a reply can be up to 50 MB by default, and larger files aren't delivered.

If your agent produces bigger artifacts, raise [`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/en/self-host/deploy/configuration/environments#new-agent-beta).
If your agent produces bigger artifacts, raise `DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`. See [Environment Variables](/en/self-host/deploy/configuration/environments) for details.

## Troubleshooting

<AccordionGroup>
<Accordion title="Agents doesn't appear in the navigation or the node list">
The deployment's `.env` predates 1.16.0, so the Agents switch is missing or still off.

Sync it with `.env.example` (the switch is [`NEXT_PUBLIC_ENABLE_AGENT_V2`](/en/self-host/deploy/configuration/environments#new-agent-beta)), then recreate the web container (`docker compose up -d web`) and hard-refresh the browser.
Sync it with `.env.example` (the switch is [`NEXT_PUBLIC_ENABLE_AGENT_V2`](/en/self-host/deploy/configuration/environments#next_public_enable_agent_v2)), then recreate the web container (`docker compose up -d web`) and hard-refresh the browser.

In Chatflow apps the node's absence is expected: it's available in Workflow apps only.

Expand Down
6 changes: 3 additions & 3 deletions en/self-host/use-dify/nodes/agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ description: Run an agent as a step in your workflow, reasoning and using tools

## Declare Its Outputs

Every Agent node returns `text`, `files`, and `json` by default: everything the agent writes and produces arrives through them.
By default, an Agent node returns a single output, `text`: the agent's reply to its task, as one block of text. When a later step needs something more specific, like a single value or a particular file, declare it as its own output.

Often a later step needs one specific piece of that, like a single value or a particular file. Declare it as its own output: type `/` in the **Agent task**, choose **New output**, then name it and pick a type in place. Each declared output can be referenced by downstream nodes on its own.
Type `/` in the **Agent task**, choose **New output**, then name it and pick a type in place. Each declared output can be referenced by downstream nodes on its own.

A declared output sits right in the task text, so you can tell the agent exactly what to put in it. For example, in this task `{{vendor_name}}` and `{{quote_file}}` are declared outputs:

```text wrap
Compare the three vendor quotes in {{vendor_quotes}} and write a recommendation. Put the winning vendor's name in {{vendor_name}} and its quote PDF in {{quote_file}}.
```

Each file the agent returns is capped at 50 MB by default, adjustable with [`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/en/self-host/deploy/configuration/environments#new-agent-beta).
Each file the agent returns is capped at 50 MB by default, adjustable with `DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`. See [Environment Variables](/en/self-host/deploy/configuration/environments#new-agent-beta) for details.

</Tab>
</Tabs>
2 changes: 1 addition & 1 deletion ja/self-host/deploy/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ API が Agent バックエンドにアクセスするためのアドレスです
| `DIFY_AGENT_REDIS_PREFIX` | `dify-agent` | Agent バックエンドの Redis キーのプレフィックス。 |
| `DIFY_AGENT_SHUTDOWN_GRACE_SECONDS` | `30` | Agent バックエンドの停止時に、進行中の実行の完了を待つ秒数。 |
| `DIFY_AGENT_RUN_RETENTION_SECONDS` | `259200` | 終了した実行レコードの保持期間(デフォルトは 3 日)。 |
| `DIFY_AGENT_RUN_TIMEOUT_SECONDS` | `3600` | Agent 実行 1 回のモデルとツール処理に適用される制限時間。超過した実行は `agent_run_limit_exceeded` で失敗する。旧 `AGENT_BACKEND_RUN_TIMEOUT_SECONDS` を置き換える。<br/><br/>`e2b` バックエンドではサンドボックス側の `DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS`(上限 3600)も適用されるため、1 時間を超える値が効くのは `local` バックエンドのみ。 |
| `DIFY_AGENT_RUN_TIMEOUT_SECONDS` | `3600` | Agent 実行 1 回のモデルとツール処理に適用される制限時間。超過した実行は `agent_run_limit_exceeded` で失敗する。旧 `AGENT_BACKEND_RUN_TIMEOUT_SECONDS` を置き換える。<br/><br/>API 側の `APP_MAX_EXECUTION_TIME` と `WORKFLOW_MAX_EXECUTION_TIME`(デフォルト `1200`)が先に実行を停止するため、合わせて引き上げること。<br/><br/>`e2b` バックエンドではサンドボックス側の `DIFY_AGENT_E2B_ACTIVE_TIMEOUT_SECONDS`(上限 3600)も適用されるため、1 時間を超える値が効くのは `local` バックエンドのみ。 |
| `AGENT_BACKEND_STREAM_READ_TIMEOUT_SECONDS` | `30` | Agent バックエンドへの SSE 接続 1 本あたりの読み取りタイムアウト。 |
| `AGENT_BACKEND_STREAM_MAX_RECONNECTS` | `3` | ストリーム切断時、実行を失敗と判定するまでに API が再接続を試みる回数。 |
| `DIFY_AGENT_PLUGIN_DAEMON_URL` | (空。`PLUGIN_DAEMON_URL` から導出) | Agent バックエンドがツール呼び出しに使うプラグインデーモンのアドレス。 |
Expand Down
34 changes: 23 additions & 11 deletions ja/self-host/use-dify/build/new-agent/build.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ Dify ツールやファイルを Agent 自身の能力の一部にするには
| 動画 | 100 MB | `UPLOAD_VIDEO_FILE_SIZE_LIMIT` |
| 音声 | 50 MB | `UPLOAD_AUDIO_FILE_SIZE_LIMIT` |

[ビルドモード](#チャットによるビルド) では、Agent にファイルを作成させ、ここに保存させることもできます。Agent が作成して保存するファイルは、デフォルトで 1 ファイルあたり最大 50 MB です。[`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) で調整できます。
[ビルドモード](#チャットによるビルド) では、Agent にファイルを作成させ、ここに保存させることもできます。

<Info>
Agent が作成して保存するファイルは、デフォルトで 1 ファイルあたり最大 50 MB です。`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT` で調整できます。詳細は [環境変数](/ja/self-host/deploy/configuration/environments) を参照してください。
</Info>

### ツール

Expand All @@ -111,9 +115,9 @@ Agent が [ビルドモード](#チャットによるビルド) でインスト

`.env` ファイルをインポートすれば、複数の変数を一度に追加できます。[ビルドモード](#チャットによるビルド) で Agent に設定させることもできます。

<Info>
ここに保存した値は、Agent が読み取るコマンド出力に現れることがあります。機密性の高い文字列をマスクするには、[`DIFY_AGENT_SHELL_REDACT_PATTERNS`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) を設定してください
</Info>
<Note>
ここに保存した値は、Agent が読み取るコマンド出力に現れることがあります。機密性の高い文字列をマスクするには、`DIFY_AGENT_SHELL_REDACT_PATTERNS` を設定してください。詳細は [環境変数](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) を参照してください
</Note>

## チャットによるビルド

Expand Down Expand Up @@ -195,25 +199,33 @@ Agent をワークスペース間で共有するには、DSL ファイルとし

### 実行の制限

- **実行時間**:どのアクセスポイントから開始しても(Web アプリ、サービス API、ワークフロー)、1 回の実行はデフォルトで 1 時間後に停止され、未完成の返信は破棄されます。
- **実行時間**

どのアクセスポイントから開始しても(Web アプリ、サービス API、ワークフロー)、1 回の実行はデフォルトで 20 分後に停止され、未完成の返信は破棄されます。

実行が打ち切られた場合は、もう一度試すか、タスクを小さく分割してください。最長 1 時間まで許可するには、`APP_MAX_EXECUTION_TIME` と `WORKFLOW_MAX_EXECUTION_TIME` を `3600` に引き上げます。1 時間を超える場合は、この 2 つと `DIFY_AGENT_RUN_TIMEOUT_SECONDS` をいずれも目標の実行時間より高く設定します。

これらの変数の詳細は [環境変数](/ja/self-host/deploy/configuration/environments) を参照してください。

- **モデルリクエスト数**

実行が打ち切られた場合は、もう一度試すか、タスクを小さく分割してください。タスクが日常的にそれ以上かかるなら、[`DIFY_AGENT_RUN_TIMEOUT_SECONDS`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) を引き上げ、`docker compose up -d` を実行して反映します
Agent がモデルを呼び出すたびに、1 回の実行につき 500 回の上限を消費します。推論が重く、ツールを多く使うほど早く達します

- **モデルリクエスト数**:Agent がモデルを呼び出すたびに、1 回の実行につき 500 回の上限を消費します。推論が重く、ツールを多く使うほど早く達します
タスクを小さく分割して、各実行を上限内に収めてみてください

タスクを小さく分割すれば、各実行を上限内に収められます。
- **返信ファイル**

- **返信ファイル**:Agent が返信で送り返すファイルは、デフォルトで 1 ファイルあたり最大 50 MB で、それを超えるファイルは届きません。
Agent が返信で送り返すファイルは、デフォルトで 1 ファイルあたり最大 50 MB で、それを超えるファイルは届きません。

より大きな成果物が必要な場合は、[`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) を引き上げてください
より大きな成果物が必要な場合は、`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT` を引き上げてください。詳細は [環境変数](/ja/self-host/deploy/configuration/environments) を参照してください

## トラブルシューティング

<AccordionGroup>
<Accordion title="ナビゲーションに Agents が表示されない、またはノード一覧に Agent ノードがない">
デプロイの `.env` が 1.16.0 より古く、Agents のスイッチが存在しないか、オフのままになっています。

`.env.example` と同期してください(スイッチは [`NEXT_PUBLIC_ENABLE_AGENT_V2`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)))。その後、web コンテナを再作成(`docker compose up -d web`)し、ブラウザを強制リロードします。
`.env.example` と同期してください(スイッチは [`NEXT_PUBLIC_ENABLE_AGENT_V2`](/ja/self-host/deploy/configuration/environments#next_public_enable_agent_v2))。その後、web コンテナを再作成(`docker compose up -d web`)し、ブラウザを強制リロードします。

Chatflow アプリでこのノードが見当たらないのは仕様です。新しい Agent ノードは Workflow アプリでのみ使用できます。

Expand Down
6 changes: 3 additions & 3 deletions ja/self-host/use-dify/nodes/agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ description: "ワークフローの 1 ステップとして Agent を実行し

## 出力の宣言

すべての Agent ノードは、デフォルトで `text`、`files`、`json` を返します。Agent が書いた内容と生成物は、すべてこの 3 つに入ります
Agent ノードがデフォルトで返す出力は `text` の 1 つで、タスクに対する Agent の返信がテキストとして入ります。後続のステップで、単一の値や特定のファイルなど、より具体的な内容が必要な場合は、独自の出力として宣言します

後続のステップでは、その中の特定の 1 つ、たとえば単一の値や特定のファイルだけが必要になることがよくあります。その場合は独自の出力として宣言します。**Agent タスク** 内で `/` を入力して **新しい出力** を選び、その場で名前と型を指定します。宣言した各出力は、下流のノードから単独で参照できます。
**Agent タスク** 内で `/` を入力して **新しい出力** を選び、その場で名前と型を指定します。宣言した各出力は、下流のノードから単独で参照できます。

宣言した出力はタスク本文の中に置かれるため、何を入れるかを Agent に直接指示できます。次のタスクでは、`{{vendor_name}}` と `{{quote_file}}` が宣言した出力です。

```text wrap
{{vendor_quotes}} の 3 社の見積もりを比較して、推薦をまとめてください。採用するベンダー名を {{vendor_name}} に、その見積もり PDF を {{quote_file}} に入れてください。
```

Agent が返すファイルは、デフォルトで 1 ファイルあたり最大 50 MB です。[`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT`](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) で調整できます
Agent が返すファイルは、デフォルトで 1 ファイルあたり最大 50 MB です。`DIFY_AGENT_STUB_UPLOAD_FILE_SIZE_LIMIT` で調整できます。詳細は [環境変数](/ja/self-host/deploy/configuration/environments#新しい-agent(ベータ版)) を参照してください

</Tab>
</Tabs>
Loading
Loading