---
title: 'A-Mem: Agentic Memory for LLM Agents'
url: https://www.emergentmind.com/topics/a-mem-f532202f-4731-460c-a380-ab9ea511602c
type: topic
---

# A-Mem: Agentic Memory for LLM Agents

A-Mem is an agentic memory system for LLM agents that dynamically organizes memories through structured note construction, retrieval, linking, and revision, rather than treating memory as a passive store of past interactions. Introduced in "A-MEM: Agentic Memory for LLM Agents" [2502.12110], it combines Zettelkasten-inspired note organization with LLM-driven decisions about which memories should be connected and how historical memories should evolve as new information arrives. The resulting memory substrate is an evolving directed graph of notes whose nodes contain original interaction content together with LLM-generated semantic attributes, and whose edges encode contextually meaningful relations.

## 1. Origins, objective, and conceptual basis

A-Mem was proposed to address a limitation in existing memory systems for LLM agents: they enable storage and retrieval, but lack sophisticated memory organization, and their fixed operations and structures limit adaptability across diverse tasks [2502.12110]. The system is explicitly framed as an *agentic memory* architecture, meaning that the memory layer itself performs autonomous organization decisions at write time rather than acting only as an external retrieval backend.

Its design is grounded in three principles drawn from the Zettelkasten method: atomicity, flexible context-driven linking, and continuous evolution of notes as new connections emerge [2502.12110]. In A-Mem, atomicity is instantiated as “one idea per note,” while linking and evolution are delegated to the LLM. This differs from classical keyword-centric indexing schemes because A-Mem does not rely on an explicit weighting rule such as TF–IDF; instead, it instructs the LLM to identify salient keywords in order of importance.

The system’s central unit is the note
$$
m_i = \{c_i, t_i, K_i, G_i, X_i, e_i, L_i\},
$$
where \(c_i\) is the original content, \(t_i\) is the timestamp, \(K_i\) the keywords, \(G_i\) the categorical tags, \(X_i\) the contextual description, \(e_i \in \mathbb{R}^d\) the dense embedding of the concatenated note representation, and \(L_i\) the set of linked memory IDs [2502.12110]. This formulation makes A-Mem both a semantic memory store and a graph-construction process.

A plausible implication is that A-Mem is intended to move memory management from static retrieval toward continual representational restructuring. The paper states this in operational terms through dynamic indexing, link generation, and memory evolution rather than through a separate theoretical formalism.

## 2. System organization and note representation

A-Mem is organized into four core modules: Note Construction, Dynamic Indexer & Retriever, Link Generation, and Memory Evolution [2502.12110]. These modules run automatically whenever the agent writes a new memory or issues a retrieval query. A fifth, read-only retrieval path is used at query time: given a query embedding \(e_q\), the Dynamic Indexer retrieves the top-\(k\) matches in the memory set \(\mathcal{M}\), which are then passed to the agent for prompt augmentation.

The overall architecture is centered on the memory set
$$
\mathcal{M} = \{m_j\}.
$$
When a new interaction \(q\) produces a new memory, Note Construction creates
$$
m_n = \{c_n, t_n, K_n, G_n, X_n, e_n, L_n\}.
$$
The Dynamic Indexer then retrieves semantically nearby memories, the Link Generation module determines whether links should be established, and the Memory Evolution module may update historical notes in light of the new note [2502.12110].

The semantic representation is constructed as
$$
e_i = f_{\mathrm{enc}}([c_i; K_i; G_i; X_i]),
$$
or equivalently as the embedding of \(\mathrm{concat}(c_i, K_i, G_i, X_i)\) [2502.12110]. Because the embedding is derived from both raw content and LLM-generated attributes, retrieval is not restricted to lexical overlap in the original interaction text. The note therefore functions as a structured semantic capsule rather than as an unprocessed transcript fragment.

The system description emphasizes that the semantic attributes are all LLM-generated. Keywords, tags, and the one-sentence contextual description are produced through prompt \(P_{s1}\), and the paper notes that no explicit weighting formula is used. This places a substantial part of the memory representation under generative control rather than under a fixed symbolic pipeline.

## 3. Note creation, indexing, and retrieval mechanics

Whenever the agent produces new interaction content \(c_n\), A-Mem performs note construction through a fixed sequence [2502.12110]:

```text
Input: new content cₙ, timestamp tₙ, prompt template P_s1
1. (Kₙ, Gₙ, Xₙ) ← LLM(cₙ ∥ tₙ ∥ P_s1)
2. eₙ ← f_enc(concat(cₙ,Kₙ,Gₙ,Xₙ))
3. Lₙ ← ∅
4. mₙ ← {cₙ, tₙ, Kₙ, Gₙ, Xₙ, eₙ, Lₙ}
5. 𝓜 ← 𝓜 ∪ {mₙ}
Output: mₙ
```

This write path establishes that a newly created note initially has no links. Link structure is added only after semantic comparison with existing memories. The paper’s notation makes note creation an explicit precondition for graph construction rather than combining both into a single opaque write operation.

