The hand-drawn diagrams make abstract ideas click instantly. Wish every technical book was written like this.

Memory in AI Systems
Give your LLM a memory that persists.
From context engineering to the full memory taxonomy — buffer, summary, episodic, hybrid — plus RAG and agentic Graph RAG. Code memory layers from scratch, then build a personalized AI tutor with Mem0.
Read on your Kindle or e-reader
Download the EPUB and read offline — perfect for the train. Works on Kindle, Kobo, Apple Books & more.
00Why Memory Matters5 capsules
Why Memory Matters — 5 chapters.
01The Stateless Problemintuitionfree10 min02What Is Memory in an LLM?conceptfree11 min03The Context Window Is Not Memoryconcept🔒10 min04Memory vs. Parameters: Where Knowledge Livesconcept🔒10 min05What We'll Build in This Bookconcept🔒12 min01Context Engineering6 capsules
Context Engineering — 6 chapters.
06Introduction to Context Engineeringconcept🔒10 min07The Four Components of Contextconcept🔒11 min08Prompts: The Instruction Layerconcept🔒9 min09Knowledge: Grounding in External Factsconcept🔒10 min10Tools: Letting the Model Actconcept🔒11 min11The Context Budget Problemintuition🔒11 min02The Memory Taxonomy7 capsules
The Memory Taxonomy — 7 chapters.
12Short-Term vs. Long-Term Memoryconcept🔒11 min13Buffer Memoryconcept🔒10 min14Summary Memoryconcept🔒11 min15Episodic Memoryconcept🔒11 min16Hybrid Memoryconcept🔒10 min17Semantic vs. Episodic: Facts vs. Eventsconcept🔒10 min18Choosing a Memory Strategyintuition🔒10 min03Retrieval and Knowledge6 capsules
Retrieval and Knowledge — 6 chapters.
19Why Retrieval? The Recall Problemintuition🔒10 min20Embeddings and Vector Searchmath🔒10 min21Retrieval-Augmented Generation (RAG)concept🔒12 min22RAG as a Long-Term Memory Engineconcept🔒11 min23Graph RAG: Memory with Relationshipsconcept🔒10 min24Agentic Graph RAGdeep-dive🔒10 min04Coding Memory Layers from Scratch6 capsules
Coding Memory Layers from Scratch — 6 chapters.
25Project Setup: A Bare LLM Loopcode🔒10 min26Coding Buffer Memory from Scratchcode🔒12 min27Coding Summary Memory from Scratchcode🔒12 min28Coding a Vector Memory Storecode🔒9 min29Coding Episodic Memory from Scratchcode🔒12 min30Assembling a Hybrid Memory Layerproject🔒11 min05Building with Mem06 capsules
Building with Mem0 — 6 chapters.
31Introducing Mem0concept🔒12 min32The Mem0 Core API: add, search, getcode🔒11 min33Designing a Personalized AI Tutorproject🔒11 min34Wiring Memory into the Tutor Loopcode🔒11 min35Personalization in Actioncode🔒10 min36Managing and Forgetting Memoriesdeep-dive🔒10 min06Putting It Together4 capsules
Putting It Together — 4 chapters.
37The Memory Design Decisionintuition🔒11 min38Evaluating Memory Systemsconcept🔒12 min39Failure Modes and Pitfallsdeep-dive🔒12 min40Capstone: A Memory-First Agentproject🔒11 minRatings & reviews
992 readersPractical and rigorous at the same time. I went straight from reading a capsule to shipping it at work.
A few sections moved fast for me, but re-reading with the figures open made everything land. Highly recommend.