An interactive textbook
AI Agent Memory
Novice to Ninja
How an AI assistant remembers you, taught from zero with one card box, one secretary, one librarian, and numbers you can move with your own hands.
Start readingOpen the memory lab
25 chapters · about 5.0 hours · 45 interactives · no background needed
The library behind the book
hanumemAI
Remember everything. Inject almost nothing.
A plug-and-play memory layer for AI agents: one Python package, one SQLite file, any OpenAI-compatible model. It was tuned by 121 logged experiments, and this book teaches every idea inside it.
Scores are LLM-judged accuracy. Each tile names its answer model, its judge and its context tokens per question, because a score without those is a rumour. Where other systems score higher we say so in Chapter 18.
How to read this book
- In order. Each chapter uses only what the earlier ones taught.
- With your hands. Chapters marked interactive have sliders and small simulators. Move them before you read on.
- Answer before you look. Every chapter ends with questions and folded answers. Recalling beats re-reading.
Part I · Novice
Why models forget, and the one idea that fixes it.
Part II · Apprentice
The secretary, the box and the librarian, piece by piece.
Part III · Journeyman
Latency, prompts, privacy, scale, cost and evaluation.
Part IV · Ninja
Benchmarks, other systems, our own library and its 121 experiments.
Part V · Practice
Build it, play with the numbers, and answer it cold.