← 12 Session 14 - Agentic memory - approaches and handcrafted methods - Mon 02 Nov 16 →
All decks
  1. 1 Why retrieval nowMon 31 Aug
  2. 2 The inverted indexWed 02 Sep
  3. 3 Index construction and ranking foundationsMon 07 Sep
  4. 4 BM25: finish probabilistic rankingWed 09 Sep
  5. 5 Evaluation and the changing goals of retrieval benchmarksMon 14 Sep
  6. 6 Coarse retrieval and rerankingWed 16 Sep
  7. 7 LLM embeddings and rerankingMon 28 Sep
  8. 9 Hard queries: reasoning and ambiguityWed 07 Oct
  9. 10 Approximate nearest neighbour search and search systemsMon 12 Oct
  10. 12 Agentic memory - introduction, desiderata, and evaluationMon 26 Oct
  11. 14 Agentic memory - approaches and handcrafted methodsMon 02 Nov
  12. 16 Agentic memory - RL methods and wrap-upMon 09 Nov
  13. 18 Retrieval from the parametersMon 16 Nov
  14. 20 An explicit index of the training dataMon 23 Nov
  15. 22 Architectural lookupMon 30 Nov
  16. 24 Retrieval from the context - attention and the KV cacheMon 07 Dec
  17. 25 Retrieval from the context - which tokens are readWed 09 Dec
  18. 26 Course wrap-upMon 14 Dec
Contents
  1. 1Section 0
  2. 2Upcoming sessions
  3. 3100 words per answer
  4. 4Last lecture - what should agentic memory do?
  5. 5What changes during adaptation?
  6. 6Section 1
  7. 7From experience to stored information
  8. 8What arrives at the memory system?
  9. 9Generative Agents: observations
  10. 10From observations to reflections
  11. 11How does the agent retrieve?
  12. 12Mem0: conversation to factual memories
  13. 13What Mem0 stores from a conversation
  14. 14Mem0g: entities and relationships
  15. 15A-MEM: enriched, linked notes
  16. 16ReasoningBank: trajectories to strategies
  17. 17Retrieve guidance for a later task
  18. 18Compare the input, stored information, and search
  19. 19Which method stores which record?
  20. 20Section 2
  21. 21The maintenance module
  22. 22A change in the evaluation corpus
  23. 23Memory maintenance
  24. 24Repetition and independent evidence
  25. 25Mem0: choose an operation on related records
  26. 26Superseded does not mean historically false
  27. 27MindMemOS: consolidate accumulated records
  28. 28ACE: local updates to a playbook
  29. 29Memory maintenance
  30. 30Consistency does not control growth
  31. 31MemoryBank: forgetting and reinforcement
  32. 32MemGPT and MemoryOS manage limited context differently
  33. 33Quiz: revise a changed preference
  34. 34What representation and maintenance have shown

The recording

1

Section 0

Approaches to agentic memory

Information retrieval for AI

2 November 2026

Seong Joon Oh - KAIST AI

2

Upcoming sessions

4 November - REFLECT discussion

Read sections 1-3 and limitations. Preparation is due 3 November, 18:00 KST.

9 November - agentic memory continuation

11 November - project workshop

Workshop task and instructions will follow.

3

100 words per answer

For the REFLECT preparation due tomorrow, Tuesday 3 November, 18:00 KST, aim for 100 words in each answer: the main argument, the reasoning and evidence, and the remaining question. You can still submit more, but words beyond 100 show in red and may not be read.

  • I am not testing your typing, or your ability to generate long text.
  • Good writing is short. Play text golf: use your editorial skills to cut every part your writing does not need.
4
The memory system with desiderata 1 and 2 as submodules.
The memory system with desiderata 1 and 2 as submodules.

Last lecture - what should agentic memory do?

1. Representation and organisation - represent past experiences, avoid duplicates, resolve conflicts.

2. Memory maintenance - when to write, how to handle stale information, how to recover from failed operations.

3. Human control - can people understand and edit what the agent remembers?

