chapter four

4 Memory: What your agent remembers shapes what it becomes

 

This chapter covers

  • Deciding what information should survive each boundary
  • Building Hierarchical Retention for multi-tier memory management
  • Building a RAG Pipeline for governed evidence retrieval
  • Building Progress Tracking for resumable multi-session tasks
  • Designing Failure Journals that preserve evidence and candidate lessons
  • Upgrading Argus with cross-session memory
"Experience is not what happens to you, but what you do with what happens to you."

—Aldous Huxley

On a fast-moving game-development project, a new design direction or market shift can make yesterday’s accepted decision obsolete, while game designers and programmers still need one current version to build against [1]. The old decision still explains why the team changed course, but it should no longer guide execution. Deleting it would erase history, while editing it in place would erase the change itself. Keeping both versions without status creates another risk: retrieval may treat the obsolete one as current guidance.

The team records decisions in an append-only ledger. A newer decision supersedes an older one rather than rewriting or deleting it. Entries move through states such as proposed, accepted, deprecated, and superseded. The full history remains available, while the control plane exposes only the current accepted decision to execution.

4.1 What is memory? State, persistence, and knowledge across sessions

4.1.1 The memory hierarchy analogy

4.1.2 The memory lifecycle

4.1.3 How production agents handle memory today

4.1.4 Measuring memory quality

4.2 Pattern: Hierarchical Retention

4.2.1 Three tiers and the eviction question

4.2.2 In production: Claude Code's scoped memory sources

4.2.3 Building it

4.2.4 Before and after: What eviction looks like

4.2.5 Argus integration

4.2.6 When it breaks

4.3 Pattern: RAG Pipeline

4.3.1 Two governed paths: Compile and assemble

4.3.2 In production: Claude Code's tool-based retrieval

4.3.3 Building it

4.3.4 When it breaks

4.4 Pattern: Progress tracking

4.4.1 The checkpoint chain

4.4.2 In Production: Three approaches compared

4.4.3 Building it

4.4.4 When it breaks

4.5 Pattern: Failure journals

4.5.1 Failure fact, candidate lesson, published lesson

4.5.2 In production: Model-written notes as candidate memory

4.5.3 Building it