Agentic AI Notebook
Agent Memory
Phase 5Module 15 of 15

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

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

Minimum viable memory

100%
Loading diagram...

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 → pack
  • Cap packed memories
  • Log writes and hits
  • Graph 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