4. Need for memory - would unlimited context remove the need for memory?

Today we cover desiderata 1 and 2 one by one. We then turn to RL methods that learn representation and maintenance decisions end to end from task reward. That reward does not measure human control, which we cover next.

Need for memory is left for the discussion session on 18 November - Is RAW-RAG enough now and in the future?

We will cover as much as possible today. The remaining material continues next lecture.

5

What changes during adaptation?

  • Stored facts can be corrected.
  • Reusable instructions can be revised.
  • Model weights can remain fixed during these changes.

Boundary case: MemRL uses reward to update stored utility estimates without changing LLM weights. RL is broader than neural weight updates.

ACE (ICLR 2026), §3; MemRL (arXiv 2026), §§3-4.

6
Representation and organisation within the memory system.
Representation and organisation within the memory system.

Section 1

Representation and organisation

Experience streams, stored formats, and supported searches.

7

From experience to stored information

Experience stream → memory construction → stored information

Compare what enters, what remains (and in which representation), and how a later query can access it.

8

What arrives at the memory system?

Input streamArrival patternInformation available
ConversationNew turns and exchangesStatements, preferences, and conversational context
Agent executionA completed task trajectoryObservations, actions, and outcome signals

The input unit and cadence affect what the memory constructor can interpret together.

Mem0 (ECAI 2025), §2; ReasoningBank (ICLR 2026), §3.

9
Generative Agents (UIST 2023), Figure 5, PDF p. 8. Generative Agents architecture.
Generative Agents (UIST 2023), Figure 5, PDF p. 8. Generative Agents architecture.

Generative Agents: observations

Input: events and interactions in a simulated environment.

Stored object: a natural-language observation, its creation time, and its most recent access time.

Example - selected entries from Isabella’s memory stream:

2023-02-13 22:48:20: desk is idle
2023-02-13 22:48:10: Isabella Rodriguez is stretching
2023-02-13 22:33:30: desk is neat and organized
2023-02-13 22:33:10: Isabella Rodriguez is writing in her journal
2023-02-13 21:48:10: Isabella Rodriguez is watching a movie

The figure shows each description with its creation time. The most recent access time is also stored but not displayed; retrieval updates it.

An observation records an event the agent perceived. Plans and derived reflections also enter the memory stream.

Generative Agents (UIST 2023), §§4.1-4.3, PDF pp. 8-11; example entries from Figure 6, PDF p. 9.

10
Generative Agents (UIST 2023), Figure 7, PDF p. 10 - Generative Agents reflection tree
Generative Agents (UIST 2023), Figure 7, PDF p. 10 - Generative Agents reflection tree

From observations to reflections

The system derives higher-level statements from stored experiences.

When: the summed importance of the latest perceived events exceeds a threshold (150). The agents reflected roughly two or three times a day.

Which observations form one reflection:

  1. The LLM reads the 100 most recent records and proposes the three most salient high-level questions, e.g. What topic is Klaus Mueller passionate about?
  2. Each question becomes a retrieval query. The retrieved memories, including earlier reflections, form the candidate group.
  3. The LLM infers five insights from that group and cites its evidence, e.g. Klaus Mueller is dedicated to his research on gentrification (because of 1, 2, 8, 15).
  4. The reflection is stored with pointers to the cited records. These are its children in the tree.

A reflection can also support a later reflection. Observed event and inferred statement have different evidential status.

Generative Agents (UIST 2023), §4.2 and Figure 7, PDF pp. 9-10. Original reflection tree.

11

How does the agent retrieve?

Generative Agents combines relevance, recency, and importance:

  • Relevance uses embedding similarity to the query.
  • Recency depends on the last retrieval time.
  • The LLM assigns importance when the record is created.

Observations and reflections can be retrieved together.

Generative Agents (UIST 2023), §4.1, PDF p. 9. Scores are normalised before combination.

12
Mem0 (ECAI 2025), Figure 2, PDF p. 4. Mem0 extraction and update pipeline.
Mem0 (ECAI 2025), Figure 2, PDF p. 4. Mem0 extraction and update pipeline.