Indexing is defined as a function
$$
I : \mathcal{M} \times \mathbb{R}^d \to 2^{\mathcal{M}}
$$
with
$$
I(\mathcal{M}, e) = \{ m_j \in \mathcal{M} \mid \mathrm{rank}_j(s(e,e_j)) \le k \},
$$
where
$$
s(u,v) = \cos(u,v) = \frac{u \cdot v}{\|u\| \|v\|}.
$$
At write time, the new embedding \(e_n\) is used to retrieve a candidate neighborhood
$$
M_{\mathrm{near}}^n = I(\mathcal{M}\setminus\{m_n\}, e_n),
$$
while at read time the query embedding \(e_q\) retrieves
$$
M_{\mathrm{retrieved}} = I(\mathcal{M}, e_q)
$$
[2502.12110].

The retrieval mechanism is therefore top-\(k\) cosine similarity over the note embeddings. The paper further reports a scaling analysis in which retrieval time grows from \(0.31\,\mu s\) at \(1\)K memories to \(3.70\,\mu s\) at \(1\)M memories, while space remains \(O(N)\), identical to other vector stores [2502.12110]. Because the article’s evidence is limited to the reported empirical scaling, any stronger claim about asymptotic implementation efficiency beyond the stated \(O(N)\) storage should be treated cautiously.

The hyperparameter \(k\) is examined over \(k \in \{10,20,30,40,50\}\). Performance rises up to approximately \(k \approx 30\)–\(40\) and then plateaus, especially in multi-hop tasks [2502.12110]. This suggests that A-Mem’s gains are not simply a function of retrieving more memories; they depend on the structure and evolution of the retrieved note set.

## 4. Link generation and memory evolution

The transition from a vector store to an agentic memory graph occurs through Link Generation and Memory Evolution. For a new memory \(m_n\), A-Mem computes pairwise similarities
$$
s_{n,j} = \cos(e_n, e_j)
$$
for each \(m_j \in M_{\mathrm{near}}^n\), then uses an LLM prompt \(P_{s2}\) to decide which candidate memories should be linked [2502.12110].

The link-generation procedure is specified as follows:

```text
Input: new note mₙ, M_{near}ⁿ, prompt P_s2
1. Lₙ_candidate ← LLM(mₙ ∥ M_{near}ⁿ ∥ P_s2)
2. Lₙ ← parse_links(Lₙ_candidate)
3. mₙ.L ← Lₙ
4. for each m_j in Lₙ:  m_j.L ← m_j.L ∪ {mₙ.id}
```

The LLM therefore acts as a zero-shot policy for deciding whether semantic proximity should become an explicit graph edge. The decision criterion is described in terms of shared context, keywords, and tags, rather than as a fixed threshold on cosine similarity [2502.12110]. This is important because the top-\(k\) candidate set is only a retrieval prior; semantic adjacency in the graph is resolved by the LLM.

Memory Evolution extends this further. Whenever a new memory \(m_n\) is linked to existing notes, each linked historical note \(m_j \in M_{\mathrm{near}}^n \cap L_n\) may be revised by invoking
$$
m_j^* \leftarrow \mathrm{LLM}(m_n \,\|\, (M_{\mathrm{near}}^n \setminus \{m_j\}) \,\|\, m_j \,\|\, P_{s3}),
$$
and then replacing \(m_j\) with the evolved \(m_j^*\) [2502.12110]. The paper writes this abstractly as
$$
m_j^* = \mathrm{EvolveLLM}(m_n, M_{\mathrm{near}}^n\setminus\{m_j\}, m_j).
$$

The evolved note may modify \(X_j\), \(K_j\), \(G_j\), and even \(e_j\) through re-encoding. Over time, this produces an evolving directed graph of notes [2502.12110]. The paper does not prove convergence, but reports that the clustering of embeddings stabilizes empirically, with t-SNE plots showing coherent clusters. A plausible interpretation is that A-Mem treats memory not as an immutable log but as a revisable semantic graph whose node representations absorb later context.

This revisability is the defining distinction between A-Mem and a standard retrieval-augmented note archive. In A-Mem, graph structure is not only accumulated; it can recursively change the meaning-bearing fields of earlier notes.

## 5. Agentic operation and experimental characterization

The paper identifies three points at which A-Mem exhibits agency: write time, link decision, and evolution decision [2502.12110]. At write time, the agent autonomously decides to call the note constructor, dynamic indexer, link generator, and evolution engine. Link decisions are made through prompt \(P_{s2}\), and evolution decisions through prompt \(P_{s3}\). No external RL algorithm is used; all decision-making is routed through LLM prompts, and the system is described as task-agnostic and fully flexible.

Evaluation is reported on two datasets. LoCoMo contains 7,512 QA pairs from long 9K-token dialogues, split into single-hop, multi-hop, temporal, open-domain, and adversarial categories. DialSim contains 1,300 multi-party sessions, approximately 350K tokens, with more than 1,000 QA per session [2502.12110]. Six foundation models are used: GPT-4o-mini, GPT-4o, Qwen2.5-1.5B, Qwen2.5-3B, Llama 3.2-1B, and Llama 3.2-3B.

