新增wiki命令文件

This commit is contained in:
2026-04-14 16:02:50 +08:00
parent 65803c911d
commit c6e3d3c5db
485 changed files with 12578 additions and 396 deletions

View File

@@ -0,0 +1,35 @@
---
title: "Compaction内存压缩"
type: concept
tags: [AI, Agent, 上下文]
sources: [yang-xia-ri-ji-4, yang-long-xia-5-tian]
last_updated: 2026-04-14
---
## Definition
OpenClaw在对话填满Context Window时将旧消息压缩成摘要的机制。
## 问题
- 摘要抓住要点,但丢失细节
- 姓名、数字、具体决定统统消失
- 所有消息一视同仁(重要指令和闲聊得到相同待遇)
## 解决方案Memory Flush
```json
{
"compaction": {
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000
}
}
}
```
在压缩运行前将重要上下文写入memory/YYYY-MM-DD.md
## 关键洞察
"压缩不是敌人。未写入的上下文才是。" — 比利哥
## Connections
- [[Context-Window]] ← 受限于 ← [[Compaction]]
- [[Memory-Flush]] ← 保护机制 ← [[Compaction]]