Mem0: conversation to factual memories

What is stored: only the salient facts in each new exchange. Generative Agents records every perceived event; Mem0 decides at write time what is worth keeping.

Context at write time: the extractor reads the new message pair together with a conversation summary and recent messages. Each fact is written with the wider conversation in view.

What the compact store buys (LoCoMo, LLM-judge score J):

Stored or read per conversationJp95 total latency
Mem0 facts~7k tokens stored66.9%1.44 s
Best RAG over raw chunks-61.0%-
Full raw conversation~26k tokens read72.9%17.1 s

Facts beat retrieving raw chunks. Full context still answers better, at about twelve times the latency.

Mem0 (ECAI 2025), §2.1, PDF pp. 3-4; Table 2 and §§4.3, 4.5, PDF pp. 11-14.

13

What Mem0 stores from a conversation

Constructed example

Input to the extractor

Summary   The user plans social events with the assistant's help.
Recent    Assistant: Shall I book the steakhouse again for Sara's birthday?
New pair  User: No, I've gone vegetarian since my trip to India.
                Find somewhere else for her on Friday.
          Assistant: Got it. I'll look for vegetarian places.

Stored memories

[2026-11-02] User has been vegetarian since a trip to India.
[2026-11-02] Sara's birthday dinner is on Friday.

The recent message resolves her to Sara and supplies the birthday. The assistant’s acknowledgement adds no new fact, so nothing is stored for it. Each memory keeps a timestamp, so on Friday can later be resolved to a date.

Pipeline from Mem0 (ECAI 2025), §2.1, PDF pp. 3-4; timestamped memories as in the answer prompt, Appendix, PDF p. 19. The dialogue and facts are illustrative, not system output.

14
Mem0 (ECAI 2025), Figure 3, PDF p. 5 - Mem0g graph-memory architecture
Mem0 (ECAI 2025), Figure 3, PDF p. 5 - Mem0g graph-memory architecture

Mem0g: entities and relationships

Stored information: typed entities, labelled relationships, embeddings, and metadata.

Later access: match an entity and explore its relationships, or retrieve semantically similar triples.

The graph makes relationships explicit rather than leaving them inside an isolated sentence.

Constructed example - the birthday-dinner exchange, stored as a graph:

Nodes    user (Person)            Sara (Person)
         vegetarian_food (Diet)   steakhouse (Restaurant)
         India (Location)         birthday_dinner (Event)
Edges    (user, prefers, vegetarian_food)
         (user, visited, India)
         (birthday_dinner, celebrates, Sara)
         (birthday_dinner, happened_on, Friday)
Invalid  (user, prefers, steakhouse)

Each node also carries an embedding and a creation timestamp. The old steakhouse preference is marked invalid, not deleted.

What the graph adds (LoCoMo, LLM-judge score J):

Mem0 factsMem0g graph
Single-hop67.165.7
Multi-hop51.247.2
Open-domain72.975.7
Temporal55.558.1
Overall66.968.4
Memory per conversation~7k tokens~14k tokens
p95 total latency1.44 s2.59 s

The graph helps temporal and open-domain questions but not single-hop or multi-hop ones. It doubles the store and adds over a second of latency.

Mem0 (ECAI 2025), §2.2 and Figure 3, PDF pp. 5-6. Original graph-memory architecture. Example nodes and edges are illustrative. Scores from Tables 1-2, PDF pp. 9 and 11; memory size from §4.5, PDF p. 14.

15
A-MEM (NeurIPS 2025), Figure 2, PDF p. 3. A-MEM note construction, links, evolution, and retrieval.
A-MEM (NeurIPS 2025), Figure 2, PDF p. 3. A-MEM note construction, links, evolution, and retrieval.

A-MEM: enriched, linked notes

Textual interactions become notes with original content, timestamp, contextual description, keywords, tags, an embedding, and links.

Similarity search uses the enriched representations. Links do not imply Mem0g’s entity-centred read procedure.

