Skip to content

AI 103 · Module 2

Designing Agent Memory Systems

How should an agent's memory be organized, instead of remembering everything?

Start Section 1
0 / 6 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Describe the memory lifecycle: Observe, Select, Store, Retrieve, Update, Forget
  • Explain memory creation, retrieval, update, consolidation, expiration, forgetting, conflict, privacy and governance in plain language
  • Use six design dimensions (Relevance, Recency, Reliability, Privacy, Cost, Context Budget) to judge whether a memory is worth keeping
  • Draft an Agent Memory Policy that says what is remembered, for how long, who can access it, when it is updated and when it is forgotten

The Problem

8 min

Remembering Everything Is Not a Design

It is tempting to solve the forgetting problem by saving everything the agent ever sees. After three months, that becomes its own problem.

Work scenario

A course-support agent has saved every message from a teaching team for a semester: about 2,000 notes. When a student asks about an assignment deadline, it retrieves three notes: the original deadline, an extension for another student, and a joke about the deadline. It confidently mixes them into one answer.

Remember everything

  • Noise crowds out the useful note
  • Old facts sit next to new ones
  • Private details are kept without a reason
  • Retrieval costs grow and the context budget shrinks

Designed memory

  • Only selected, useful information is kept
  • Each memory has a source, date and owner
  • Sensitive information is excluded or controlled
  • Memory is updated, expired and forgotten on purpose

Warning

Memory that is wrong, stale or unauthorized is worse than no memory, because the agent will use it with confidence. A person still needs to be able to see, correct and delete what an agent has kept.

Key takeaway: Good agent memory is organized and governed, not a pile of everything the agent has seen.

The Memory Lifecycle

9 min

The Memory Lifecycle

A memory is not a single event of "saving". It has a life: it is noticed, judged, stored, used, corrected and eventually let go. Designing memory means deciding what happens at every step.

The memory lifecycle
  1. Observe: notice new information during the work
  2. Select: decide whether it is worth keeping (Memory Creation)
  3. Store: write it with source, date, owner and access rules
  4. Retrieve: bring back only what this task needs
  5. Update: correct, merge (Consolidation) or replace it as facts change
  6. Forget: expire or delete it when it is no longer needed or allowed
  1. Observe and Select
    Most things the agent sees should not become memory. Selection is where the framework from Module 1 is applied.
  2. Store
    A memory without a source and a date cannot be checked later. Record where it came from, when, and who may see it.
  3. Retrieve
    Retrieval is a choice too. Relevance and the context budget decide which memories re-enter the context.
  4. Update and Forget
    Facts change. Memories need a way to be corrected, consolidated, expire, and be deleted, including on request.
Check yourself

During a chat, an agent notices the user say "I am on leave next week". Which lifecycle step decides whether this becomes a memory at all?

During a chat, an agent notices the user say "I am on leave next week". Which lifecycle step decides whether this becomes a memory at all?

Key takeaway: Design every step: Observe, Select, Store, Retrieve, Update, Forget. Selection and forgetting are the ones most often skipped.

9 min

Demonstration: One Memory, Six Steps

Follow one illustrative memory through the whole lifecycle. The details are created for demonstration purposes only.

A memory over time (illustrative)
StepWhat happensDesign question
ObserveIn a Monday meeting note: "Team agreed to wait for supplier B's revised quotation."Is this new information relevant to the ongoing work?
SelectKept as task memory for the follow-up project. A joke in the same note is ignored.Will it matter beyond this session?
StoreSaved with source (Monday meeting), date, owner (project lead), access (project team) and an expiry at project end.Can it be checked and controlled later?
RetrieveNext Monday, the agent brings it back for the follow-up list because the task matches.Is it relevant enough to spend context budget on?
UpdateSupplier B sends the revised quotation. The memory is updated to "quotation received", not kept as "waiting".What should replace the old state?
ForgetThe project closes. The task memory expires and is removed; only the final decision is kept in the project record.Who confirms what may be deleted?

