AN Alpesh Nakrani
BlogBooksPraiseAbout Work with me →
Book overview
Front Matter / Technical Deep Dives

Front Matter: Memory Systems for Agents

Remembering Across Sessions Without Inventing the User

Key Takeaways

  • Front Matter: Memory Systems for Agents is a chapter about agent memory systems, not a generic AI adoption note.
  • The operating rule is to treat every memory as a sourced, scoped, revisable claim instead of an ambient fact.
  • The failure mode to watch is polished output without evidence, owner, cost line, or rollback path.
  • The useful next step is an artifact a future teammate can replay without folklore.

Agent memory is useful only when every stored claim has source, scope, decay, and deletion rules.

Book promise

Agent memory is a governed write-and-recall system, not a longer conversation history. This book teaches you to build the durable memory subsystem an agent needs to get better over time, episodic logs, semantic facts, preferences, procedural skills, long-horizon task state, and shared team memory, without turning every utterance into permanent, unverified, privacy-risky pseudo-knowledge.

This is a practical, systems-minded guide for people who have already shipped an agent and watched its memory betray them: the assistant that turned a sarcastic aside into a standing preference, the coding agent that "learned" a workflow that breaks on the third repository, the support copilot that confused one tenant's escalation policy with another's, the research agent that consolidated three correct episodes into one confidently wrong reflection. The book is written for AI engineers, agent builders, product engineers, MLOps engineers, backend engineers, and technical founders. You are assumed to understand RAG and long context. You need a real memory architecture.

This manuscript is not a philosophy of consciousness, not a psychology textbook, not a LangChain memory tutorial, and not a vector-database manual. It is a production architecture guide.

The recurring motif

A memory is a claim with a source, not a vibe.

Every durable memory the system keeps must know where it came from, who it belongs to, whether it is still true, whether it is allowed to persist, and when it should be forgotten. A memory that cannot answer those questions is not a memory. It is a rumor your agent will repeat with confidence.

The enemy

The belief this book exists to correct:

"Just add memory."

Agent memory is not a vector database, not a chat transcript, not a summary blob, not a hidden system prompt, and not a license to store everything a user says forever. Bad memory makes agents creepy, wrong, stale, overconfident, hard to delete, hard to audit, and easy to poison. The convenience of the phrase "just add memory" hides every decision that actually matters.

Relationship to Long Context Is Not Memory

The sibling book in this series, Long Context Is Not Memory (book 2), draws the boundary: a context window is temporary working space; memory is selected, durable, governed state. That book is about the prompt working set and context engineering. This book starts where that one ends. We accept that memory must be an explicit subsystem and then go deep on the part agents actually live in: the read/write loop interleaved with tool use, procedural skill libraries, reflection and consolidation, long-horizon task memory, and shared-versus-private memory across multiple agents. Where book 2 asks "is this in the window?", this book asks "should this become memory, who owns it, how will it be used, and how can it be forgotten?"

The MEMORY framework

One framework recurs through the book, used as a design aid and never as a fill-in-the-blank chapter template. Whenever a candidate fact wants to become a durable memory, interrogate it with six questions:

  • M: Meaningful. Is this useful enough to persist? Most of what an agent observes is noise.
  • E: Evidenced. What source event supports it? A memory points back to a turn, a tool result, or an observation, never to nothing.
  • M: Mutable. How can it be corrected, expired, or deleted? A memory you cannot revise is a liability.
  • O: Owned. Which user, tenant, or workspace controls it? Ownership decides who can read it, edit it, and forget it.
  • R: Restricted. What policy limits its use? Sensitivity, scope, and consent constrain recall.
  • Y: Yielding. Does recalling it improve the current task without dominating it? A memory that overrides the user's present instruction is worse than no memory.

Primary research references

These anchor the book. Each chapter uses its own chapter-specific sources; this is the shared spine.

How to read this book

Read it in order; the movements build. But each chapter is also a standalone reference for an engineer in the middle of a specific fire, a schema, a write gate, a recall ranker, a reflection policy, a poisoning test, an eval harness, a deletion runbook. The code is deliberately about agent memory infrastructure and not generic chatbot plumbing. Every artifact demonstrates the difference between an agent that accumulates governed, correctable knowledge and one that hoards confident guesses.

Table of contents

Movement I: The First Bad Memory

  1. The 7 a. m. Memory
  2. A Memory Is a Claim with a Source: A Working Taxonomy

Movement II: Inside the Loop 3. The Agent's Read/Write Loop 4. The Write Gate: Deciding What Deserves to Persist 5. Recall Is Not Retrieval

Movement III: Memory That Changes Itself 6. Reflection, Consolidation, and the Summaries That Lie 7. Procedural Memory and Skill Libraries 8. Long-Horizon Task Memory

Movement IV: Memory Between Agents 9. Shared and Private Memory in Multi-Agent Systems 10. Forgetting, Decay, and Conflict Resolution

Movement V: The Things That Bite You 11. Privacy, Consent, Deletion, and Governance 12. Memory Poisoning and Security

Movement VI: Knowing It Works 13. Does the Agent Actually Improve? Evaluating Memory 14. Operating Memory in Production 15. Use Case Playbooks

Back cover

Agents become more useful when they remember. They also become more dangerous when they remember badly.

A useful assistant should know your preferences, your open tasks, your recurring workflows, and your past corrections. It should not turn jokes into permanent preferences, store sensitive facts without consent, confuse one user with another, or keep stale memories forever.

This book teaches memory as a production system. You will learn memory types, write gates, recall policies, provenance, reflection, skill libraries, long-horizon task state, multi-agent scoping, consent, deletion, poisoning defenses, evaluation, and operations.

By the end, you will not ask, "Can the agent remember?" You will ask, "Should this become memory, who owns it, how will it be used, and how can it be forgotten?"

Internal map

For the larger argument, keep this chapter connected to memory systems for agents, Memory Systems for Agents, Agents That Actually Work, and agentic workflows.

Share