Skip to content

research(context): Adaptive Focus Memory — three-level fidelity (Full/Compressed/Placeholder) for context budget (arXiv:2511.12712) #4017

@bug-ops

Description

@bug-ops

Description

Adaptive Focus Memory (AFM) assigns each past message one of three fidelity levels—Full, Compressed, or Placeholder—based on semantic relevance, temporal decay, and importance classification, packing messages under a fixed token budget.

This is directly applicable to zeph-context's assembler.rs and manager.rs (changed in CI-799). Current Zeph uses binary keep/discard; AFM's three-level model preserves structural awareness of discarded segments (Placeholder keeps position + ID without tokens), enabling better re-retrieval.

Relevance to Zeph

Implementation Sketch

  1. Add ContextFidelity { Full, Compressed, Placeholder } enum to context message metadata
  2. In assembler: select fidelity per message based on (semantic_distance_to_current, age, importance_score)
  3. Placeholder = store only (message_id, role, token_count, importance_score) — zero token cost in prompt
  4. On re-access: promote Placeholder → Compressed/Full via memory retrieval

Complexity vs Benefit

  • Complexity: Medium | Benefit: High (reduces context tokens 40-60% in long sessions without losing structural history)

Source

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Research — medium-high complexitycontextContext management and message handlingmemoryzeph-memory crate (SQLite)researchResearch-driven improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions