Build Memory from Scratch
Reading types of memory does not ship. A small loop teaches write/read/forget.
A shoebox of index cards before you buy a warehouse.
Visual Workflows
Start here — scroll inside each diagram frame to explore, then use + / − to zoom up to 200% if needed.
Overview
Scroll inside the frame to explore · use + / − to zoom up to 200%
Scroll inside the frame to explore · use + / − to zoom up to 200%
Minimum viable memory
Scroll inside the frame to explore · use + / − to zoom up to 200%
One extract step, one store, retrieve on the next message, pack three facts max.
Key Takeaways
- 1.Build a tiny memory stack: extract, store, retrieve, pack. Start with one user, one KV for prefs, one vector for notes.
- 2.Add a session summary before you add a graph. Log every write and retrieve — memory bugs are silent.
- 3.Implement extract → put → get → pack on one user. Cap packed memories at three.
- 4.Add a session summary next. Only then add types (semantic vs episodic).
Learn elsewhere
- →This whole phase
- →Persistent assistant project
Real Example
Scenario
Afternoon build: Redis `user:12:pref:lang=python`, retrieve on each turn, pack into the system prompt. Tomorrow add a vector of ticket recaps.
What you would do
In Agent Memory, apply Build Memory from Scratch to this scenario: Afternoon build: Redis `user:12:pref:lang=python`, retrieve on each turn, pack into the system prompt. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.
Commands
Commands to Remember
Extract → store → retrieve → packCap packed memoriesLog writes and hitsGraph last, not first
Cheat Sheet
Quick recap
quick ref- •Shoebox first
- •Four-step loop
- •Cap at three
- •Log silent memory
Common Mistakes
- ✕Starting with a knowledge graph
- ✕No log of what was stored
- ✕Retrieving everything you ever saved
