Skip to content
Road to Intelligence

Concept · Chapter 13: Agents

Agent Memory

Should knowUnderstand7 minDifficulty

Agent memory retains and retrieves task evidence, state and useful history across model calls.

The problem

A long task exceeds active context and can outlive a process or conversation.

The solution

Store structured task state and provenance, using summaries and retrieval for relevant history.

The consequence

Memory saves context but can preserve mistakes or discard important constraints.

Four different things called memory

Working context is what the model sees now. Durable state survives a restart. Retrieved notes reintroduce selected past information. Model weights encode learned behavior. The inference KV cache accelerates attention to a supplied context; it is not a permission ledger or an editable knowledge base.

A useful checkpoint

“Added initial accumulator 0; tests for [], [3,4] and [5] passed on patch version B; deployment not requested” is actionable. “Fixed it” is not. Preserve links to exact observations when summaries lose detail.

A note can be stale, mistaken or malicious. Label its source, scope and time. Treat a retrieved instruction as data unless it has the right authority. Compaction should not promote a speculation into a fact or erase the user's constraints.

Reflexion is an example of retaining reflective text between trials without updating model weights. Memory is the storage mechanism; whether its contents improve decisions must be evaluated.

What to remember

  • Agent memory retains and retrieves task evidence, state and useful history across model calls.
  • Store structured task state and provenance, using summaries and retrieval for relevant history.
  • Memory saves context but can preserve mistakes or discard important constraints.

Key papers

Important

Reflexion: Language Agents with Verbal Reinforcement Learning

Noah Shinn et al. · 2023

Uses feedback and stored reflection to influence later trials without weight updates.

How to read it: Inspect the feedback sources and ablations, not just the final success rate.

~35 min readarXiv:2303.11366✓ verified 2026-10-05