The baselines listed for LoCoMo are LoCoMo (no memory), ReadAgent, MemoryBank, and MemGPT, and the metrics are F1, BLEU-1, ROUGE-L, ROUGE-2, METEOR, and SBERT Similarity [2502.12110]. For GPT-4o-mini on LoCoMo QA, the reported excerpt is as follows.

| Method | Single F1 / BLEU | Multi F1 / BLEU | Temporal F1 / BLEU |
|---|---:|---:|---:|
| LoCoMo | 25.02 / 19.75 | 18.41 / 14.77 | 12.04 / 11.16 |
| ReadAgent | 9.15 / 6.48 | 12.60 / 8.87 | 5.31 / 5.12 |
| MemoryBank | 5.00 / 4.77 | 9.68 / 6.99 | 5.56 / 5.94 |
| MemGPT | 26.65 / 17.72 | 25.52 / 19.44 | 9.15 / 7.44 |
| A-Mem | **27.02 / 20.09** | **45.85 / 36.67** | **12.14 / 12.00** |

The same result table also reports Open and Adversarial performance for GPT-4o-mini: A-Mem achieves **44.65 / 37.06** on Open and **50.03 / 49.47** on Adversarial, outperforming the listed baselines in that excerpt [2502.12110]. The paper summarizes the main empirical pattern as “superior improvement against existing SOTA baselines” across six foundation models.

The ablation study isolates Link Generation and Memory Evolution. On GPT-4o-mini, removing both yields markedly lower performance than the full model, and removing only Memory Evolution remains below the full system across all reported categories [2502.12110]. The paper’s stated insight is that agentic memory, understood as autonomous linking and evolution, yields \(2\times\)–\(6\times\) improvements on multi-hop reasoning.

Cost and efficiency are also reported. A-Mem uses approximately 1,200–2,500 tokens per operation, versus approximately 16,900 tokens for baselines, and latency is reported as 5.4 s for GPT-4o-mini and 1.1 s for Llama 3.2-1B on GPU [2502.12110]. The paper characterizes this as significant token savings of 85–93% with selective top-\(k\) retrieval.

## 6. Relation to subsequent memory frameworks, limitations, and interpretation

A-Mem occupies an identifiable position in the later agentic-memory literature. In "All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolution" [2603.19595], A-Mem appears as a baseline on LoCoMo and LongMemEval-s. The reported table gives A-Mem the following values: on LoCoMo, \(40.7 / 34.6 / 31.9 / 28.8\) for 4-option-Judgment, F1, R@5, and N@5; on LongMemEval-s, \(50.4 / 30.8 / 81.4 / 78.2\) on the same metrics [2603.19595]. All-Mem differs architecturally by adopting an online/offline lifelong-memory framework with non-destructive consolidation and a topology-structured memory bank, which suggests that later work treated A-Mem as an important earlier formulation of agentic memory but sought stronger long-horizon maintenance guarantees.

A-Mem is also conceptually adjacent to "AdaMEM: Test-Time Adaptive Memory for Language Agents" [2606.05684], which addresses adaptation during unfolding tasks through long-term trajectory memory and dynamic short-term strategy memory rather than through evolving note graphs. This suggests that the term *agentic memory* subsequently broadened to include multiple mechanisms: graph-structured note evolution in A-Mem, topology consolidation in All-Mem, and adaptive strategy synthesis in AdaMEM.

The limitations explicitly stated for A-Mem are threefold: the quality of memory attributes depends on the underlying LLM’s generative capacity; the current focus is text-only; and there is no formal convergence proof for memory evolution [2502.12110]. These limitations are structurally significant. Dependence on LLM attribute generation means that failure modes in keyword extraction, tagging, or contextual description propagate directly into both embedding quality and link formation. The text-only restriction leaves multimodal extension as open work. The absence of convergence analysis means that the long-term behavior of iterative note revision remains empirically characterized rather than theoretically guaranteed.

A common misconception would be to treat A-Mem as merely a vector database with extra metadata. The paper’s description does not support that reduction. Its distinctive mechanism is the coupling of semantic retrieval with LLM-mediated link creation and historical note revision, producing an evolving directed graph rather than a fixed retrieval index [2502.12110]. Another plausible misconception is to equate its “agentic” character with RL-based policy learning. The paper explicitly states that no external RL algorithm is used; the system’s decisions are prompt-driven.

Taken together, A-Mem can be understood as an early formalization of agentic memory in which memory organization itself becomes part of the agent’s reasoning infrastructure. Its main technical claim is not only that memories can be retrieved efficiently, but that they can be reorganized and semantically rewritten as new interactions accumulate, thereby supporting more adaptive and context-aware memory management [2502.12110].

Source: https://www.emergentmind.com/topics/a-mem-f532202f-4731-460c-a380-ab9ea511602c