Constructed example - the birthday-dinner exchange, stored as a note:

content   User: No, I've gone vegetarian since my trip to India.
          Find somewhere else for her on Friday.
          Assistant: Got it. I'll look for vegetarian places.
time      2026-11-02
keywords  vegetarian, diet change, birthday, restaurant booking
tags      food preferences, social plans, scheduling
context   After a trip to India the user has turned vegetarian and
          wants a new venue for Sara's birthday dinner on Friday.
links     -> note on last year's steakhouse booking, -> note on Sara

Unlike Mem0, the note keeps the original exchange. The LLM adds keywords, tags, and a description around it, and links it to related notes.

A-MEM (NeurIPS 2025), sections 3.1-3.4, PDF pp. 4-5; note fields from Eq. 1. Example values are illustrative.

16
ReasoningBank (ICLR 2026), Figure 2, PDF p. 4. ReasoningBank trajectory-to-strategy pipeline.
ReasoningBank (ICLR 2026), Figure 2, PDF p. 4. ReasoningBank trajectory-to-strategy pipeline.

ReasoningBank: trajectories to strategies

Input: a completed agent task with its observations and actions.

An LLM judge labels the attempt as successful or failed. Extraction uses that judgement to derive reusable guidance.

Stored record: title, description, and strategy content.

The record captures how to approach a task, beyond the facts mentioned during it.

Constructed example - a failed comparison becomes a strategy:

Task         Which run has higher nDCG@10, run A or run B?
Trajectory   open run_A results  -> nDCG@10 0.41, corpus v1
             open run_B results  -> nDCG@10 0.44, corpus v2
             answer "run B is better"
Judge        failure - the runs used different corpus versions
Title        Check the dataset manifest before comparing runs
Description  Scores are comparable only when runs share a corpus version.
Content      1. Read each run's manifest.
             2. Confirm that corpus version and query set match.
             3. If they differ, report the mismatch, not a winner.

ReasoningBank (ICLR 2026), §§3.1-3.2, PDF pp. 4-5. Outcome labels are self-judged, not ground-truth feedback at test time. Record format from the extraction prompt, Appendix A.1; example values are illustrative.

17

Retrieve guidance for a later task

New task → embedding search → relevant strategy records → agent context

The original trajectory and the distilled strategy are different representations of experience.

Constructed strategy: “Check the dataset manifest before comparing evaluation runs.”

Its usefulness depends on whether it applies to the new task. No model-weight update is needed to supply it as context.

ReasoningBank (ICLR 2026), §3.2. The dataset-manifest instruction is a teaching example.

18

Compare the input, stored information, and search

MethodInputStored informationSearch
Generative AgentsSimulated experiencesObservations and reflectionsRelevance, recency, importance
Mem0Conversational exchangesFactsSemantic similarity
Mem0gConversational exchangesEntity relationshipsEntity and triple search
A-MEMTextual interactionsEnriched, linked notesNote similarity
ReasoningBankCompleted task trajectoriesReusable strategiesEmbedding similarity

Sources are the method sections cited on the preceding slides. This compares mechanisms, not benchmark performance.

19

Which method stores which record?

Constructed records from the birthday-dinner exchange and the failed run comparison.

Connect each method to one context. Select a method, then a context. One point per correct match; submit once.

MethodUseful when
Your connections

Sign in with your course account to submit.

20
Memory maintenance within the memory system.
Memory maintenance within the memory system.

Section 2

Memory maintenance

Consistency, growth, and context pressure.

21
Memory maintenance as a black box with its inputs and output.
Memory maintenance as a black box with its inputs and output.

The maintenance module

Current memory + elapsed time + events → revised memory

Events may include new information, retrieval, feedback, or a capacity limit.

22

A change in the evaluation corpus

Constructed example

The assistant initially records “Use corpus v1.” The instruction appears in messages, planning notes, and a summary.

Later: “Use corpus v2 for final evaluation. Keep the pilot results on v1.”

The intended memory must preserve the pilot history and the current instruction.

23

Memory maintenance

