LLM-based agents are distinguished from base LLMs by a memory module that records prior observations and lets the agent self-evolve across trials. This survey organizes the memory mechanism into three orthogonal axes. Sources classify where memory content comes from: inside-trial information (steps within the current task, the most relevant for the immediate next action), cross-trial information (patterns learned from previous runs of the same task), and external knowledge (pre-existing or retrieved knowledge outside the agent-environment loop). Forms classify how the memory is stored: textual memory lives in the prompt context — cheap, inspectable, shareable across agents, but bounded by context length — while parametric memory is encoded in model weights via fine-tuning, RL, or LoRA — dense and unbounded, but expensive to update, hard to inspect, and not directly shareable.

Operations describe the three phases of the agent-environment interaction: writing (project raw observations into informative stored contents), management (summarize, merge, forget — including reflection-based compression that keeps only the most useful entries), and reading (retrieve relevant context for the next action). The survey maps 30+ memory-augmented agents onto this three-axis taxonomy. Evaluation falls into direct (subjective human / GPT-4 judgments, plus objective metrics like retrieval accuracy and MAUVE) and indirect (downstream task quality on conversation, multi-source QA, long-context reasoning, action success rate, code pass@k). The wins are uneven: stored memory can be a vector for hallucination (the agent cites fabricated “experiences” as ground truth), social bias propagates from the source data, retrieval mechanisms are not yet explainable, and prompt-injection through memory writes is an open security concern. Trajectories are schematic; numbers are paper-report. The site does not host the PDF.

teaching explainer · Zhang et al. · arXiv 2404.13501 · Renmin University / Huawei · arXiv:2404.13501 · repo github.com/Lethe1122/LLM_Agent_Memory_Survey · traces are schematic; numbers marked paper-report come from the survey's tables

0overview

core: LLM-based agents are distinguished from base LLMs by a memory module that records prior observations and lets the agent self-evolve across trials. The survey organizes memory along three axes: sources (inside-trial / cross-trial / external), forms (textual / parametric), and operations (writing / management / reading).

sources

3 sources

Inside-trial: steps within the current run. Cross-trial: patterns from previous runs. External: pre-existing or retrieved knowledge outside the agent-environment loop.

forms

textual vs parametric

Textual: natural language in the prompt context — cheap, inspectable, shareable. Parametric: weights updated via fine-tuning / RL / LoRA — dense, unbounded, expensive to update.

operations

writing · management · reading

Write raw observations into stored contents. Manage: summarize, merge, forget. Read: retrieve relevant context for the next action. Three phases of every agent step.

Five panes: sources, forms, operations, evaluation, and the paper's own limits.

primer — what you need before you start

the task. The Memory Survey organizes 1000+ agent-memory papers into a 3-axis taxonomy: where the memory comes from, what form it takes, and how the agent uses it. Memory is what separates a "single-shot LLM" from a "long-lived agent".

how it was done before. Two prior patterns: (1) every-trial-fresh agents — same plan, same failure; (2) hand-coded external state — K/V cache, vector DB, etc., but no agent-side bookkeeping. The paper frames the missing piece: a memory module the agent can read and write.

glossary — terms you will see.
agent — the LLM + a controller loop; reads context, emits actions.
environment — the outside world the agent acts on (browser, REPL, files, API).
observation — text the environment emits back to the agent (search result, error, page).
action — a structured call the agent emits (tool call, click, code line).
inside-trial memory — working state of the current run; chain-of-thought is one form.
cross-trial memory — persistent across runs; Reflexion-style buffers.
external memory — RAG corpus, external DB, a notes file the agent writes to.
episodic memory — store of past events the agent can replay.

symbol table — what the letters mean.
MtM_t — memory state at step t (may include text + metadata).
rr — a recall operation: query the memory for relevant items.
ww — a write operation: append or update the memory.
θ\theta — parametric memory (model weights).
eval(M)\text{eval}(M) — how well the memory contributes to downstream task success.
Dtasks\mathcal{D}_{\text{tasks}} — the set of tasks the agent is being benchmarked on.

tone legend — what the [brackets] mean.
[obs] observation   [ops] memory operation
[src] memory source   [form] memory form
[eq] equation   [take] key takeaway
[sys] system / meta   [limit] paper-reported limit

Six panes cover, in pedagogical order: memory sources; memory forms; memory operations; direct vs indirect evaluation; the paper's own limits. Each pane ends with key takeaways so you can stop after any section and still know what you learned.

1sources

point: three categories of memory content. Inside-trial — historical steps within the current run, the most relevant for the next action. Cross-trial — patterns learned from previous runs of the same task, enabling self-evolution. External knowledge — pre-existing or retrieved knowledge outside the agent-environment loop.

The taxonomy maps 30+ memory-augmented agents onto these three categories. Most agents use inside-trial information; only some combine it with cross-trial or external knowledge to enable self-evolution across runs.

session · sec 1 · inside-trial / cross-trial / external
3 sources of memory content

inside-trial cross-trial external

2forms

point: textual memory lives in the prompt context — natural language, easy to inspect, easy to share across agents, but bounded by the context window. Parametric memory is encoded in model weights via fine-tuning, RL, or LoRA adapters — dense, unbounded by context length, but expensive to update and hard to inspect.

The choice between textual and parametric is a cost / inspectability trade-off. Textual wins on cost, sharing, and transparency. Parametric wins on density and scale but is opaque and update-expensive.

session · sec 2 · textual vs parametric
textual: prompt context · parametric: weights

textual parametric

3operations

point: three operations in order. Writing at step t projects raw observations into informative stored contents. Management summarizes, merges, and forgets — including reflection-based compression that keeps only the most useful entries. Reading at step t+1 retrieves relevant context for the next action.

Reading is usually implemented by computing similarity between the memory pool and the next context. Management is realized by a reflection process (e.g., Generative Agents, TPTU) that compresses and selects what to keep — usually thresholded by importance score.

session · sec 3 · writing → management → reading
three operations per agent step

writing management reading

4evaluation

point: two paradigms. Direct evaluation judges memory itself — subjective (human / GPT-4 ratings) plus objective (retrieval accuracy, perplexity, MAUVE, ROUGE). Indirect evaluation measures downstream task quality: conversation (MT-Bench / MT-Bench++), multi-source QA, long-context reasoning (needle-in-haystack, multi-hop), action success rate, code pass@k.

Indirect is more practical — agents are usually deployed for their downstream task, not for memory quality per se. But indirect conflates memory quality with model capability, making it hard to attribute wins.

session · sec 4 · direct (subjective, objective) vs indirect
memory quality · downstream task quality

direct indirect

5limits

point: stored memory can be a vector for hallucination — the agent cites fabricated "experiences" as ground truth. Social bias propagates from the source data into the memory pool. Retrieval mechanisms are not yet explainable — it is hard to surface "why this memory?" to the user. Adversarial attacks on memory writes (prompt injection) and privacy leaks from stored personal information are open security concerns.

Multi-step planning that uses memory efficiently is an open problem — current agents do not separate planning from memory. Memory sharing across multiple agents in the same environment is the open frontier for multi-agent systems.

session · sec 5 · paper-acknowledged limits
hallucination · bias · explainability · security

limit open direction

Schematic traces are teaching schematics. Numbers reported: Zhang, Bo, Ma, Li, Chen, Dai, Zhu, Dong, A Survey on the Memory Mechanism of Large Language Model based Agents, arXiv:2404.13501v1 (21 Apr 2024), arXiv:2404.13501. Repo: github.com/Lethe1122/LLM_Agent_Memory_Survey. This site does not host the PDF.