> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/agent-workspace/workspaces-tasks-files.md).

# 工作目錄、任務同檔案

Agent 嘅「記憶」同「文件」唔係一回事。任務會保存對話過程，工作目錄會保存今次任務可以直接處理嘅文件，而 Agent 記憶就會喺唔同任務之間保留穩定事實同經驗。

## 揀邊種工作目錄

開始新任務時，工作目錄選擇器會提供已有目錄、【新增工作目錄】同【不使用工作目錄】。

| 任務類型            | 建議揀           | 原因                   |
| --------------- | ------------- | -------------------- |
| 修改程式碼、整理資料、生成文件 | 只包含今次項目嘅目錄    | 方便 Agent 搵到文件同控制存取範圍 |
| 臨時問答，或者唔需要本地文件  | 【不使用工作目錄】     | 減少無關文件入到任務           |
| 需要臨時產物但冇現成目錄    | 用應用程式建立嘅預設工作區 | 產物同個人目錄分開            |

{% hint style="danger" %}
唔好為咗求方便就揀桌面根目錄、用戶主目錄，或者包含大量私密資料嘅目錄。工作目錄決定 Agent 可以操作嘅文件範圍，權限模式決定操作係咪需要確認，兩者要一齊檢查。
{% endhint %}

<figure><img src="/files/fc057a6fe0013b22be8bf5ebcc416a2e3b95343c" alt="Agent 工作区中的任务列表、工作目录和主操作区"><figcaption><p>開始前先確認而家嘅 Agent、任務同工作目錄，避免將文件寫去錯嘅項目。</p></figcaption></figure>

## 管理任務

* 撳【新任務】開始新嘅上下文；
* 任務可以改名、固定同按工作目錄分組；
* 右鍵任務可揀【喺新分頁中打開】或者【從新視窗打開】；
* 一個 Agent 至少要保留一個任務；
* 刪除工作目錄記錄時，會刪除其下嘅任務記錄，但唔會刪除磁碟目錄本身。

## 喺右側面板處理文件

Agent 生成或者修改文件之後，打開右側【文件】就可以瀏覽工作區。可編輯嘅 UTF-8 文字文件支援喺預覽同編輯之間切換，輸入之後會自動儲存，唔需要另外撳保存按鈕。

如果磁碟上嘅文件喺編輯期間被其他程式修改，Cherry Studio 會提示重新載入。揀重新載入會放棄而家嘅草稿；保留草稿時自動儲存會暫停，直到衝突處理完成。

## 產物同任務狀態

右側【狀態】會匯總 Agent 聲明嘅產物、子智能體、工作流、後台命令同上下文用量。長任務運行時，可以先喺呢度判斷佢係喺繼續工作、等緊權限，定係已經失敗。

<figure><img src="/files/3647bc078c5aedd2b5fcc6ca63eb38ea1841888b" alt="Agent 右侧状态面板中的产物、任务与后台执行信息"><figcaption><p>長任務先睇【狀態】判斷係喺運行、等緊批准定係已經失敗。</p></figcaption></figure>

## 做到乜嘢先算完成

* 任務頂部顯示嘅係今次項目目錄；
* 右側【文件】可以搵到約定嘅交付文件；
* 右側【狀態】冇待批准或者失敗嘅步驟；
* 原始資料冇被覆蓋，交付文件可以獨立打開。

## 用戶案例：整理訪問素材

為「訪問整理」Agent 新建任務，工作目錄只揀今次訪問文件夾。要求 Agent 保留原始記錄，新建 `summary.md` 同 `quotes.md`。任務完成後喺右側【文件】檢查引用同文字，然後直接修訂少量錯字；下一位受訪者另外開新任務，避免上下文混用。

<details>

<summary>點解右側冇【文件】？</summary>

而家嘅任務冇可存取嘅工作目錄，或者目錄已經不可存取。先喺任務頂部重新揀工作目錄，再發送一條訊息畀 Agent 讀取文件。

</details>

<details>

<summary>邊啲文件唔可以直接編輯？</summary>

二進制文件、非 UTF-8 文字同體積較大嘅文件只提供預覽或者外部打開。佢哋仍然可以由 Agent 工具處理，但未必可以喺內置編輯器入面修改。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/agent-workspace/workspaces-tasks-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