Keep stored knowledge consistent

24

Repetition and independent evidence

Stored textOrigin
“Use corpus v1.”Original instruction
“Evaluation uses v1.”Note derived from that instruction
“The project uses v1.”Summary of the note

The copies have a shared origin. More retrieval hits do not establish independent support.

Constructed records from the running example.

25
Mem0 (ECAI 2025), Figure 2 (detail), PDF p. 4. Mem0 update phase, detail.
Mem0 (ECAI 2025), Figure 2 (detail), PDF p. 4. Mem0 update phase, detail.

Mem0: choose an operation on related records

Candidate fact → retrieve similar memories → LLM operation → revised store

OperationDecision described in the paper
ADDCreate a new memory
UPDATEAugment an existing memory
DELETERemove a memory contradicted by new information
NOOPMake no change

The retrieved records determine which existing knowledge the model can consider.

Mem0 (ECAI 2025), §2.1, PDF p. 4.

26
Mem0 (ECAI 2025), Figure 3, PDF p. 5. Mem0g conflict detection and graph update.
Mem0 (ECAI 2025), Figure 3, PDF p. 5. Mem0g conflict detection and graph update.

Superseded does not mean historically false

Mem0g’s update resolver can mark an obsolete relationship invalid rather than physically removing it. The store keeps historical information while distinguishing it from current relationships.

Desired state in the constructed example

InformationInterpretation after the change
Pilot results used corpus v1.Valid historical record
Final evaluation should use corpus v1.Superseded instruction
Final evaluation should use corpus v2.Current instruction

Replacing every mention of v1 would destroy a distinction the project still needs. The decision still depends on recognising the correct entities, relationship, and new evidence.

Mem0 (ECAI 2025), §2.2, PDF p. 6. The corpus example is constructed.

27
MindMemOS (arXiv 2026), Figure 12, PDF p. 19. Dreaming archives a superseded memory.
MindMemOS (arXiv 2026), Figure 12, PDF p. 19. Dreaming archives a superseded memory.

MindMemOS: consolidate accumulated records

Online writes leave redundant, outdated, or conflicting records. Offline dreaming consolidates them around each entity.

  1. Scope - start from recent writes and gather the active memories about the same entity.
  2. Detect - an LLM finds conflicts, duplicates, complementary fragments, or ambiguous relations.
  3. Act - a second LLM call merges, updates, archives, or links records, keeping links to their sources. When identity or order is uncertain, it prefers links over archival.

Example (MemoryAgentBench, where the later fact counts as true). M1 (later) says Nobuhiro Watsuki is famous for The Fairly OddParents; M2 (earlier) says Rurouni Kenshin. Before dreaming, retrieval returns both and the model answers Rurouni Kenshin. Dreaming archives M2 as superseded by M1, so the same query returns The Fairly OddParents.

Answer modelAccuracy before dreamingAfter dreamingActive memories archived
gpt-4o-mini0.3770.45920.4%
gpt-5-mini0.5450.58522.5%

The conflict is settled in stored state, so the answer model no longer has to compare timestamps.

MindMemOS (arXiv 2026), section 3.4, PDF p. 9; section 5.1 and Figure 12, PDF pp. 18-20; overall FactConsolidation accuracy (SubEM) from Table 3 and section 4, PDF p. 17. Timestamps were removed from the retrieved context during evaluation.

28
ACE (ICLR 2026), Figure 4, PDF p. 5. ACE Generator, Reflector, and Curator.
ACE (ICLR 2026), Figure 4, PDF p. 5. ACE Generator, Reflector, and Curator.

ACE: local updates to a playbook

ACE represents a playbook as identified entries with content and metadata. A Generator produces task trajectories, a Reflector extracts insights, and a Curator proposes delta updates. Lightweight non-LLM logic merges the updates, so a correction targets selected entries rather than requiring a complete rewrite.

Example - constructed playbook revision

  • Before: “Compare the new run with the previous results.”
  • After: “Check the dataset manifest and evaluation stage before comparing runs.”

