Skip to main content
A session ends. The loop shuts down. When it starts again the next day, what does it remember? Without persistent memory: nothing. It wakes up blank, unsure of the goal and unsure of what it already did. This is why memory matters for any loop-based system: memory provides the persistent notes the loop reads at the start of a session so it can resume work without redoing finished tasks or repeating past mistakes.
Keep memory small and focused. A few targeted notes let the loop resume quickly while avoiding information overload.
A memory setup can be simple.
The image depicts a concept of seamlessly resuming a process, represented by a brain icon labeled "Memory" linked to an infinity loop labeled "The Loop." It highlights benefits like "No wasted effort" and "No starting over."
Key ideas
  • Memory is the set of notes the loop keeps across sessions so work continues across restarts.
  • Without memory the loop may redo finished work or repeat a mistake it already learned from.
  • With memory the loop reads its notes first, sees where it left off, and picks up right where it stopped.
What to store: three tiers
  • Now — the current state: what the loop is doing right now (current goal and current task).
  • Recent — short-term notes: the most recent steps and their outcomes.
  • Archive — long-term record: deeper history to consult when needed.
Short-term notes should be up front; long-term archives live in the back. This keeps the important context easy to reach while still preserving full history. So what should the notes actually hold? Five fields work well:
  1. Goal — what “done” looks like, so the aim never drifts.
  2. Last score — the most recent evaluation or metric from the scorer.
  3. What was tried — recent attempts, especially failures, to avoid repeats.
  4. What is next — the very next step to take, so the loop can start fast.
  5. Waiting for a human — explicit items that require human intervention or sign-off.
A compact table makes this easy to scan: Keep the five fields concise and machine-readable where possible so automated restarts can act immediately.
The image shows a list titled "Five Notes, Written Down," with five labeled items: Goal, Last score, What was tried, What is next, and Waiting for a human.
Avoid context drift Memory must be kept current. If the loop trusts old notes after the environment, data schema, or goals have changed, it will act on a stale picture and make wrong calls. This failure mode is called context drift. The fix is simple: refresh or invalidate related notes whenever the system, goals, or external constraints change.
Context drift is a practical failure mode: stale memory causes wrong assumptions. Update or invalidate related notes whenever the system, goals, or external constraints change.
Why this pays off Memory lets a loop pause and pick back up where it left off without starting over. It can stop at the end of the day, persist its notes, and continue the next morning as if no time had passed. For long-running jobs that span many sessions, consistent memory is essential: individual sessions perform work well, but memory makes many sessions add up to continuous, steady progress.
The image is a diagram titled "Memory Ties It Together," illustrating a sequence from "Memory" to "Session 3," each represented by colored squares connected by a line, with symbols inside the squares.
Recap
  • Without memory, a loop forgets what it did last time.
  • Use three places: now (current), recent (short-term), archive (long-term).
  • Record five concise notes: Goal, Last score, What was tried, What is next, Waiting for a human.
  • Keep notes current to prevent context drift.
The image is a recap with five sections labeled "Remembers," "Three places," "Five notes," "Kept current," and "Pause." Each section has an accompanying icon.
This completes the module.

Watch Video