Skip to content

research(memory): Focus autonomous context compression — Knowledge block consolidation, 23% token reduction on SWE-bench (arXiv:2601.07190) #2510

@bug-ops

Description

@bug-ops

Source

arXiv:2601.07190 — "Active Context Compression: Autonomous Memory Management in LLM Agents"

Key Findings

  • "Focus" architecture: agents autonomously consolidate interaction history into a persistent Knowledge block, pruning less relevant context
  • ~23% token reduction on SWE-bench with no task performance loss
  • Biologically inspired exploration/exploitation balance for deciding what to compress vs retain
  • Unlike full compaction, only less-relevant segments are compressed — selective and cheaper

Gap in Zeph

Zeph currently uses compress_context in always_on mode — full compaction applied to the entire context window. The Focus approach is more selective: it identifies low-relevance segments and consolidates only those into the Knowledge block, leaving high-relevance recent context intact.

Existing compression issues (#2481 density-aware, #2460 performance-floor) focus on ratio selection, not on selective segment targeting. Focus is architecturally distinct.

Implementation Sketch for Zeph

  1. In zeph-memory, add a KnowledgeBlock segment type alongside the existing compaction pipeline
  2. Add a relevance scorer (cheap model) to identify segments below a threshold
  3. Route low-relevance segments to consolidation into the Knowledge block instead of full compaction
  4. Expose [memory.compression] strategy = "focus" | "always_on" config option
  5. Surface compression activity in TUI with a spinner ("Consolidating context…")

Agents with equivalent feature

  • SWE-bench top performers use selective context management (Cursor shadow workspace, Aider repo-map pruning)

References

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitymemoryzeph-memory crate (SQLite)researchResearch-driven improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions