AI Agent Memory: A Survey of Memory Types and a Practical Selection Guide
This article summarizes a recent survey on AI agent memory and turns its findings into a practical selection guide. It explains how agent memory differs from a model's internal memory, retrieval-augmented generation (RAG), and context engineering; compares three memory carriers—token-level, parameter-level, and latent-level; and covers self-forgetting and conflict resolution as mechanisms that make memory dynamic. It closes with recommendations for choosing a memory design based on agent type and compliance needs.
1. Introduction: Why Agents Need a Dedicated Study of Memory
Several leading research institutions recently published a joint survey on agent memory that redraws the boundaries between concepts that have long been treated as the same thing. For developers, the value of this work is not the number of methods it lists, but that it elevates “memory” from an engineering trick to a system capability that can be designed.
Two hard problems show up repeatedly when building complex agents. The first is context overflow: no matter how large the window is, it cannot hold months of interaction history. The second is catastrophic forgetting: after fine-tuning or long-horizon interaction, the model loses critical early information. Existing industry approaches are fragmented. At inference time, key-value caching reduces repeated computation. On the knowledge side, retrieval augmentation adds external knowledge. For long-horizon interaction, hierarchical memory architectures perform page-style swapping in and out. All of them address “storage,” but none answers what to store, how long to keep it, and whose version wins in a conflict. That gap is exactly where this survey starts.
2. Core Definitions: What Makes Agent Memory Distinct
To design a memory system, the first step is to stop treating everything written to disk as memory. The survey strictly separates three easily confused concepts.
Agent memory vs. a model’s internal memory. The latter is closer to hardware-level capacity optimization, such as improving the reuse of attention key-value caches or extending the processable sequence length through linear-attention-style architectures. It focuses on the efficiency and capacity ceiling of a single inference pass. Agent memory is a persistent, dynamically evolving cognitive state that an agent maintains to exist continuously in an environment. It carries “who I am, what I have experienced, and what the user prefers,” spanning multiple interaction cycles.
Agent memory vs. retrieval-augmented generation. Retrieval augmentation is usually a relatively static mount of external knowledge, commonly in the form of modular retrieval, graph-based retrieval, or agent-driven retrieval. It solves a knowledge base problem, serves a single task, and the base itself rarely changes through interaction. Agent memory grows dynamically: every interaction may add experience, correct a mistaken belief, or decay low-value information.
Agent memory vs. context engineering. Context engineering is a resource management technique that squeezes critical information into a limited window through prompt compression and importance filtering. Agent memory is cognitive modeling that decides what is worth depositing as a long-term asset and being recalled weeks or months later. In one sentence: context engineering governs “how to fit it in,” while agent memory governs “what to put in and why it stays.”
3. Three Memory Carriers: Token-Level, Parameter-Level, and Latent-Level
The survey divides memory carriers into three levels, which is the most engineering-actionable part of the paper.
Token-level memory exists as explicit text or structured records. It is readable, auditable, and editable. Typical implementations include summary sequences, fact triples, event logs, and user profile tables. The advantage is transparency and controllability, which makes compliance review easy. The drawback is that it consumes context budget, retrieval is noisy, and it tends to degrade over long histories.
# Minimal write and recall structure for token-level memorymemory = {"profile": {"name": "User A", "pref": ["concise answers", "English"]},"events": [ # append-only event stream with time decay{"t": 12, "text": "confirmed using PostgreSQL", "w": 0.9},{"t": 47, "text": "switched to a key-value store", "w": 0.9},],}def recall(query, top_k=3, decay=0.98):scored = [(e["w"] * decay ** (47 - e["t"]), e) for e in memory["events"]]return [e for _, e in sorted(scored, reverse=True)[:top_k]]
Parameter-level memory bakes experience into weights, for example through fine-tuning or lightweight adapters so the model “remembers” domain style and operating habits. Its advantages are zero inference overhead and good generalization. The cost is high update cost, difficulty in precisely deleting a single memory, and the risk of forgetting.
Latent-level memory compresses history into continuous vector states that are injected at inference time as a prefix or state. It strikes a balance between capacity and efficiency and suits very long-horizon tasks, but it is weakly interpretable and hard to debug.
A more realistic engineering approach is to combine all three: token-level as the source of truth and audit layer, latent-level as the long-horizon compression layer, and parameter-level for stable preferences. No single carrier can simultaneously satisfy interpretability, updatability, and low overhead.
4. Making Memory “Biological”: Self-Forgetting and Conflict Resolution
The two most noteworthy mechanisms in the survey turn memory from static storage into dynamic cognition.
Self-forgetting is not simple time-based cleanup but multi-factor scoring: access frequency, time of last hit, relevance to the current goal, and the probability of being overturned by later evidence. Low-scoring entries are first down-weighted, then archived, and finally physically deleted, forming a layered strategy similar to cache eviction.
Conflict resolution handles the case where “the user said A last week and says B today.” A workable flow is to prioritize new evidence, mark the old entry as invalidated rather than erasing it outright (preserving traceability), and, when necessary, trigger a small-scope rewrite to remove contradictory statements. Without this layer, companion or assistant agents running over the long term will keep producing self-contradictory conclusions.
5. Implementation Advice and a Selection Comparison
- Task-oriented, short-cycle agents: rely mainly on token-level memory with context compression; there is no need to introduce a complex state network.
- Long-cycle companion or advisory agents: use a three-layer hybrid and invest primarily in forgetting scores and conflict resolution.
- Autonomous coding agents: strengthen structured records of event logs and tool-call traces for easier retrospective localization.
- Strong-compliance scenarios: prefer auditable explicit memory; parameter-level updates need to retain versions and a rollback path.
On the infrastructure side, object storage can hold memory snapshots, a message queue can drive asynchronous writes and archiving, a container platform can host memory services, and a logging, monitoring, and alerting system can track metrics such as hit rate, conflict rate, and staleness.
6. Conclusion
The real contribution of this survey is pulling memory back from an arms race of “stuffing in more context” to the right question of cognitive modeling: layered carriers, dynamic evolution, the ability to forget, and the ability to self-correct. For teams building complex agents, a safer order of progression is to first define the division of labor across memory levels, then design forgetting and conflict strategies, and only then discuss retrieval and compression optimization.
