compaction
Compaction is a data or memory management technique in computer science that reorganizes scattered or fragmented data and storage space to improve space utilization and access efficiency. It is widely applied in memory management, database storage engines, file systems, and garbage collection mechanisms, eliminating fragmentation to optimize system performance. In the context of context-window management, the term also refers to compressing and summarizing long sequences of information to support extended task processing.
Core Facts
Compaction refers to the framework automatically condensing earlier conversations into summaries or removing redundant content to free up space when session messages exceed the model's context window limit.
Conversation history auto-compaction summarizes earlier conversation history and retains only key context, thereby reducing the token cost of each request and alleviating context window limitations.
The compaction mechanism frees up context space by summarizing and compressing conversation history, but it is essentially a lossy operation that discards a large amount of detail that might otherwise have been useful.
Timeline (last 90 days)
A summary is itself a model generation and introduces new risk of distortion, so summaries should retain verifiable hard information as much as possible (file paths, error codes, confirmed conclusions) and compress narrative content.
Compaction is lossy, and summaries of summaries gradually drift, so as much detailed information as possible should be moved out of the window into permanent files and pulled back only when needed.
When a summary becomes the source of truth and the summary is wrong, the agent will not report uncertainty but will confidently argue with you about work you watched it complete with your own eyes.
To evaluate whether compression is beneficial or whether switching to a smaller model makes sense, one cannot look only at the drop in Token count per request, but must fix the source input and success criteria while comparing the final task result with the total usage of the entire task (including additional work such as summary generation).
Common methods for controlling the cost of long tasks are caching and compaction, where the former reuses already-processed context and the latter streamlines the history.
The compaction mechanism frees up context space by summarizing and compressing conversation history, but it is essentially a lossy operation that discards a large amount of detail that might otherwise have been useful.
Compaction refers to the framework automatically condensing earlier conversations into summaries or removing redundant content to free up space when session messages exceed the model's context window limit.
Conversation history auto-compaction summarizes earlier conversation history and retains only key context, thereby reducing the token cost of each request and alleviating context window limitations.
Sub-agents have had automatic compaction enabled to improve context management in long sessions.
Automatic compaction frees up context space by summarizing or trimming historical messages, which can reduce the cost of API calls billed per token.
3 more timeline events
All Facts (13)
Compaction refers to the framework automatically condensing earlier conversations into summaries or removing redundant content to free up space when session messages exceed the model's context window limit.
75%VerifiedConversation history auto-compaction summarizes earlier conversation history and retains only key context, thereby reducing the token cost of each request and alleviating context window limitations.
75%VerifiedThe compaction mechanism frees up context space by summarizing and compressing conversation history, but it is essentially a lossy operation that discards a large amount of detail that might otherwise have been useful.
65%VerifiedCompaction is a technique in which, when a thread accumulates to a certain length, the system distills the conversation history into a more compact summary rather than simply truncating it.
65%UnverifiedA summary is itself a model generation and introduces new risk of distortion, so summaries should retain verifiable hard information as much as possible (file paths, error codes, confirmed conclusions) and compress narrative content.
50%UnverifiedCompaction is lossy, and summaries of summaries gradually drift, so as much detailed information as possible should be moved out of the window into permanent files and pulled back only when needed.
50%UnverifiedWhen a summary becomes the source of truth and the summary is wrong, the agent will not report uncertainty but will confidently argue with you about work you watched it complete with your own eyes.
50%UnverifiedTo evaluate whether compression is beneficial or whether switching to a smaller model makes sense, one cannot look only at the drop in Token count per request, but must fix the source input and success criteria while comparing the final task result with the total usage of the entire task (including additional work such as summary generation).
50%UnverifiedCommon methods for controlling the cost of long tasks are caching and compaction, where the former reuses already-processed context and the latter streamlines the history.
50%UnverifiedSub-agents have had automatic compaction enabled to improve context management in long sessions.
50%UnverifiedAutomatic compaction frees up context space by summarizing or trimming historical messages, which can reduce the cost of API calls billed per token.
50%UnverifiedZed v1.22.0 officially enabled automatic compaction for sub-agents to control context bloat in long-running tasks.
50%Unverified递归摘要策略对已有摘要再次摘要,形成金字塔式信息压缩层次,在信息密度和计算成本间取得不同平衡点
50%