> 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/chat/context-queue.md). Agents can also search and read this documentation through its [MCP server](https://docs.cherryai.com.cn/~gitbook/mcp).

# 長對話、上下文同排隊消息

對話越長，模型要讀嘅歷史就越多。上下文用量接近上限嗰陣，較早內容可能無法繼續參與回答。與其不斷加一句「繼續」，不如定期整理結論同未決問題。

<figure><img src="https://2742912793-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2F87p566DFy3eaKNsDYO9B%2Fclipboard.png?alt=media&amp;token=26decd2c-9401-4598-8643-56cf86ca27b5" alt="助手高级设置中的模型温度和上下文管理选项"><figcaption><p>需要改變回答風格或者長對話處理方式嗰陣先調整進階設定；唔確定時先保留而家個值。</p></figcaption></figure>

### 管理長對話

{% stepper %}
{% step %}

#### 1. 觀察上下文提示

當介面提示上下文壓力變大時，先停低加大附件，檢查邊啲歷史仲同而家目標有關。
{% endstep %}

{% step %}

#### 2. 令模型生成交接摘要

要求佢分開列出「已確認事實、當前結論、待解決問題、唔可以漏失嘅限制」。呢個比普通嘅「總結一下」更適合繼續做嘢。
{% endstep %}

{% step %}

#### 3. 開新話題繼續

將交接摘要同必要文件放入新話題，第一條訊息講明之後只處理邊個目標。原話題保留作參考。
{% endstep %}
{% endstepper %}

### 調整全局上下文管理

路徑：【設定】→【通用】→【上下文管理】。呢啲設定適用於一般助手對話；單個助手亦可以喺自己設定入面覆蓋。

| 配置項      | 產品預設值    | 建議起點    | 作用             | 適用場景          | 注意事項             |
| -------- | -------- | ------- | -------------- | ------------- | ---------------- |
| 保留最近訊息數  | 唔限制      | 先唔限制    | 只將最近若干條訊息送畀模型  | 固定視窗嘅短任務      | 太細會令模型忘記仲有效嘅要求   |
| 啟用上下文管理  | 開啟       | 保持開啟    | 管理超長工具結果同歷史壓縮  | 長對話、工具調用多嘅任務  | 關閉之後，大結果更容易塞滿上下文 |
| 工具輸出截斷閾值 | 50000 字元 | 保持預設    | 大結果轉存之後令模型分段讀取 | 網頁、日誌、長文檔工具結果 | 唔等於刪除原始結果        |
| 自動壓縮     | 開啟       | 保持開啟    | 接近視窗上限時總結較早歷史  | 持續多輪工作        | 壓縮只係摘要，唔保證保留每個細節 |
| 壓縮模型     | 跟隨當前模型   | 先跟隨當前模型 | 選擇生成歷史摘要嘅模型    | 需要單獨控制速度或者成本  | 更換模型會增加排錯變數      |

【設定】→【預設模型】仲有【模型調用重試】。預設關閉；開啟之後預設最多嘗試 3 次並用指數退避，亦可以按順序揀回退模型。重試同回退只喺模型開始輸出之前生效，唔會將已經生成到一半嘅回答改用另一個模型繼續。

### 使用訊息隊列

模型仲喺度回覆嗰陣，可以將下一條要求加入隊列。適合追加一個明確嘅後續動作，例如「完成後再整理成三條結論」。Agent 運行中如果要即刻糾正而家方向，使用【引導快捷鍵】；如果需要徹底重嚟，再停止當前生成並重新說明目標。

<figure><img src="https://2742912793-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2FaTBD45pjQfUwZjNL9Mlk%2Fclipboard.png?alt=media&amp;token=06db0934-1751-4daa-a97f-4d7a5932a3c7" alt="消息队列中两条待发送消息和恢复自动发送按钮"><figcaption><p>暫停嗰陣可以先核對結果；恢復之後，排隊訊息會按照由上到下嘅順序繼續發送。</p></figcaption></figure>

圖中：① 當前話題入面兩條排隊訊息；② 恢復自動發送。恢復之後，訊息會按照由上到下嘅順序繼續發送。

{% hint style="info" %}
隊列唔係自動化計劃。佢只負責當前話題入面嘅後續訊息；如果需要喺固定時間運行，請用【定時任務】。
{% endhint %}

#### 應用案例：審閱一份長報告

先上載報告並要求按章節列出問題。模型處理嗰陣，將「完成後整理風險清單」同「最後生成檢查表」依次加入隊列。需要先核對第一輪結果時，可以暫停自動發送；確認無誤之後再恢復。咁樣就唔使企喺對話前逐條發送，亦可以避免下一步要求搶喺核對之前執行。

<details>

<summary>點解模型突然唔記得前面講過嘅要求？</summary>

先檢查對話係咪過長、係咪切換咗模型，同埋關鍵要求係咪只出現過一次。將穩定規則寫入當前任務嘅明確說明；需要長期重用時，就交畀 Agent 提示詞或者技能。

</details>

<details>

<summary>點解模型突然唔記得前面講過嘅要求？</summary>

先檢查對話係咪過長、係咪切換咗模型，同埋關鍵要求係咪只出現過一次。將穩定規則寫入當前任務嘅明確說明；需要長期重用時，就交畀 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/chat/context-queue.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
