Skip to content

Chapter 1 — Why Memory Became a First-Class Primitive ​

A customer-service Agent that had been live for eight months one day began recommending discontinued products to long-standing customers. Diagnosis took two days, and the conclusion was neither model degradation nor a broken prompt, but a data migration three months earlier that had written the memory "unsubscribed" into the wrong namespace. The Agent had not forgotten; it remembered in the wrong place. And nowhere in the system could have told the operator at write time that "this memory entered the wrong store."

The shape of such incidents is fixed: there is nothing wrong with model capability, and the engineering chain is not broken either; the problem is that the memory layer lacks its own definition of correctness. The context window, session state, and retrieval results are all handled as "part of the model input," so no one is responsible for "whether this memory should exist, where it should exist, and whether it still holds."

For the past two years, memory has been repeatedly discussed as an "enhancement." Enhancement means: better with it, still works without it. That positioning holds in short-session, low-risk scenarios; once an Agent begins to carry tasks that span days and weeks, it no longer holds. Task continuity depends on memory, cost control depends on memory, compliance auditing depends on memory — and not one of these three can be "better with it."

The judgment this chapter establishes is: memory is already a first-class primitive; it is simultaneously an input to context, a state of the runtime, and evidence for governance. These three identities each carry independent correctness requirements, and collapsing them into "a piece of stored text" is the shared root cause of most current memory incidents. This chapter first reviews the real forms of memory failure, then decomposes the three identities, then presents the three pairs of fundamental contradictions still unresolved in 2026, and finally delineates the capability boundaries of memory systems.

1.1 From Context to Memory: A Post-Mortem of One Failure ​

1.1.1 A Larger Context Window Did Not Solve the Problem ​

A common inference runs: since the model's context can already hold hundreds of thousands of tokens, just stuff all the historical conversation in and the memory problem disappears. This inference breaks in two places.

The first break is cost. Full-context injection means re-billing the entire history on every call. A set of comparative figures Mem0 published in 2026: its retrieval-based approach uses about 6,900 tokens per call, while the full-context approach exceeds 25,000 tokens. The difference is not a few times over but an order of magnitude; in scenarios with thousands of daily active users, that difference directly determines whether a product can be priced at all.

The second break is signal-to-noise ratio. The LongMemEval paper (arXiv:2410.10813) reports a more troublesome phenomenon: commercial chat assistants and long-context models show roughly a 30% drop in accuracy on memory-type questions during sustained interaction. Note that this is not "failing to remember" but "the more it remembers, the more likely it retrieves the wrong thing" — when the history contains both "I am allergic to peanuts" and "I ate peanuts yesterday with no problem," putting both into context does not make the model smarter, only more hesitant.

The context window therefore solves "how much can be held," while a memory system solves "which one should be fetched." The two are not substitutes.

1.1.2 Three Things Called "Remembering" That Get Conflated ​

"Remembering" in an engineering context refers to at least three different things, and their correctness criteria are entirely different.

Remembering within a session: within the same task, the model needs to know what it just did. This is carried by context and runtime state; the failure mode is "forgot the previous step," and the remedy is externalized state and checkpoints.

Remembering across sessions: when the next conversation begins, the system needs to know where the last one left off and what the user's preferences are. This is carried by long-term memory; the failure mode is "having to introduce yourself every time," and the remedy is the write and recall pipeline.

Remembering at the organizational level: multiple Agents, multiple users, and multiple teams share the same set of facts. This is carried by the semantic layer and governance mechanisms; the failure mode is "the same customer has two different states in two systems," and the remedy is scope isolation and conflict resolution.

All three share the word "memory," but merging their implementations into one component produces incidents like the one at the start of 1.1: session state, user preferences, and business facts mixed in one table, with no one able to say what the authoritative source of a given record is.

1.1.3 Four Typical Forms of Failure ​

Classifying publicly reported memory incidents of the past two years, the forms converge to four.

