Memory is a foundational component of LLM agents, but the industry is stuck on an isolated paradigm: an agent remembers only its own experience. The MemRec paper (ACL 2026) introduces the next milestone — collaborative memory, where agent memories are linked in a graph and exchange relational signals. I’ll break down MemRec to the level of equations and prompts, compare three production tools (Mem0, Letta, Zep), and show where research outpaces tooling.
1. Why Isolated Memory Is a Dead End
Why does an agent need memory at all? Context windows are growing — GPT-4o handles 128K tokens, Gemini a million. But a context window is not memory. It’s a workbench. Put every conversation ever seen, every user preference, every tool output on the workbench — and the workbench breaks. The LLM starts losing relevant facts in the noise, as shown in Lost in the Middle (Liu et al., 2024): performance degrades when the needed information sits in the middle of a long context.
Memory solves a different problem — it makes the agent stateful (state persists between runs), allows accumulating experience and adapting. Without memory, an agent is a pure function: same inputs, same outputs. With memory, the agent evolves. This principle is well articulated in Generative Agents (Park et al., 2023), where a simulation of virtual town residents showed that the memory stream is precisely what makes agent behavior believable.
The evolution of agent memory has passed three milestones. Here’s the map:
timeline
title Evolution of LLM Agent Memory Paradigms
section No Memory
2023 : Vanilla LLM : Relies on inherent knowledge
every run from scratch
section Static Memory
2024 : iAgent, Chat-Rec : Retrieval from fixed
storage, no updates
section Dynamic Memory
2025 : AgentCF, i2Agent : Agent iteratively updates
its understanding
section Collaborative Memory
2026 : MemRec (ACL 2026) : Memory linked in a graph
collaborative signals
Each milestone solved a concrete problem, but all three kept memory isolated. What does this mean in practice? Let’s look at recommender systems — where this problem is most clearly expressed, and where MemRec demonstrates a solution that generalizes to arbitrary agents.
In agentic recommender systems (RS), an agent stores a memory about user
This isn’t specific to recommender systems. Imagine a team of agents working on code: one agent found a solution to a dependency problem, another encounters the same problem — but doesn’t know, because memory is isolated. Or a support agent: a user described a problem to agent A, then contacts agent B — and B starts from scratch. Memory isolation is a loss of collective intelligence.
2. MemRec: Two Architectural Shifts
The MemRec paper (Chen et al., ACL 2026) solves the isolation problem through two architectural shifts. But before unpacking them, we need to understand why the naive solution doesn’t work.
2.1 Naive Brute-Force and Why It Fails
The idea of “just give the agent access to all neighbors’ memories” comes first. If a user interacted with books alongside a thousand other users — feed the agent all thousand memories. The problem is that this causes two catastrophes.
Cognitive overload. The LLM can’t distill signal from abundance. Lost in the Middle showed that as context grows, the LLM loses its ability to find relevant facts. Load the memories of dozens of neighbors into context — and the agent starts hallucinating, losing instruction adherence, confusing whose preference is whose.
Prohibitive collaborative updates. Collaborative memory must evolve. When a user interacts with an item, the knowledge should propagate to all connected neighbors. The naive approach requires a separate LLM call for each neighbor — updating one user’s memory means invoking the LLM dozens of times. In real-time serving, this is prohibitive.
Here’s how naive and MemRec approach the same task:
graph LR
subgraph "Naive: single pass, monolithic"
RAW["Raw graph context
1000 neighbors
verbose memories"]
MONO["Single LLM
(does everything)"]
RES1["Result:
cognitive overload,
hallucinations"]
RAW --> MONO --> RES1
end
subgraph "MemRec: two passes, decoupled"
GRAPH["Raw graph
G=(V,E)"]
CUR["Curate
(LLM rules filter)"]
SYN["Synthesize
(LM_Mem distill)"]
FACETS["M_collab
7 structured facets"]
REC["LLM_Rec
(reasoning only)"]
RES2["Result:
high-signal context,
grounded rationales"]
GRAPH --> CUR --> SYN --> FACETS --> REC --> RES2
end
style MONO fill:#c62828,color:#fff
style RES1 fill:#c62828,color:#fff
style CUR fill:#2e7d32,color:#fff
style SYN fill:#2e7d32,color:#fff
style REC fill:#1565c0,color:#fff
style RES2 fill:#2e7d32,color:#fff
The naive approach feeds the entire raw context to one model — and hits an information bottleneck: the model can’t simultaneously ingest and reason. MemRec splits the task: curate (filter noise via domain-adaptive rules), synthesize (distill into structured facets), then reason on clean context. This is “Curate-then-Synthesize” — two compression passes guided by the Information Bottleneck principle.
MemRec solves both problems through two architectural shifts.
2.2 Shift #1: Decoupling Memory Management from Reasoning
MemRec separates two functions that naive agents perform in a single model:
- LM_Mem (lightweight language model) — manages memory in the background: curates the graph, synthesizes context, updates neighbors.
- LLM_Rec (heavyweight large language model) — performs final reasoning: ranks candidates, generates justifications.
Why not mix these in one heavy model? The Information Bottleneck (IB, a compression principle that preserves maximum task-relevant information while minimizing redundant signals; Tishby et al.) is at work. LM_Mem’s job is to compress raw graph context into a compact representation that preserves maximum useful signal for reasoning and discards noise. If the same model must both compress and reason, an information bottleneck arises: it can’t simultaneously absorb verbose context and perform complex ranking. The experiment confirms this: a naive monolithic agent (one model does everything) plateaus, while MemRec with decoupling delivers +34% relative H@1 gain on the Books dataset (see Section 5, RQ2).
This is an engineering principle that extends beyond recommender systems. Don’t make the expensive reasoning model do library work. Split it: a lightweight model gathers context and distills, a heavyweight model reasons. The cost effect is also significant — on expensive output tokens (which are 3-4x more costly than input), MemRec spends minimally: Stage-R and Stage-W are heavily input-biased (input is ~80% of total usage), which radically reduces effective cost.
2.3 Shift #2: Collaborative Memory Graph
MemRec doesn’t just give the agent access to neighbors’ memories. It builds a memory graph
graph LR
subgraph "Isolated Memory"
U1["User A
M_A"]
U2["User B
M_B"]
I1["Item X
M_X"]
I2["Item Y
M_Y"]
end
subgraph "Collaborative Memory Graph G=(V,E)"
UA["User A
M_A"]
UB["User B
M_B"]
UC["User C
M_C"]
IX["Item X
M_X"]
IY["Item Y
M_Y"]
IZ["Item Z
M_Z"]
UA -.->|"co-engagement"| IX
UB -.->|"co-engagement"| IX
UA -.->|"peer similarity"| UB
IX -.->|"related"| IY
UC -.->|"co-engagement"| IY
UB -.->|"co-engagement"| IZ
end
style UA fill:#1565c0,color:#fff
style UB fill:#1565c0,color:#fff
style UC fill:#1565c0,color:#fff
style IX fill:#c62828,color:#fff
style IY fill:#c62828,color:#fff
style IZ fill:#c62828,color:#fff
The difference is fundamental. The isolated paradigm is a set of disconnected narratives
3. Deep Dive into MemRec: The Three-Stage Pipeline
Now let’s break down MemRec’s architecture in detail — equations, prompts, engineering trade-offs. This is the unpacking of the paper, as is.
MemRec operates in three stages. Here’s the full pipeline, then each stage separately.
graph TB
subgraph "Background (LM_Mem, lightweight)"
G["Memory Graph
G = (V, E)"]
C["Stage 1:
Collaborative Memory
Retrieval"]
P["Stage 3:
Async Collaborative
Propagation"]
end
subgraph "Foreground (LLM_Rec, heavyweight)"
R["Stage 2:
Grounded Reasoning"]
end
G -->|"raw neighbor
memories"| C
C -->|"M_collab
distilled facets"| R
R -->|"scores s_i,
rationales r_i"| OUT["Ranked
recommendations"]
R -.->|"new interaction"| P
P -.->|"ΔM updates
to neighbors"| G
style C fill:#2e7d32,color:#fff
style P fill:#2e7d32,color:#fff
style R fill:#c62828,color:#fff
style G fill:#1565c0,color:#fff
Green — LM_Mem working in the background, lightweight model. Red — LLM_Rec working in the foreground, heavyweight model, only when reasoning is needed. Blue — memory graph, persistent state. Note: propagation (Stage 3) is async, it doesn’t block foreground reasoning.
3.1 Stage 1: Collaborative Memory Retrieval
The goal of the first stage is to take the expansive memory graph and extract a concise collaborative memory
3.1.1 LLM-as-Rule-Generator: Offline Curation
The first pass is curate. The problem: how to select the top-
MemRec proposes a zero-shot paradigm: LLM-as-Rule-Generator. In the offline phase, LM_Mem analyzes domain statistics
Meta-Prompt Template for Rule Generation
You are an expert AI engineer specializing in recommender systems
and graph-based memory networks. Your task is to generate a set of
domain-specific heuristic rules for a collaborative neighbor pruning
algorithm. The goal is to select the top-k most relevant neighbors
(users or items) from a candidate graph to build a compact, high-signal
context for a downstream LLM recommender (MemRec).
DOMAIN CONTEXT
• Domain Name: {Domain Name}
• Primary Interaction: {Primary Interaction with example}
• Key Metadata: {Key Metadata}
• Available Features:
– edge_weight: {Domain-specific explanation}
– recency_days: {Domain-specific explanation}
– co_interaction_count: {Domain-specific explanation}
– metadata_overlap_score: {Domain-specific explanation}
– memory_similarity_score: {Domain-specific explanation}
INSTRUCTIONS:
1. Based only on the domain context provided, generate 3-5 high-priority,
interpretable ranking rules.
2. The rules should explain how to combine or prioritize the available
features to find the best neighbors for this specific domain.
3. Be specific about thresholds and weights.
4. Consider domain-specific characteristics (e.g., books are content-driven
with long-term preferences; movies are recency-critical).
OUTPUT FORMAT:
Rule 1: [Your rule here]
Rule 2: [Your rule here]
...
What matters: the rules are domain-adaptive. For Books (content-driven), LM_Mem generates a boost for metadata_overlap (>0.6 → 2.5x multiplier) — books are read by genre/author. For MovieTV (recency-critical) — strong recency decay (exp(-0.018 × recency_days)). For Yelp (category-driven) — categorical dominance (metadata_overlap > 0.7 → 3.5x). This is zero-shot: no training, just the LLM’s semantic understanding.
At inference time, the rules act as a high-speed filter — selecting top-
3.1.2 Collaborative Memory Synthesis: Distill into Facets
The second pass is synthesize. The selected neighbors
Stage-R Prompt: Collaborative Memory Synthesis
You are an intelligent memory retrieval system for personalized
recommendation. Your task is to analyze the user's personal memory
and collaborative memories from their neighbors to extract preference
facets.
Target User: User {user_id}
User's Personal Memory:
User Memory Summary: {user_memory_summary}
Collaborative Neighbor Memories:
The following neighboring users and items provide collaborative signals:
Collaborative Neighbors: {formatted_neighbor_list}
Your Task:
Analyze the user's personal memory and the collaborative memories
to identify {n_facets} distinct preference facets.
For each preference facet, provide:
1. A concise natural language description of the preference
2. A confidence score between 0 and 1
3. A list of supporting neighbors (user IDs or item IDs)
Output: JSON with "facets" array and "support_edges" array.
The result — instead of “User prefers dystopian settings” (isolated), we get:
Theme: Cyberpunk & Corporate Dystopia (Conf: 0.9)
Evidence: User Neighbor (ID: 2057) shows deep interest in corporate control; Item Neighbor (‘1984’) shares foundational dystopian themes.
Theme: High-Stakes Survival (Conf: 0.75)
Evidence: Item Neighbor (‘Battle Royale’) exhibits strong survival elements matching recent interactions.
Each facet is grounded in specific neighbors. This is the distilled high-signal context that goes to LLM_Rec.
3.2 Stage 2: Grounded Reasoning
The second stage is final reasoning. LLM_Rec receives the synthesized
Stage-ReRank Prompt (MemRec Mode)
You are an intelligent recommendation scoring system. Your task is
to evaluate how well each candidate item matches the target user's
preferences based on their personal memory and collaborative signals.
Target User: User {user_id}
User's Current Request: {instruction}
User Preferences (Extracted from Collaborative Memories):
{formatted_facets}
Candidate Item Memories:
{formatted_item_memories}
Your Task:
For each candidate item, provide a relevance score between 0 and 1:
• 1.0 = Excellent match, highly aligned with user's facets
• 0.5 = Moderate match, partially relevant
• 0.0 = Poor match, not aligned
For each item, provide a brief rationale explaining your scoring.
Output: JSON with "scores" array of {item_id, score, rationale}.
And here’s the interesting part. LLM_Rec doesn’t see the raw graph. It sees only distilled facets with confidence scores and grounding evidence. Cognitive overload is impossible by construction — the context is already curated and synthesized at Stage 1.
3.3 Stage 3: Async Collaborative Propagation
The third stage is graph evolution. When user
The problem: the naive synchronous approach invokes the LLM for each neighbor separately —
How? Inspired by Label Propagation (Zhu & Ghahramani, 2002) — an algorithm where labels spread across the graph from node to node. MemRec propagates “semantic labels” (insights, conclusions) across the memory graph. But instead of separate calls for each node, MemRec conceptually decomposes the update:
Stage-W Prompt: Asynchronous Collaborative Propagation
You are an intelligent memory management system for collaborative
recommendation. Your task is to update the personal memories of the
user, the clicked item, and relevant collaborative neighbors based
on this new interaction.
Interaction Context:
User {user_id} has just interacted with (clicked) Item {item_id}.
User Preferences (Extracted from Collaborative Memories):
{formatted_facets}
Current Personal Memory of User {user_id}: {current_user_memory}
Current Memory of Item {item_id}: {current_item_memory}
Collaborative Neighbors Available for Memory Propagation:
{n_neighbors} neighbors: {formatted_neighbors}
Your Task — Generate UPDATED memories for:
1. The current user (synthesize current memory + facets + clicked item)
2. The clicked item (describe what it is and who might enjoy it)
3. Selected neighbors (collaborative propagation is key!)
* Select neighbors RELEVANT to this interaction
* Update their memories to reflect new insights
* This helps the system learn collaboratively!
Output: JSON with "user_memory", "item_memory", "neighbor_updates".
A single LM_Mem call updates the user, item, and selected neighbors simultaneously. Async — doesn’t block foreground reasoning.
graph TB
subgraph "Naive: O(|N_k'|) calls"
N1["User update
call 1"]
N2["Item update
call 2"]
N3["Neighbor 1
call 3"]
N4["Neighbor 2
call 4"]
N5["Neighbor k
call k+2"]
N1 --> N2 --> N3 --> N4 --> N5
end
subgraph "MemRec: O(1) batched async"
B["Single LM_Mem call
P_update"]
B -->|"user_memory"| UU["User M_u^t"]
B -->|"item_memory"| II["Item M_i^t"]
B -->|"neighbor_updates"| NN["ΔM_neigh
(selected neighbors)"]
end
style B fill:#2e7d32,color:#fff
Naive approach: linear number of calls, each repeating user context. MemRec: one batched call, everything in a single prompt. The latency and cost difference is orders of magnitude.
4. MemRec Experiments: What the Numbers Show
MemRec is evaluated on four benchmark datasets: Amazon Books, Amazon Goodreads, MovieTV, Yelp. Different interaction densities, different domain characteristics. Metrics — Hit Rate (H@K) and NDCG (N@K) for K ∈ {1, 3, 5}. Implementation: gpt-4o-mini for both LM_Mem and LLM_Rec,
4.1 Main Results (RQ1)
Full results table for all four datasets:
| Model | Books H@1 | Books H@5 | Goodreads H@1 | Goodreads H@5 | MovieTV H@1 | MovieTV H@5 | Yelp H@1 | Yelp H@5 |
|---|---|---|---|---|---|---|---|---|
| LightGCN | 0.1753 | 0.5703 | 0.2499 | 0.7903 | 0.3482 | 0.6883 | 0.3444 | 0.7546 |
| SASRec | 0.0914 | 0.4845 | 0.1324 | 0.5407 | 0.3399 | 0.6382 | 0.2305 | 0.5597 |
| P5 | 0.2192 | 0.5273 | 0.1569 | 0.5060 | 0.1696 | 0.5008 | 0.1444 | 0.5220 |
| Vanilla LLM | 0.3138 | 0.7270 | 0.2864 | 0.7390 | 0.4050 | 0.8603 | 0.1692 | 0.6861 |
| iAgent (static) | 0.3925 | 0.6905 | 0.2617 | 0.6591 | 0.4253 | 0.7420 | 0.3995 | 0.7300 |
| RecBot (dynamic) | 0.3984 | 0.6786 | 0.2705 | 0.6495 | 0.4367 | 0.7309 | 0.4007 | 0.7169 |
| AgentCF (dynamic) | 0.3457 | 0.7403 | 0.2951 | 0.7726 | 0.3906 | 0.7864 | 0.1925 | 0.6374 |
| i2Agent (dynamic) | 0.4453 | 0.7708 | 0.3099 | 0.7675 | 0.4912 | 0.8221 | 0.4205 | 0.7648 |
| MemRec | 0.5117 | 0.8007 | 0.3997 | 0.8052 | 0.5882 | 0.8817 | 0.4868 | 0.7908 |
Source: MemRec, Tables 2-3
The key takeaway is the paradigm hierarchy: Collaborative > Dynamic > Static > No Memory. Dynamic agents (AgentCF, i2Agent) consistently beat static ones (iAgent), which beat Vanilla LLM. But even the SOTA dynamic agent (i2Agent) falls significantly short of MemRec: on Goodreads H@1 +28.98% relative gain, on MovieTV +19.75%, on Yelp +15.77%.
4.2 Cognitive Overload Validation (RQ2)
This is the most engineering-interesting experiment. MemRec is compared with:
- Vanilla LLM — no memory
- Naive Collaborative Agent — monolithic, processes uncurated context in one model
- MemRec — decoupled, curate-then-synthesize
The Naive Agent plateaus: one model can’t simultaneously absorb verbose context and perform complex ranking. MemRec breaks the plateau through decoupling — LLM_Rec receives only high-signal distilled context. Result: +34% relative H@1 gain on Books over the Naive Agent. This directly confirms that architectural decoupling is not an optimization but a necessity.
4.3 Ablation Studies (RQ4)
What happens if we remove MemRec components? Ablation on Books:
| Ablation | H@1 | Drop | What it means |
|---|---|---|---|
| MemRec (Full) | 0.527 | — | baseline |
| w/o Collab. Read | 0.475 | −9.9% | Without collaborative retrieval — agent sees only personal history. Largest drop |
| w/o LLM Curation | 0.498 | −5.5% | Generic heuristics instead of domain-adaptive LLM rules. More noise |
| w/o Collab. Write | 0.505 | −4.2% | Without async propagation. Static graph still works, but loses evolving precision |
Collaborative retrieval is the most important component. LLM curation beats generic heuristics. Async propagation is critical for top-1 precision, though without it broad recall (H@5) remains high (0.814).
4.4 Robustness (RQ5)
MemRec is not just robust to data sparsity — it is most useful precisely for data-sparse users. The low-activity group gets +91.4% relative H@1 gain over Vanilla LLM. The collaborative graph compensates for the deficit of personal history.
At 30% noise injection (fake items in history), MemRec holds H@1 = 0.491 — resilience thanks to “Curate-then-Synthesize”: LLM curation filters irrelevant peers before they reach the reasoning agent.
4.5 Pareto Frontier (RQ3)
MemRec doesn’t just perform better — it establishes a new Pareto frontier between reasoning quality, online inference cost, and deployment flexibility. The key: heavy cognitive load of processing the collaborative graph is offloaded to async offline batches. Online inference sees only distilled
Configurations:
| Configuration | LLM_Rec / LM_Mem | H@1 | Latency | Cost | Notes |
|---|---|---|---|---|---|
| Vanilla LLM | 4o-mini / — | 0.330 | ~5.1s | lowest | No memory |
| Standard | 4o-mini / 4o-mini | 0.524 | ~16.5s | low | Base MemRec |
| Cloud-OSS | 4o-mini / OSS-120B | 0.561 | ~11.8s | low | Near-ceiling, open-weights LM_Mem |
| Local-Qwen | 4o-mini / Qwen-2.5-7B | 0.470 | ~34.0s | low* | Privacy-sensitive, on-premise |
| Ceiling | gpt-4o / 4o-mini | 0.580 | ~10.4s | high | Peak performance |
*Local deployment — zero API cost for memory maintenance.
Cloud-OSS is particularly interesting: open-weights LM_Mem (gpt-oss-120b) delivers near-ceiling results at low cost. This means memory management can be fully on-premise without quality loss — privacy-preserving deployment is real.
The token breakdown reveals an engineering insight: input tokens make up ~80% of total usage (input is 3-4x cheaper than output). Stage-R and Stage-W are heavily input-biased — they absorb verbose context (cheap) and produce condensed insights (expensive, but little). Per user: ~5,100 input + ~1,300 output = ~6,400 total tokens. Effective cost is radically lower than a naive total-token estimate would suggest.
5. From Recommender Systems to Arbitrary Agents
MemRec is a paper about recommender systems. But its architectural patterns are universal. Let’s make the transfer.
Explicit concept mapping:
| Recommender Systems | Arbitrary LLM Agents |
|---|---|
| User
| Agent
|
| Item
| Task, artifact, document
|
| User-item interaction | Agent-task execution, agent reads document |
| Co-engagement (users share items) | Shared context (agents worked on same task) |
| Peer users | Peer agents (team members) |
| Collaborative filtering signal | Organizational knowledge transfer |
Two concrete scenarios where collaborative memory applies to arbitrary agents.
Multi-agent shared memory. A team of agents works on a project. Agent A solves a dependency conflict problem in Go modules. Agent B encounters the same problem a week later. Without collaborative memory — B starts from scratch, spends the same hours. With a collaborative memory graph — the interaction A→“dependency conflict solution” propagates to agent B through a shared edge (both work with Go modules). This isn’t a shared filesystem, it’s semantic propagation: B receives a distilled insight from A, grounded in evidence.
Organizational memory. A support agent has processed 100 SSO integration tickets. The memory graph links these tickets through common themes. A new support agent arrives — and instead of reading 100 tickets, gets synthesized facets: “SSO integration pitfalls: certificate chain (conf 0.9), redirect URI mismatch (conf 0.85), token refresh race (conf 0.7).” This is
Sounds like science fiction? MemRec shows it works on recommender systems. The transfer to arbitrary agents is an engineering task, not a research breakthrough. The architecture is the same: LM_Mem curates the graph, LLM_Rec reasons, async propagation updates.
6. The Landscape: Three Paradigms of Production Memory
While research was paving the way to collaborative memory, industry was building tools. Three paradigms, each with an arxiv paper and production footprint. I chose these three specifically because they are fundamentally different — not feature-list competitors, but different models of memory.
graph TB
subgraph "Mem0: Managed Memory Layer"
M0["Vector store
+ hybrid retrieval"]
M0 -->|"semantic + BM25
+ entity"| M0R["Fused results"]
end
subgraph "Letta: OS-Tiered Memory"
L0["Core memory
(in-context, RAM)"]
L1["Archival memory
(external, disk)"]
L0 <-->|"page via
function calls"| L1
end
subgraph "Zep: Temporal Knowledge Graph"
Z0["Graphiti engine
time-aware facts"]
Z0 -->|"graph traversal
+ temporal"| Z0R["Context with
history"]
end
style M0 fill:#e65100,color:#fff
style L0 fill:#4a148c,color:#fff
style L1 fill:#4a148c,color:#fff
style Z0 fill:#004d40,color:#fff
6.1 Mem0: Managed Memory Layer
Mem0 (Chhikara et al., 2025) is a universal memory layer for AI agents. 59.6k GitHub stars, YC S24. The ideology: memory as a managed service — the agent doesn’t think about storage, Mem0 extracts, consolidates, retrieves.
Architecturally — multi-level memory with layers:
| Layer | Lifetime | What it stores |
|---|---|---|
| Conversation | one turn | In-flight messages, tool outputs |
| Session | minutes-hours | Current task context |
| User | weeks-forever | Personalization, preferences |
| Organizational | global | Shared FAQs, policies |
Retrieval is multi-signal (after the April 2026 update): semantic search + BM25 keyword + entity matching, all fused in parallel. This delivers benchmarks: LoCoMo 91.6 (+20 over previous algorithm), LongMemEval 94.8 (+27), BEAM 1M 64.1, BEAM 10M 48.6.
The new algorithm (April 2026, migration guide) is single-pass ADD-only: one LLM call for extraction, no UPDATE/DELETE. Memories accumulate, nothing is overwritten. Agent-generated facts are first-class citizens: if an agent confirmed an action, the information is stored with equal weight. Entity linking — entities are extracted, embedded, and linked across memories for retrieval boosting.
Minimal SDK snippet:
from mem0 import Memory
memory = Memory()
# Add memory
memory.add(
["I'm Alex, I prefer YAML and dark theme."],
user_id="alex"
)
# Retrieval — hybrid: semantic + BM25 + entity
results = memory.search(
"What are Alex's preferences?",
filters={"user_id": "alex"},
top_k=3
)
6.2 Letta (MemGPT): OS-Inspired Tiered Memory
MemGPT (Packer et al., UC Berkeley, 2023) is the seminal paper that framed LLMs as operating systems. The idea: virtual context management, inspired by hierarchical memory in traditional OSes. Core memory (in-context, like RAM) + archival memory (external storage, like disk). The agent manages data movement between tiers via function calls.
Letta is the production framework built on MemGPT. White-box, model-agnostic. The core abstraction is memory blocks: structured sections of the context window that persist across interactions.
graph TB
subgraph "Context Window (Limited)"
SYS["System Prompt"]
BLOCKS["Memory Blocks
(Core Memory = RAM)"]
CONV["Conversation
(working memory)"]
end
subgraph "External Storage"
ARCH["Archival Memory
(= Disk)
unlimited"]
end
LLM["LLM"]
SYS --> LLM
BLOCKS --> LLM
CONV --> LLM
LLM -->|"core_memory_append
core_memory_replace"| BLOCKS
LLM <-->|"archival_memory_search
archival_memory_insert"| ARCH
style BLOCKS fill:#4a148c,color:#fff
style ARCH fill:#311b92,color:#fff
style LLM fill:#1565c0,color:#fff
Core memory (memory blocks) is always in context, like RAM. Archive is external storage, the agent “pages” data via function calls (archival_memory_search, archival_memory_insert). If a block overflows (chars_limit), the agent itself decides what to evict to archival. Here’s what the LLM sees:
<memory_blocks>
<persona>
<description>The persona block: Stores details about your current
persona, guiding how you behave and respond.</description>
<metadata>- chars_current=128 - chars_limit=5000</metadata>
<value>I am a helpful assistant named Sam. I enjoy helping users
solve problems.</value>
</persona>
<human>
<description>The human block: Stores key details about the person
you are conversing with.</description>
<value>The user's name is Alice. She is a software engineer who
prefers concise answers.</value>
</human>
</memory_blocks>
Key properties of memory blocks:
- Agent-managed — the agent autonomously organizes information by block labels
- Always visible — blocks are in context always, no retrieval needed
- Shareable — multiple agents can read the same block (shared memory, multi-agent coordination)
- Read-only option — policies as read-only blocks, the agent can’t modify them
Benchmark: DMR (Deep Memory Retrieval) 93.4% — the baseline that Zep surpassed.
Minimal snippet:
from letta import Letta
client = Letta()
agent = client.agents.create(
name="memory_agent",
memory_blocks=[
{"label": "human", "value": "User prefers Go and concise answers."},
{"label": "persona", "value": "I am a senior engineering assistant."},
],
# archival memory — external, agent pages via function calls
)
6.3 Zep: Temporal Knowledge Graph
Zep (Rasmussen et al., 2025) is a memory layer service built on Graphiti. Graphiti is an open-source framework for temporal knowledge graphs (context graphs with a temporal axis). Unlike static RAG, Graphiti makes real-time incremental updates: relationships and facts evolve with the data, without batch recomputation.
The architecture: dynamic synthesis — simultaneously processes unstructured conversational data and structured business data while maintaining historical relationships. A fact in the graph has time validity: when it became true, when it stopped being true. A query can reason over how facts changed over time, not just what is true now.
graph LR
subgraph "Input"
CONV["Conversational data
(unstructured)"]
BIZ["Business data
(structured)"]
end
subgraph "Graphiti Engine"
ENT["Entity
Extraction"]
EDGE["Edge
Creation"]
TEMP["Temporal
Annotation"]
GRAPH["Temporal
Knowledge Graph"]
end
subgraph "Output"
FACTS["Facts with
time validity"]
Q["Query:
'what changed
since X?'"]
end
CONV --> ENT
BIZ --> ENT
ENT --> EDGE --> TEMP --> GRAPH
GRAPH --> FACTS
FACTS --> Q
style GRAPH fill:#004d40,color:#fff
style TEMP fill:#00695c,color:#fff
Each fact in the graph is annotated with temporal markers: when it became true (valid_from), when it stopped (valid_to). The query “what was the user doing in March?” traverses the graph by temporal edges, not just semantic similarity. This is a qualitatively different retrieval — not “find similar” but “find what was true at moment X.”
Benchmarks:
- DMR: 94.8% vs MemGPT 93.4% — Zep outperforms on the benchmark the MemGPT team established as their primary metric
- LongMemEval: +18.5% accuracy, −90% latency vs baseline — especially strong in cross-session synthesis and long-term context maintenance
Minimal snippet:
from zep_cloud import Zep
client = Zep(api_key="...")
# Add an episode — Graphiti syncs the graph
client.memory.add(
session_id="session-1",
messages=[{"role": "user", "content": "I switched from PostgreSQL to SQLite for project X."}]
)
# Retrieval — graph traversal + temporal reasoning
context = client.memory.get(session_id="session-1")
# context contains facts with temporal validity
6.4 Emerging: A-MEM and LangMem
Mem0, Letta, Zep — three production tools. But research doesn’t stand still.
A-MEM (arXiv:2502.12110, NeurIPS 2025) is an agentic memory system following Zettelkasten principles. Memory organizes itself: dynamic indexing and linking create interconnected knowledge networks. This is a research direction with no production footprint yet, but the idea — memory as a self-organizing system — resonates with collaborative propagation in MemRec.
RecMem (arXiv:2605.16045, ACL 2026 Findings) rethinks not WHAT to store, but WHEN to consolidate. Existing systems eagerly invoke LLMs for every interaction — expensive. RecMem accumulates interactions in a subconscious layer (cheap embeddings), and invokes LLMs for episodic and semantic memory extraction only when sustained recurrence of semantically similar interactions is observed — an analogue of a phase transition. Result: up to 87% reduction in token cost while exceeding the accuracy of three SOTA memory systems. This is a direct response to the same cost challenge as MemRec, but through density-triggered consolidation rather than async propagation. For a visual walkthrough of the architecture, see this YouTube video: “Phase Transitions in AI Agent Memory: REC Memory Architecture”.
LangMem (langchain-ai/langmem) is SDK-level primitives for LangGraph. Semantic, episodic, procedural memory as functional building blocks. Not a standalone system, but a library for those building their own memory architecture on top of the LangGraph storage layer.
7. TOP-3 Comparison: Nine Axes
Now let’s compare Mem0, Letta, and Zep systematically — across nine axes. Each axis is an architectural decision, not a feature.
| Axis | Mem0 | Letta (MemGPT) | Zep |
|---|---|---|---|
| 1. Memory model | Vector store + entity graph | OS-tiered (core=RAM, archival=disk) | Temporal knowledge graph (Graphiti) |
| 2. Architecture | Managed layer (service/SDK) | In-process agent (framework) | Service (Graphiti engine) |
| 3. Retrieval | Hybrid: semantic + BM25 + entity (parallel fused) | Hierarchical paging (function calls) | Graph traversal + temporal reasoning |
| 4. Temporal awareness | Added Apr 2026 (time-aware retrieval) | None | First-class (facts with time validity) |
| 5. Update cost | Single-pass ADD-only (1 LLM call) | Agent self-edits via function calls | Real-time incremental (no batch) |
| 6. Collaborative memory | No (entity linking — intra-agent) | Partial (shared blocks — multi-agent) | No (graph per-session) |
| 7. Benchmarks | LoCoMo 91.6, LongMemEval 94.8, BEAM 1M 64.1 | DMR 93.4 | DMR 94.8, LongMemEval +18.5% |
| 8. Production | Self-host (Docker) / Cloud / CLI | Self-host (framework) / Cloud | Self-host / Cloud |
| 9. Ergonomics | SDK (Python/TS), CLI, agent skills | SDK (Python/TS), white-box, model-agnostic | SDK (Python/TS/Go) |
7.1 Benchmarks Cross-Table
Benchmarks are a sore subject. LoCoMo, LongMemEval, DMR, BEAM — different benchmarks measuring different things. Direct comparison is valid only on shared benchmarks.
| Benchmark | What it measures | Mem0 | Letta | Zep |
|---|---|---|---|---|
| LoCoMo | Long conversational memory (single/multi-hop, temporal, open-domain) | 91.6 | — | — |
| LongMemEval | Cross-session synthesis, long-term context | 94.8 | — | +18.5% acc, −90% latency |
| DMR | Deep Memory Retrieval | — | 93.4% | 94.8% |
| BEAM | Million-token scale memory | 64.1 (1M), 48.6 (10M) | — | — |
Shared benchmarks: LongMemEval for Mem0 and Zep (direct comparison possible); DMR for Letta and Zep (Zep outperforms 94.8 vs 93.4). LoCoMo and BEAM are Mem0-only. A global claim “X is better than Y” is impossible — only per-benchmark statements.
7.2 Spotlight: Collaborative Memory — The Gap
Axis 6 is the most important for this article. None of Mem0, Letta, or Zep implement collaborative memory in the sense MemRec defines it (memory graph with cross-agent/cross-entity relational signal transfer).
To be precise:
- Mem0 entity linking is intra-agent: entities are linked within one user’s memory, not across agents. This is retrieval boosting, not collaborative signal transfer.
- Letta shared blocks enable multi-agent coordination: several agents read one read-only block. This is shared state, but not collaborative propagation — no graph evolution.
- Zep temporal graph is per-session: the graph is built for one session/user, no cross-agent graph with propagation.
MemRec shows collaborative memory delivers +14-29% H@1. This isn’t a marginal optimization — it’s a qualitative leap, and no production tool makes it. More on this in Section 8.
8. Research vs Tools: Where the Gap Is
Collaborative memory isn’t the only gap. The research frontier (MemRec) outpaces tooling (TOP-3) in four areas. Let’s break down each: what research claims, what tools do, what to adopt now.
graph TB
subgraph "Research Frontier (MemRec)"
R1["Collaborative memory
graph G=(V,E)"]
R2["Architectural decoupling
LM_Mem / LLM_Rec"]
R3["Temporal-aware
facts + history"]
R4["Curate-then-Synthesize
IB-grounded distillation"]
end
subgraph "Tooling Reality"
T1["Mem0: intra-agent
entity linking"]
T2["Letta: in-process
no decoupling"]
T3["Zep: first-class
Mem0: added 2026
Letta: none"]
T4["Mem0: consolidation
Letta: agent-managed
Zep: graph synthesis"]
end
R1 -.->|"GAP"| T1
R2 -.->|"PARTIAL"| T2
R3 -.->|"Zep: COVERED"| T3
R4 -.->|"AD HOC"| T4
style R1 fill:#c62828,color:#fff
style T1 fill:#c62828,color:#fff
style R2 fill:#f9a825,color:#000
style T2 fill:#f9a825,color:#000
Gap 1: Collaborative Memory — The Largest
Research claim: MemRec shows +14-29% H@1 from collaborative signal. A memory graph
Tool status: None of the TOP-3 implement collaborative memory. Mem0 entity linking is intra-agent. Letta shared blocks are shared state without propagation. Zep temporal graph is per-session.
Adopt now: If you need collaborative signal — custom build. MemRec’s architecture is portable: LM_Mem curates the graph, LLM_Rec reasons, async propagation updates. No magic, just engineering. Or wait for research propagation to reach tooling — given the pace (MemRec ACL 2026, A-MEM NeurIPS 2025), 12-18 months.
Gap 2: Architectural Decoupling — Partial
Research claim: Decoupling memory management (LM_Mem) from reasoning (LLM_Rec) resolves cognitive overload (+34% H@1 over naive monolithic). IB-grounded “Curate-then-Synthesize” — two compression passes.
Tool status: Partial. Mem0 separation — extraction/retrieval are separate from the reasoning LLM, but not as a first-class architectural principle with IB framing. Letta — in-process, the agent self-edits memory blocks, no decoupling. Zep — Graphiti engine is separate from reasoning, but without explicit distillation stages.
Adopt now: Mem0 is closest. If cost/latency trade-off matters — Mem0 separation delivers part of the benefit. Full decoupling as in MemRec — custom.
Gap 3: Temporal Awareness — Zep First-Class
Research claim: Facts evolve. A query should reason over how facts changed, not just what is true now.
Tool status: Zep — first-class (Graphiti temporal graph, facts with time validity). Mem0 — added in April 2026 (time-aware retrieval, but not first-class like Zep). Letta — no temporal awareness.
Adopt now: Zep. If temporal reasoning is critical (enterprise use cases, cross-session synthesis) — Zep is the only first-class option. LongMemEval +18.5% accuracy / −90% latency — direct confirmation.
Gap 4: Distillation — Ad Hoc
Research claim: “Curate-then-Synthesize” — IB-grounded, domain-adaptive LLM curation rules, structured facets with confidence and grounding evidence. A unified approach.
Tool status: Ad hoc. Mem0 — consolidation (single-pass extraction, but no structured facets). Letta — agent-managed (the agent decides what goes in core memory). Zep — graph synthesis (Graphiti builds the graph, but not in facet format). No unified distillation approach.
Adopt now: Depends on use case. Mem0 consolidation — for simple personalization. Zep graph synthesis — for complex relational reasoning. Structured facets as in MemRec — custom.
9. Engineering Decision Framework
Which tool to choose? Depends on four use-case characteristics.
graph TB
START["Use case needs
agent memory?"]
Q1{"Temporal reasoning
critical?"}
Q2{"Scale > 1M
memories?"}
Q3{"Multi-agent
coordination?"}
Q4{"Collaborative
memory needed?"}
ZEP["Zep
(temporal graph)"]
MEM0["Mem0
(managed layer)"]
LETTA["Letta
(OS-tiered)"]
CUSTOM["Custom build
MemRec-style architecture
or wait for tooling"]
START --> Q1
Q1 -->|"Yes"| ZEP
Q1 -->|"No"| Q2
Q2 -->|"Yes"| MEM0
Q2 -->|"No"| Q3
Q3 -->|"Yes"| LETTA
Q3 -->|"No"| Q4
Q4 -->|"Yes"| CUSTOM
Q4 -->|"No"| MEM0
style ZEP fill:#004d40,color:#fff
style MEM0 fill:#e65100,color:#fff
style LETTA fill:#4a148c,color:#fff
style CUSTOM fill:#c62828,color:#fff
Brief summary by branch:
| Use case characteristic | Recommendation | Why |
|---|---|---|
| Temporal reasoning critical | Zep | First-class temporal graph, DMR 94.8%, LongMemEval +18.5% |
| Scale > 1M memories, personalization | Mem0 | BEAM 1M 64.1, managed layer, hybrid retrieval, 59.6k stars production-hardened |
| Multi-agent coordination | Letta | Shared memory blocks, OS-tiered, agent-managed |
| Collaborative memory needed | Custom build | None of the TOP-3 does collaborative. MemRec architecture is portable. |
| Simple personalization, fast start | Mem0 | Best ergonomics, CLI, agent skills, cloud + self-host |
An important caveat: the decision tree is simplified. The real choice depends on deployment model (on-premise vs cloud), latency requirements, compliance. Mem0’s Cloud-OSS config shows that open-weights LM_Mem delivers near-ceiling results — privacy-preserving deployment is real.
10. Open Problems and Where Research Is Heading
The article is wrapping up, but the topic isn’t. Several open problems will define the next 12-18 months.
Collaborative memory across agents. MemRec demonstrated collaborative memory within one system (recommender). The transfer to multi-agent systems is an open problem. How to propagate insights between agents with different specializations? How to avoid noise during propagation? A-MEM (NeurIPS 2025) points a direction — self-organizing memory via Zettelkasten — but there are no production tools yet.
Memory consolidation / dreaming. Anthropic and OpenAI in 2026 shipped background memory consolidation — so-called “Dreaming.” The idea: the agent “sleeps” between sessions and consolidates memory — compression, deduplication, extracting patterns. This resonates with MemRec’s async propagation, but at a different scale: not propagation between graph nodes, but consolidation of the agent’s entire memory. The mechanics of Dreaming (Anthropic Auto Dream, OpenAI Dreaming V3 with 82.8% factual recall) are covered in detail in the AI Agent Design Patterns series, Part 6 — I won’t duplicate that here.
Evaluation gaps. There is no unified benchmark for collaborative memory. LoCoMo, LongMemEval, DMR — single-agent benchmarks. MemRec uses RS-specific metrics (H@K, N@K). How to evaluate collaborative memory for arbitrary agents? This is a research problem — without a benchmark there’s no comparison, without comparison there’s no progress.
Privacy-preserving federated memory. MemRec notes in its limitations: future work is federated memory updates. If the collaborative graph is distributed across organizations (each with its own NDA) — how to transfer insights without transferring raw data? Federated learning for memory graphs is an open area.
Conclusion
LLM agent memory has traveled from complete absence to dynamic isolated memory. MemRec (ACL 2026) points to the next milestone — collaborative memory, where agent memories are linked in a graph and exchange relational signals. Architecturally this means: decouple memory management from reasoning, build a memory graph, curate-then-synthesize for distillation, async propagation for evolution.
Three production tools — Mem0, Letta, Zep — represent three different paradigms of isolated memory: managed layer, OS-tiered, temporal graph. All three are fit-for-purpose for single-agent use cases. But none implements collaborative memory, which MemRec has proven as the next step (+14-29% H@1).
Research outpaces tooling. This is normal — the research frontier moves faster than production adoption. For engineers today: choose from the TOP-3 based on use-case characteristics, but remember that collaborative memory is the next wave, and MemRec shows how to build it.
References:
- MemRec: Collaborative Memory-Augmented Agentic Recommender System — Chen et al., ACL 2026
- Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory — Chhikara et al., 2025
- MemGPT: Towards LLMs as Operating Systems — Packer et al., 2023
- Zep: A Temporal Knowledge Graph Architecture for Agent Memory — Rasmussen et al., 2025
- A-MEM: Agentic Memory for LLM Agents — Xu et al., NeurIPS 2025
- RecMem: Recurrence-based Memory Consolidation for Efficient and Effective Long-Running LLM Agents — Dai et al., ACL 2026 Findings
- Lost in the Middle — Liu et al., 2024
- Generative Agents — Park et al., 2023