Real memory systems also meet conflict: two memories that disagree. When that happens, do not let the agent quietly choose. Prefer the newer or more authoritative source, mark the older one as replaced, and ask a person to confirm when the decision has real consequences.

Info

Consolidation means merging several small memories into one accurate summary. It reduces clutter, but a summary is derived data and can carry errors, so keep a way back to the original.
Check yourself

An agent's memory says "Supplier X is preferred". A newer email from the procurement office says Supplier X was removed from the approved list. What is the best handling?

An agent's memory says "Supplier X is preferred". A newer email from the procurement office says Supplier X was removed from the approved list. What is the best handling?

Key takeaway: A memory changes over time. Plan for update, conflict, expiration and forgetting, not only saving.

Design Dimensions

8 min

Six Design Dimensions

To judge whether a candidate memory is worth keeping, and whether to bring it back, check it against six dimensions. You will not always maximize all six; the point is to make the trade-off visible.

Six design dimensions
DimensionThe questionExample of a decision
RelevanceWill this help future tasks?Keep the preferred report format; skip small talk
RecencyIs it still current?A three-year-old address gets an expiry or a re-check
ReliabilityWhere did it come from, and can it be trusted?A note from an official record outranks a passing comment
PrivacyIs it appropriate to keep, and who may see it?Personal data is excluded or access-controlled
CostWhat does it cost to store, retrieve and maintain?Store a short summary rather than a full transcript
Context BudgetCan it fit in the window with everything else?Retrieve three notes, not thirty

Done

Relevance, Recency and Reliability decide whether a memory is good. Privacy decides whether it is allowed. Cost and Context Budget decide whether it is worth using.
Check yourself

An agent stores every meeting transcript in full. Each time it answers a question it retrieves 40 pages, leaving little room for the current task. Which dimension is most directly the problem?

An agent stores every meeting transcript in full. Each time it answers a question it retrieves 40 pages, leaving little room for the current task. Which dimension is most directly the problem?

Key takeaway: Check each memory against Relevance, Recency, Reliability, Privacy, Cost and Context Budget.

Practice

9 min

Practice: Draft an Agent Memory Policy

An Agent Memory Policy is a short, reviewable statement of what an agent may remember. Draft one for an agent you would like to use, for example a course-support agent for a teaching team. Use illustrative or general information only. Do not enter company secrets, client personal data or other unauthorized sensitive information.

Agent Memory Policy (one row per memory type)
QuestionThink aboutStarter example (illustrative)
What should be remembered?Only what is stable, reusable and appropriateAgreed assignment deadline extensions for a named course section
For how long?Session, project, semester, until updatedUntil the end of the semester
Who can access it?Owner, role, need to knowThe course lead and the assigned teaching assistant
When should it be updated?What event changes it, and who confirmsWhen the course lead announces a revised deadline
When should it be forgotten?Expiry, request to delete, end of purposeAt semester end, or when the student asks to have it removed
  • Name an owner: someone who is responsible for the policy
  • Say what the agent must never store
  • Say when a person must review before the agent acts on a memory
  • Make sure a person can view, correct and delete a stored memory
Check yourself

Which policy row is best written?

Which policy row is best written?

Key takeaway: A memory policy answers five questions: what, how long, who, when to update, when to forget.

Recap

7 min

Recap: Memory Is Designed, Not Accumulated

Done

Observe, Select, Store, Retrieve, Update, Forget: for every kind of memory, can you say what happens at each step, and who is responsible?

Module 1: What should be kept?

  • Context versus memory
  • Types of memory
  • Use now, keep temporarily, remember long-term, do not store

Module 2: How is it managed?

  • The lifecycle from Observe to Forget
  • Six design dimensions
  • An Agent Memory Policy with an owner

Human, AI, Human: people set the policy, the agent follows it, and people review and correct what was stored. Your Agent Memory Policy is the first deliverable of the course and becomes part of your final Canvas. But memory is not the only source of what an agent knows. When information is large, changes often or belongs to someone else, the agent should look it up instead. That is the next module.

Key takeaway: Treat memory as something you design, govern and review across its whole lifecycle.

What next?