Failure formManifestationRoot causeObservable signal
Remembered in the wrong placeThe memory exists, but lands in the wrong scopeScope implemented as a shared table plus filter conditionsCross-tenant read test fails
Remembered what should not be rememberedCredentials, privacy, retracted preferences remain in the storeNo admission check before writeSensitivity scan hits
Did not forget what should be forgottenOld facts keep interfering with new judgmentsAppend-only, with no invalidation mechanismTemporal conflict rate rises
Forgot but cannot prove itSource record deleted, derived conclusions remainDeletion performs only the first layerCascade dependencies not cleared

Table 1-1 — Four failure modes of memory and their observable signals

The value of this table is that the four forms correspond to four completely different mechanisms, yet they are often promised wholesale by the same "memory module." If a vendor can only articulate "we support CRUD," then at least two of these four forms are unaddressed.

1.1.4 Why It Only Became a Problem Now ​

Three conditions matured simultaneously, pushing memory from "enhancement" to "necessity."

The first is that task time spans grew longer. Coding Agents proved this first: a single refactor may span hours, dozens of model calls, and hundreds of files, and the task must continue after the instance is replaced. At that point "remembering" is no longer an experience optimization but a precondition for correctness.

The second is that multi-Agent collaboration became routine. When a work assistant, a personal assistant, and a health advisor share the same user, who has the right to write, who has the right to delete, and how conflicts are arbitrated become questions that must be answered at the architecture level.

The third is that compliance requirements became concrete. The right to erasure, data residency, and auditability moved from "best practice" to contract clause — and all three happen to require the memory system to produce evidence rather than produce logs.

1.2 The Three Identities of Memory ​

1.2.1 As an Input to Context ​

This is the most familiar identity: memory is recalled, ranked, and trimmed, and finally becomes part of the prompt. The core metrics here are information density per token and the relevance floor.

Two counterintuitive engineering conclusions follow.

First, recalling more does not equal better results. As the number of returned items rises from 5 to 20, hit rate may increase, but answer quality often declines — the model's attention naturally decays across the middle of a long context, and irrelevant items dilute the genuinely relevant one. This is why mature memory systems set a relevance floor: better to return nothing than to return noise.

Second, truncation is worse than not returning. Cut the back half off a sentence and its meaning may invert; the model will not tell you it read half a sentence. Budget control must therefore drop by complete unit, not truncate by character count. Mnemosyne's profile_card turns this into a hard constraint: when max_tokens is exceeded it drops whole tiers (situation → open → preferences) and never truncates mid-sentence. This design looks like a detail but in practice determines whether the injected content can be trusted.

1.2.2 As Runtime State ​

The second identity of memory is easily overlooked: it is the factual basis on which a task can be resumed. Which step the task has reached, which external calls have taken effect, who should execute next — these are not "conversation content" but state facts.

Storing them as retrievable text immediately runs into three problems: lost ordering (you do not know which came first), lost atomicity (one state change split into two records), and lost idempotency (an external action executed twice on retry). This is why runtime state and long-term memory must be carried separately: the former requires strict ordering and transactions, the latter requires retrievability and forgettability.

1.2.3 As Evidence for Governance ​

The third identity is the object of audit. When an Agent makes a decision that affects a user, the enterprise needs to answer: which memory was it based on, where did that memory come from, who changed it, and is it still valid now.

There is a boundary here that must be stated clearly: a hash chain can prove "not tampered with," but cannot prove "no longer exists." The former is an integrity problem, the latter a deletion problem, and the two require different mechanisms. Systems that conflate them can usually only supply the former during compliance review, and then fill the latter with the verbal promise "we deleted it."

1.2.4 Why the Three Identities Cannot Be Merged ​

The temptation to merge comes from implementation simplicity: one table, one retrieval interface, one permission set. The cost is that three sets of correctness requirements compromise each other.

Context requires "trim by relevance," runtime state requires "complete and ordered," governance requires "immutable as evidence." When all three share one store, trimming breaks completeness, immutability obstructs invalidation, and ordering is scrambled by retrieval ranking. Mnemosyne's choice is to split by file at the storage layer and split by tool at the interface layer: recall serves injection, task_record serves state, and audit / memory_trace serve evidence. The cost is that callers must understand three semantics, and the learning curve is steeper than "one search interface."

