Deep-Dives / Memory & Context
Memory & Context
Context windows, memory stores, compaction, retrieval-augmented memory — keeping the right things on the prompt.
- Engineering the Context WindowTreat the finite window as a budgeted resource: per-category token budgets, position-aware ordering, and utilization metrics.
- Short-Term vs Long-Term MemoryThe in-prompt working set vs the external store: what earns a slot, when to write, when to recall, and the promotion/demotion cycle.
- Memory Types: Episodic, Semantic, ProceduralThree durable memory kinds plus the scratchpad, each written and retrieved differently; reflection promotes episodes to semantics.
- Retrieval-Augmented MemoryRecall as retrieval: state-derived cues, relevance+recency+salience scoring, threshold-before-truncate, and provenance-tagged rendering.
- Context Compaction & Hierarchical MemoryThe compaction ladder, task-structured summarization, MemGPT-style tiering, pressure-triggered hysteresis, and verifying lossy compaction.
- Memory Stores: Vector, KV, Graph & EvictionMatch backend to memory kind, a unified interface, why unbounded stores rot retrieval, and decay/eviction policies.
- Evaluating Memory QualityMemory-specific metrics (recall@k, staleness, constraint survival, write precision) and the pitfalls they catch: poisoning, staleness, drift, compaction amnesia.