Deep-Dives / Memory & Context

Memory & Context

Context windows, memory stores, compaction, retrieval-augmented memory — keeping the right things on the prompt.

  1. Engineering the Context Window
    Treat the finite window as a budgeted resource: per-category token budgets, position-aware ordering, and utilization metrics.
  2. Short-Term vs Long-Term Memory
    The in-prompt working set vs the external store: what earns a slot, when to write, when to recall, and the promotion/demotion cycle.
  3. Memory Types: Episodic, Semantic, Procedural
    Three durable memory kinds plus the scratchpad, each written and retrieved differently; reflection promotes episodes to semantics.
  4. Retrieval-Augmented Memory
    Recall as retrieval: state-derived cues, relevance+recency+salience scoring, threshold-before-truncate, and provenance-tagged rendering.
  5. Context Compaction & Hierarchical Memory
    The compaction ladder, task-structured summarization, MemGPT-style tiering, pressure-triggered hysteresis, and verifying lossy compaction.
  6. Memory Stores: Vector, KV, Graph & Eviction
    Match backend to memory kind, a unified interface, why unbounded stores rot retrieval, and decay/eviction policies.
  7. Evaluating Memory Quality
    Memory-specific metrics (recall@k, staleness, constraint survival, write precision) and the pitfalls they catch: poisoning, staleness, drift, compaction amnesia.
  8. Memory Write-Path Architectures
    RAG-only is dead for stateful agents — the write path (what earns a slot, when to write, when to update) is the 2026 focus, and the four memory kinds (episodic, semantic, procedural, relational) each want a different policy.
  9. Memory Poisoning Defenses
    AgentPoison at 80% ASR with <0.1% poison; MemoryGraft, SpAIware, Morris-II — lifecycle defenses at ingestion, storage, retrieval, and monitoring.
  10. Long Context: Effective vs Advertised
    Why RULER, NoLiMa, MRCR v2 diverge from advertised token ceilings by 30-60 points past 200K — and how to budget accordingly.
  11. Learned Retrievers & MemRL
    MemRL treats store / retrieve / update / summarize / discard as tools optimized via RL — rank by learned utility rather than semantic similarity alone.