1.3 Three Pairs of Fundamental Contradictions in 2026 ​

1.3.1 Writing Versus Forgetting ​

The first-order problem: when a new fact arrives, what happens to the old one. Three constraints pull against each other — facts must not be lost, cost must not spiral, and users must be able to overrule.

In 2026 a convergence worth recording occurred. Mem0 changed its write pipeline that year to single-pass ADD-only extraction: one model call, only adds, never overwrites or deletes; the vendor states extraction is roughly twice as fast as before and history is fully preserved. Mnemosyne has been single-pass ADD-only since its first version.

The significance of this convergence needs to be stated plainly: "add-only, never modify" is no longer a differentiating selling point but an industry consensus. The reason it was adopted is also clear — with no rewrite operation at all, a bad extraction at worst introduces noise and never destroys a true fact. For a memory system, this floor matters more than the ceiling.

But it simultaneously shows something else: since the direction has been adopted by the mainstream, "we are ADD-only too" cannot by itself justify a selection. The real differentiation shifts to downstream questions — how storage avoids monotonically bloating, how old and new conflicts are adjudicated, and how deletion is made verifiable.

The cost of ADD-only is explicit: storage grows monotonically, and tiering (hot / warm / cold) plus lossless compression must be used to manage cost. Mnemosyne's approach compresses a memory into "pointer + structured facts + content atoms," with numbers, dates, amounts, and model numbers preserved intact at any level, and expand() can restore the original byte-for-byte and verify its hash. The cost is one extra computation each for compression and expansion, and a compression ratio that depends on content structure — for conversations with little structure, the compression gain is limited.

1.3.2 Recall Versus Precision ​

The second problem: how much to return, and which item to return. This contradiction is the one most easily masked by benchmark scores in 2026.

The difficulty at the benchmark level is real: no two vendors' scores are directly comparable. Dataset version, judge implementation, prompt template, number of retrieval rounds — any single difference can produce a gap of a dozen points. LongMemEval's reported "roughly 30% accuracy drop during sustained interaction" points to a more fundamental problem: high scores on short conversations may collapse systematically over long-period use.

The engineering-level judgment is clearer by contrast: precision takes priority over recall. Recalling a wrong or outdated memory harms user experience more than having no memory at all; and "no memory" is at least honest. This is a product decision, not an engineering one, because it determines the system's default behavior under uncertainty — better to say "I don't know" than to confidently cite a preference from three months ago.

1.3.3 Autonomy Versus Controllability ​

The third problem: who decides what to remember and what to forget.

One route hands decision authority to the Agent itself: memory blocks are edited autonomously by the model through tool calls, and the system only provides pagination and retrieval. The benefit is flexibility — the Agent can organize its own memory according to task needs; the cost is a black-box decision process — when the Agent produces a bad summary or archive, diagnosing "where did that context go" requires tracing layer by layer.

The other route keeps decision authority with the caller: every write is triggered by an explicit tool call, every operation is recorded in the audit ledger, and every conclusion can be traced back along the pointer chain. The benefit is explainability and auditability; the cost is that the caller bears responsibility for designing memory strategy, and the Agent cannot adaptively organize its own memory.

This is not a question of right versus wrong but of scenario fit. In personal assistants and research-oriented Agents, flexibility outranks auditability; in enterprise processes and compliance-sensitive scenarios, one unexplainable memory is one audit risk.

1.3.4 The Common Structure of the Three Contradictions ​

The three contradictions share a common structure: each is a trade-off between a "safety floor" and an "experience ceiling." ADD-only protects the floor while decay strategies contest the ceiling; precision-first protects the floor while recall-first contests the ceiling; explicit writing protects the floor while autonomous editing contests the ceiling.

This means there is no "universally superior" system. The right question in selection is not "which is stronger" but "in my scenario, which side's floor is the one I cannot breach." Chapter 21 expands this question into a decision tree.