This changes task guidance. It does not necessarily change the procedure that maintains memory.

A successful write can leave inconsistent knowledge. The system writes “Final evaluation uses v2” and the database reports success. A project summary still says “Final evaluation uses v1”, and retrieval later returns it. Check which records were revised and which derived claims remain current.

ACE (ICLR 2026), §§3.1-3.2, PDF pp. 4-5. The revision and the failure are constructed examples.

29

Memory maintenance

Control memory growth and context bloat

30
ACE (ICLR 2026), Figure 2, PDF p. 3. ACE AppWorld context-collapse case study.
ACE (ICLR 2026), Figure 2, PDF p. 3. ACE AppWorld context-collapse case study.

Consistency does not control growth

A store can remain consistent as its records outgrow storage or active context. Compression can also discard useful information.

ACE’s AppWorld case illustrates context collapse under repeated rewriting. It does not measure storage capacity or deduplication.

ACE (ICLR 2026), Figure 2, PDF p. 3.

31
MemoryBank (AAAI 2024), Figure 1 (detail), PDF p. 3. MemoryBank storage and forgetting mechanism, detail.
MemoryBank (AAAI 2024), Figure 1 (detail), PDF p. 3. MemoryBank storage and forgetting mechanism, detail.

MemoryBank: forgetting and reinforcement

Inspired by the Ebbinghaus forgetting curve, MemoryBank models retention as:

is elapsed time; is memory strength.

Recall increases strength and resets elapsed time. Without recall, retention declines as time passes.

This is the paper’s simplified psychology-inspired rule.

MemoryBank (AAAI 2024), §2.3, PDF p. 4.

32
MemGPT (arXiv 2023), Figure 3, PDF p. 3, and MemoryOS (EMNLP 2025), Figure 1, PDF p. 3, side by side.
MemGPT (arXiv 2023), Figure 3, PDF p. 3, and MemoryOS (EMNLP 2025), Figure 1, PDF p. 3, side by side.

MemGPT and MemoryOS manage limited context differently

Both borrow from operating systems. A small, fast space (the prompt) sits above larger, slower storage.

MemGPTMemoryOS
LevelsPrompt (instructions, working context, message queue) above external recall and archival storageShort-term turns, mid-term topics, long-term user and assistant profile
Who moves informationThe model, through function callsFixed rules
When space runs shortAt about 70% of the context window the model is warned and can save what matters; at 100% older messages leave the promptWhen the short-term queue is full, the oldest turn moves to mid-term
What happens to old informationMessages that leave the prompt stay in recall storageWhen mid-term space runs out, the least-used topics are deleted
Bringing it backThe model calls a search functionEach query retrieves from all three levels

MemGPT (arXiv 2023), §§2.1-2.4 and Figure 3, PDF pp. 2-4; MemoryOS (EMNLP 2025), sections 3.2-3.4 and Figure 1, PDF pp. 3-5.

33

Quiz: revise a changed preference

In March, the user told the agent, “I love the steakhouse on Main Street.” In October, the user says, “I’ve gone vegetarian.”

Next month, the user may ask, “Book somewhere for dinner,” or “Why did you book the steakhouse last spring?”

Which revision of the March record keeps both answers correct?

Sign in with your course account to choose. The lecturer will reveal responses and the answer.

34

What representation and maintenance have shown

Representation and organisation

  • Methods differ in what they keep and how they represent knowledge: every observation (Generative Agents), salient facts (Mem0), an entity graph (Mem0g), enriched and linked notes (A-MEM), or reusable strategies (ReasoningBank).
  • The format decides which later questions are easy.

Memory maintenance

  • Keeping knowledge consistent: Mem0 and Mem0g update or invalidate records as they write, MindMemOS consolidates them offline, and ACE edits individual playbook entries.
  • Controlling growth: MemoryBank lets unrecalled memories fade, MemGPT moves messages out of the prompt but keeps them, and MemoryOS deletes rarely used topics.

In all of these methods, a designer prescribes the memory decisions. Next, we let the system learn them from reward.