Menu

Trees, Graphs and Operating Systems

Trees, Graphs and Operating Systems: How Long-Term Memory for AI Agents Is Built

Notes · Memory designsNovember 24, 20264 min readSenova Systems Research

A map of the published designs for AI agent memory: summary trees, knowledge graphs, operating-system-style paging and fact stores. What each measured, why the best keep the original words under every summary, why plain baselines are hard to beat, and the licence of each project's code.

The question

Every AI memory system has to answer the same three questions. What do you keep? How do you find it again? What do you do when it no longer fits?

Researchers have answered them with trees of summaries, knowledge graphs, and designs borrowed from computer operating systems. This note is a map of the published work, what each approach measured, and what we took from it for Klyroe Memory, which is in development and not released.

How to read this: each section gives the simple idea first, then The real detail. Every figure comes from the paper or code we name, opened by us. Numbers from different papers used different models and judges, so compare within a table, not across them.

Four families of design

The simple idea

FamilyThe picturePublished examples
Summary treesGroup related pieces, summarise each group, then summarise the summariesRAPTOR (Stanford), MemTree, MemoryBank, TiMem
GraphsTurn conversations into facts and links between people, places and thingsZep's Graphiti, HippoRAG (Ohio State), A-MEM
Operating-system styleA small working memory in the prompt, a large archive outside it, and the model moves things between themMemGPT (UC Berkeley, now Letta), MemoryOS
Fact storesPull out short facts, then add, update or delete themMem0, LightMem

Most new systems mix two or three of these.

The real detail

  • RAPTOR groups text by meaning, summarises each group with a model, and repeats until one summary is left. At question time it searches all levels at once; the authors found that "consistently performs better" than walking down from the top.
  • MemTree grows a tree as conversation arrives: new content goes under the most similar branch, and the summaries above it are rewritten. That took about 3.3 model calls per insert against about 3,750 to rebuild a RAPTOR-style tree from scratch.
  • MemGPT treats the prompt like a computer's main memory. When it fills, older messages move out to storage that stays searchable, and a running summary of them stays in view.
  • Zep / Graphiti keeps the raw messages, the facts taken from them, and clusters of related facts. Each fact records when it was true and when the system learned it, so a new fact closes an old one instead of deleting it.

The finding that matters most: keep the original

The simple idea

Summaries are useful for finding things. They are not safe as the only copy. Every study that checked found summaries that added or changed details, and the systems that scored best kept the original words underneath.

The real detail

SourceFinding
RAPTORIn a hand check of 150 summaries, "about 4%" had minor hallucinations.
Recursive summarising for long chats (Wang et al.)Inaccurate content did not exceed 10% of summary content in 100 checked samples.
HiMem (2026)Removing the layer of concrete events dropped its score from 80.71 to 69.29. Removing the layer of abstract notes dropped it only to 79.63.
Generative Agents (Stanford and Google)The most common errors came from failing to retrieve the right memory; agents also "hallucinated embellishments".

Simple baselines are hard to beat

The simple idea

Fancy memory often loses to two plain things: giving the model everything, or plain search over the original text. A design only earns its complexity if it beats both.

The real detail

StudyWhat won
Mem0's paper, short conversationsThe full conversation (72.90) beat every memory system, including Mem0's graph version (68.44). Mem0's advantage was speed and cost.
LightMem, long histories (LongMemEval)LightMem 68.64, A-MEM 62.60, plain search 61.00, full text 56.80, Mem0 53.61. Plain search beat two well-known memory systems.
HippoRAG 2A strong plain retriever (57.0 average F1) beat RAPTOR (48.8); the authors blame noise from model-written summaries.

What the field agrees on

  1. Search every level, then open up. Use summaries to find the right region, then go back to the original words.
  2. Update the part that changed. Rebuilding everything costs thousands of model calls; refreshing one path costs a few.
  3. Do the summarising in the background. LightMem and others run it off the response path, so the user never waits for it.
  4. Keep time. Mark a changed fact as replaced rather than overwriting it, so "what did I say before?" still has an answer.
  5. Segment by topic before summarising. Summaries of one topic are clearer than summaries of an arbitrary window.
  6. Combine kinds of search. Keyword search, meaning-based search and links between entities beat any one of them alone.

Licences, briefly

We checked each project's licence file before reading its code. RAPTOR, HippoRAG, A-MEM, LightMem and MemoryBank are MIT. Letta, Mem0's open-source SDK, Graphiti, MemoryOS, HiMem and MemOS are Apache-2.0. Mem0's README says its newest headline scores come from its managed platform, which includes optimisations not in the open-source code.