1.4 The Capability Boundaries of Memory Systems ​

1.4.1 What It Can Do ​

Stating the boundaries clearly is more useful than listing features. In 2026 a mature memory system can reliably:

  • complete writing and recall with no external dependencies (the built-in extractor and deterministic embedder can work offline)
  • physically isolate data by scope, so that cross-tenant leakage does not depend on "getting the filter condition right"
  • fuse multiple signal channels for recall, and degrade to lexical retrieval when the embedding service is unavailable
  • prove with a hash chain that audit records have not been tampered with, and locate exactly which one
  • handle four layers with cascade delete: source record, derived conclusions, cache, and dependent summaries
  • reduce storage cost with lossless compression while preserving key atoms such as numbers, dates, and amounts
  • reduce injection cost from O(everything) to O(catalog + a few expansions) through progressive disclosure

These capabilities share one feature: all of them can be verified. Verification means running scripts, inspecting return values, and conducting controlled experiments — not reading documentation.

1.4.2 What It Cannot Do ​

The other side matters equally. As of October 2026, no system has solved the following in production:

  • Cross-verification of facts. When a user says "I am allergic to peanuts" but medical records show otherwise, the system cannot automatically adjudicate which to believe. Every system defaults to "what the user said is the fact that gets remembered."
  • Conflict arbitration for cross-Agent shared memory. Physical isolation supports "not sharing"; sharing requires building a permission model on top, and the complexity of that permission model explodes with the number of Agents.
  • Verifiability of deletion. It can prove "not tampered with" but cannot prove "no longer exists," and there is no standardized audit format.
  • Behavior quality when users actively manage memory. Existing benchmarks all measure passive retrieval; no benchmark measures the system's response quality when a user edits, deletes, or rephrases a memory.
  • Cross-system cost-quality curves. There is no public data, so selection can only rely on experience.

Placing these two lists side by side yields an uncomfortable but necessary conclusion: the current capabilities of memory systems cluster in the first half (write, storage, retrieval, audit), while the second half (adjudication, sharing, proof, cost) is essentially blank. Any claim to "solve the memory problem end to end" has made promises on that second half that exceed the facts.

1.5 Chapter Summary ​

This chapter established four judgments.

First, memory is already a first-class primitive, not an enhancement. It is simultaneously an input to context, a state of the runtime, and evidence for governance, and the three identities each carry independent correctness requirements. Merging them into "a piece of stored text" is the shared root cause of most current memory incidents — remembered in the wrong place, remembered what should not be remembered, did not forget what should be forgotten, forgot but cannot prove it; four forms corresponding to four different mechanisms.

Second, a larger context window does not weaken the necessity of a memory system. The context window solves "how much can be held"; a memory system solves "which one should be fetched." Full-context injection is off by an order of magnitude on cost, and lowers accuracy on signal-to-noise ratio because history contradicts itself; the roughly 30% drop reported by LongMemEval is exactly how this mechanism manifests.

Third, the three contradictions of 2026 have partially converged, but convergence is not resolution. ADD-only becoming industry consensus shows that the floor of "do not destroy facts" is widely accepted; the cost is monotonically growing storage and conflict adjudication pushed downstream. Precision-first over recall has become engineering consensus, at the cost that systems must dare to say "I don't know." The autonomy-versus-controllability trade-off still differentiates by scenario, with no unified answer.

Fourth, the capability boundaries of memory systems must be stated explicitly. Writing, storage, retrieval, and auditing are already verifiable; fact adjudication, cross-Agent sharing, deletion proof, and cost curves remain blank. If a vendor gives an affirmative promise on these four during selection, demand recomputable evidence rather than accepting the phrasing.

These four judgments leave one concrete question: since the three identities cannot be merged, into which responsibility domains should a memory system be divided, and what guarantee does each carry? That is the architectural question Chapter 2 answers.


Copyright © 2026 胡景堃(Hu Jingkun). 采用 CC BY-NC-ND 4.0 许可。未经授权禁止传播、复制或用于商业化。