Skip to content

Early Release O'Reilly Media

Agent
Memory

Building Stateful AI Agents That Remember, Adapt, and Work Across Time

By Benjamin Labaschin

Chapters 1–3 are live on the O’Reilly platform right now. New chapters land every four to six weeks.

O’Reilly subscription required. Your company or university may provide access, or you can start a free 10-day trial.

Agent Memory by Benjamin Labaschin, an O'Reilly Early Release book featuring an adult horned grebe

Available now3 chapters live

Coming nextChapter 4

Reader feedbackChoose a chapter to comment on

Explore the chapters

Select a chapter to see its summary and availability.

Scroll horizontally to view all ten chapters.

Chapter 03Available now

Part I

Choosing What Becomes Memory

Which encountered information earns a durable representation and what future job that memory must perform.

Read it early.
Help make it better.

The architecture and examples are available while the manuscript is still taking shape. Your questions and experience can improve the final book.

Read the working chapters now

Early Release chapters arrive before copyedit, so you can use the material months before the finished book ships.

Your feedback can still change the book

This is the window where questions, thin spots, and examples from working engineers can still shape the final manuscript.

Follow the build as it happens

Chapter 3 is now live, and Chapter 4 is next. Subscribers hear when a new chapter lands.

Build memory you can inspect, maintain, and trust.

From choosing what to remember to recovering when memory fails.

Chapters 1–3

Decide what deserves to become memory

Use retention, compression, correction, and forgetting policies instead of storing everything.

Chapters 4–5

Write memory through an inspectable path

Design triggers, schemas, authority checks, persistence operations, and observable failure handling.

Chapter 6

Retrieve the right evidence at the right time

Form queries, rank candidates, load context, and evaluate whether recall actually helps.

Chapters 7–10

Maintain memory as it changes and grows

Handle corrections, rollups, duplicates, resumability, shared ownership, risk, and recovery.

Ten chapters.
Three parts.

Part I establishes the contracts. Part II turns them into systems. Part III handles coordination, risk, and recovery.

Read the complete table of contents

Part I

Agents, Memory, and the Act of Remembering

03

Choosing What Becomes Memory

Live now

Which encountered information earns a durable representation and what future job that memory must perform.

Part II

Building and Managing Agent Memory

04

How Memory Gets Written

Writing

Write triggers, schemas, policy decisions, persistence operations, observability, and failure handling.

05

Where Memory Lives and Who Controls It

Client versus server, portability, inspectability, ownership, and the control model.

06

Finding the Right Memory

Retrieval, ranking, context loading, caching, and evaluating whether recall improves the result.

07

Keeping Memory Useful Over Time

Rollups, corrections, versioning, duplicate detection, and maintenance strategies.

08

More Than Memory: State and Resumability

Checkpoints, durable work, resume, replay, and human pause points.

Part III

Shared Memory, Risk, and Recovery

09

Shared Memory: Coordination, Boundaries, and Conflict

Ownership, leakage, multi-agent coordination, provenance, and conflict.

10

Dangerous Memory: Risk, Failure, and Recovery

Poisoning, detection, repair, rollback, and designing memory to fail safely.

Email updates

Get the next chapter update

Chapter releases from Agent Memory, plus occasional emails about new writing and talks.