Agent Memory
Agent Memory: From Chat History to a Knowledge Graph — the second course, a hands-on, opinionated follow-on to the Foundations course .
Do the Foundations course first. This course assumes it — it leans on §13 (conversation state), §19 (embeddings), §20 (RAG), and §23 (agents) and does not re-teach them. If those aren’t familiar, start with Foundations .
It goes deep on what an agent knows across sessions: a taxonomy of memory, conversational ingestion, a real Neo4j knowledge graph, hybrid (graph + vector) retrieval, lifecycle and decay, measurement, and a single measured, opinionated default. Work through the units in order — each one builds a piece, decides a tradeoff, and cites the SOTA it draws on.
-1
The Memory Problem
Goal: understand that two different things are both called “memory,” and that this course is about the more difficult one. Context management keeps a …
01
A Taxonomy of Memory
Goal: get a vocabulary before you build. “Memory” is not one thing — an agent has several kinds, each with its own content, lifecycle, and storage. …
02
The Naive Baseline
Goal: build the simplest memory that could work — persist conversation turns to SQLite and recall them by recency and keyword — and then watch it fail …
03
Semantic Recall with Embeddings
Goal: fix the biggest problem in the Unit 2 baseline. Embed each remembered fact as a vector and recall by meaning — using cosine similarity — so a …
04
Why a Graph
Goal: make the central decision of this course honestly. A graph is more work than a vector store — Docker, a schema, extraction, traversal. When is …
05
Modeling Memory as a Graph
Goal: start a real graph database (Neo4j, via Docker) and model a conversation’s memory in it by hand — sessions, turns, entities, and a small …
06
Ingestion: Extracting Structure
Goal: stop writing nodes and edges by hand. Give an LLM a raw conversational turn, have it produce (entity, relation, entity) triples, validate that …
07
Retrieval & Context Assembly
Goal: get facts back out of the memory graph and into a prompt. You will read the graph two different ways — entity-match traversal when you know the …
08
Curation & Lifecycle
Goal: keep the memory graph healthy over time. So far it only grows: every turn adds nodes and edges (Unit 6), and retrieval assumes the right facts …
09
Measure Before You Optimize
Goal: put a number on how good your memory recall actually is. Units 7 and 8 added knobs — decay rate, importance thresholds, top-k, hybrid weights — …
10
Observability & Privacy
Goal: treat memory as what it is — durable, personal data — and build the two operational habits that follow. Observability: every memory read and …
11
The Opinionated Default
Goal: put it all together. In one agent loop you will wire ingestion (Unit 6), the graph (Unit 5), hybrid retrieval (Unit 7), the lifecycle gate (Unit …