Files
nexus/wiki/concepts/Context-Window.md
2026-04-14 16:02:50 +08:00

1.1 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Context Window concept
AI
模型
Context
yang-xia-ri-ji-4
yang-long-xia-5-tian
2026-04-14

Definition

模型能处理的上下文大小,决定了对话长度和信息保留量。

典型值

模型 Context Window
MiniMax-M2.7 200K tokens
deepseek-reasoner 16K tokens

Compaction机制

OpenClaw的对话压缩机制

  • 当对话填满Context Window时将旧消息压缩成摘要
  • 摘要抓住要点,但丢失细节(姓名、数字、具体决定)
  • safeguard模式预留一半token给compaction

Memory Flush解决方案

压缩前将重要上下文写入磁盘:

{
  "compaction": {
    "memoryFlush": {
      "enabled": true,
      "softThresholdTokens": 4000
    }
  }
}

Connections