> 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/advanced-basic/chat/context-queue.md).

# 长对话、上下文与排队消息

对话越长，模型需要阅读的历史越多。上下文用量接近上限时，较早内容可能无法继续参与回答。与其不断追加一句“继续”，不如定期整理结论和未决问题。

<figure><img src="/files/5FGCbs03TomfESmXVdqr" alt="助手高级设置中的模型温度和上下文管理选项"><figcaption><p>需要改变回答风格或长对话处理方式时再调整高级设置；不确定时先保留当前值。</p></figcaption></figure>

## 管理长对话

{% stepper %}
{% step %}

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

当界面提示上下文压力变大时，先停止添加大附件，检查哪些历史仍然与当前目标有关。
{% endstep %}

{% step %}

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

要求它分开列出“已确认事实、当前结论、待解决问题、不能丢失的限制”。这比普通的“总结一下”更适合继续工作。
{% endstep %}

{% step %}

### 3. 新开话题继续

把交接摘要和必要文件放进新话题，第一条消息说明接下来只处理哪个目标。原话题保留作参考。
{% endstep %}
{% endstepper %}

## 使用消息队列

模型仍在回复时，可以把下一条要求加入队列。适合追加一个明确的后续动作，例如“完成后再整理成三条结论”。如果新消息会改变正在执行的方向，应先停止当前生成，再重新说明目标。

<figure><img src="/files/8dMlmBN1th6VdvI4yYWv" alt="消息队列中两条待发送消息和恢复自动发送按钮"><figcaption><p>暂停时可以先核对结果；恢复后，排队消息会按照从上到下的顺序继续发送。</p></figcaption></figure>

图中：① 当前话题中两条排队消息；② 恢复自动发送。恢复后，消息会按照从上到下的顺序继续发送。

{% hint style="info" %}
队列不是自动化计划。它只负责当前话题里的后续消息；需要在固定时间运行，请使用【定时任务】。
{% endhint %}

### 应用案例：审阅一份长报告

先上传报告并要求按章节列出问题。模型处理时，把“完成后整理风险清单”和“最后生成检查表”依次加入队列。需要先核对第一轮结果时，可以暂停自动发送；确认无误后再恢复。这样不用守在对话前逐条发送，也能避免下一步要求抢在核对之前执行。

<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 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/advanced-basic/chat/context-queue.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.
