新增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,40 @@
---
title: "Memory Flush"
type: concept
tags: [AI, Agent, 记忆]
sources: [yang-long-xia-5-tian]
last_updated: 2026-04-14
---
## Definition
OpenClaw在对话压缩前将重要上下文写入磁盘的机制防止压缩过程中丢失重要信息。
## 工作原理
```json
{
"compaction": {
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000
}
}
}
```
当会话接近上下文限制4000 tokens
1. 触发静默回合
2. 提醒Agent将重要事实写入memory/YYYY-MM-DD.md
3. 压缩运行
4. 即使上下文摘要丢失,重要内容仍在磁盘上
## 注意
4000这个数值要根据模型context window调整
- 大模型32K/128K/200K用4000太保守会导致频繁summary
- 小模型可以用更激进的配置
## 关键洞察
"压缩不是敌人。压缩过程中丢失信息才是。" — 比利哥
## Connections
- [[Compaction]] ← 配合 ← [[Memory-Flush]]
- [[Context-Window]] ← 阈值依据 ← [[Memory-Flush]]