Where Klyroe Memory sits

Klyroe Memory is a summary tree over a conversation's history. Recent detail stays as it was said, older history is summarised, and the assistant can search the whole history and open any summary back up to the original words. It is built to the rules above, plus two of our own from the security research: deleting something also removes what was summarised from it, and nothing in memory is ever treated as an instruction.

It is in development and not released, so we have no Klyroe results to report. When we do, they will be measured against the plain baselines in section 3.

Sources

  1. Sarthi et al. 2024, RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval (Stanford)
    What we used

    Collapsed-tree search; about 4% of summaries with minor hallucinations; MIT licence; opened 2026-11-24

  2. Rezazadeh et al. 2024, From Isolated Conversations to Hierarchical Schemas: Dynamic Tree Memory Representation for LLMs (MemTree)
    What we used

    About 3.3 model calls per insert vs about 3,750 for a rebuild; opened 2026-11-24

  3. Packer et al. 2023, MemGPT: Towards LLMs as Operating Systems (UC Berkeley)
    What we used

    Main and external context, recursive summary of evicted messages; Letta code Apache-2.0; opened 2026-11-24

  4. Park et al. 2023, Generative Agents: Interactive Simulacra of Human Behavior (Stanford, Google)
    What we used

    Retrieval failures most common error; embellishments; opened 2026-11-24

  5. Rasmussen et al. 2025, Zep: A Temporal Knowledge Graph Architecture for Agent Memory
    What we used

    Episodes, facts, communities; bi-temporal edges; Graphiti Apache-2.0; opened 2026-11-24

  6. Chhikara et al. 2025, Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory
    What we used

    Full context 72.90 vs Mem0g 68.44; repository README on managed-platform scores; opened 2026-11-24

  7. Fang et al. 2026, LightMem: Lightweight and Efficient Memory-Augmented Generation (ICLR 2026)
    What we used

    LongMemEval-S GPT-4o-mini: 68.64, A-MEM 62.60, naive RAG 61.00, full text 56.80, Mem0 53.61; opened 2026-11-24

  8. Zhang et al. 2026, HiMem: Hierarchical Long-Term Memory for LLM Long-Horizon Agents
    What we used

    Ablation 80.71; without episodes 69.29; without notes 79.63; opened 2026-11-24

  9. Jiménez Gutiérrez et al. 2025, From RAG to Memory: Non-Parametric Continual Learning for Large Language Models (HippoRAG 2, ICML 2025)
    What we used

    Dense retriever 57.0 vs RAPTOR 48.8 average F1; opened 2026-11-24

  10. Wang et al. 2023, Recursively Summarizing Enables Long-Term Dialogue Memory in Large Language Models
    What we used

    Inaccurate content under 10% of summaries; opened 2026-11-24

  11. Xu et al. 2025, A-MEM: Agentic Memory for LLM Agents (NeurIPS 2025)
    What we used

    Linked notes that rewrite neighbours; MIT licence; opened 2026-11-24

More in klyroe memory

How Well Can AI Predict One PersonAI agents built from two-hour interviews matched people's survey answers about 85% as well as the people matched themselves two weeks later. Demographics did worse and stereotyped more, and money choices didn't improve at all. What that means for an assistant that thinks like you.4 minWhen You Delete a Memory, Does the AI Really ForgetNew research shows that deleting a record from an AI's memory can leave it recoverable from summaries about 20% of the time, no better than not deleting, and that summaries are also a way to poison memory. We read the papers, GDPR, the EDPB opinion and California's rules. Here are the six rules Klyroe Memory is built to.4 minAi memory sycophancyRecent studies find that memory and user profiles make AI assistants agree with people more, even when they're wrong: up to +45% agreement with a memory profile, up to 40% more sycophancy with memory. What helps, and the rules we took for Klyroe's thinking profile.4 minWhat the Brain Teaches AI About ForgettingAI memory papers borrow forgetting curves, sleep and fast-and-slow stores from neuroscience. We went back to the studies: what replicates, what AI papers actually do with it, and five places the analogy breaks, including why an assistant's forgetting must be a real deletion.5 minMeta brain model viralityMeta's TRIBE models predict an average brain's response to video, sound and text. We read the papers, code, model card and blog: none of them claims to predict virality, and the licence is non-commercial. Here is what they do, where the virality idea really comes from, and why it can't think for you.4 min