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.