Auto-sync: 2026-04-18 00:18

This commit is contained in:
2026-04-18 00:18:08 +08:00
parent 7a7a35f726
commit 5ce3ede529
25 changed files with 694 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
---
title: "上下文压缩"
type: concept
tags: [ai-agent, memory, context]
last_updated: 2026-04-02
---
## Definition
当对话填满 Context Window上下文窗口OpenClaw 将旧消息压缩成摘要以腾出空间给新消息的机制。
## Problem
压缩摘要抓住了要点,但丢失了细节——姓名、数字、具体决定,统统消失。
## Key Insight
> "这是设计使然。上下文窗口是有限的。但默认行为对一切一视同仁,这意味着你精心设计的第三条消息指令,和第七条消息的闲聊得到了相同待遇。"
## Solution
启用压缩前的内存刷新Memory Flush在压缩运行前将重要上下文写入磁盘。
## Related
- [[上下文窗口]] — 有限的对话历史容纳量
- [[内存刷新]] — 在压缩前将重要内容写入磁盘的机制
- [[上下文记忆]] — AI Agent 保留对话历史的能力