Module 7 · Agent Memory & State · Lesson 16 of 34

Agent state: keeping track of the work

Task lists, checkpoints and scratchpads: how long-running agents know where they are.

In this lesson · about 16 minutes

  • Explain the difference between memory and state
  • Design a simple state record for a multi-step task
  • Use checkpoints so an agent can resume after a failure

Memory is what the agent knows about the world and the user. State is where it is in the current job: what is done, what is next, what it found so far. A one-question chatbot barely needs state. An agent that spends twenty minutes migrating a codebase or processing 300 invoices needs it badly.

A good state record is structured, short and saved outside the model:

{
  "task": "Reconcile October invoices",
  "status": "in_progress",
  "done": 212, "total": 300,
  "next": "invoice 213",
  "problems": ["INV-0098: amount does not match PO"],
  "budget_left": { "steps": 140, "dollars": 3.10 }
}
  • Checkpoints: save the state after each unit of work. If the agent crashes or hits a limit, it resumes at invoice 213 instead of starting again.
  • Scratchpad notes: a short running log of findings, so the agent does not need its full history to remember what it learned.
  • Single source of truth: the state lives in your system, and the agent reads and updates it through tools. Then a person can inspect it too.

Decision scenario

The agent that started over

You built an agent that tags 5,000 support tickets.

After 3 hours it hit a rate limit at ticket 4,100 and crashed. When restarted, it began again at ticket 1, paying for the first 4,100 tickets twice.

What do you recommend?

0 of 3 options explored. Try the others to see how each would play out.

Flashcards

Memory and state

0 of 6 known

Say the answer out loud, flip the card, then be honest: cards you miss come back at the end.

6 left in the deck

Plan memory and state for your project.

Consider these questions and write down your thoughts. What you write stays on this device.

Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.