---
title: "MNEMOSYNE: One Check on Every Memory Write"
author: "Oscar Serra · Independent Research"
date: "12 October 2026"
version: "2.0"
---

## Abstract

Think of a good assistant's notebook. When your weekly call moves to Thursday, she does not tear out the page that said Wednesday. She strikes the line, writes Thursday beneath it with the date and who told her, and if the new note clashes with something pinned to the first page, she asks you before she writes. Years later the notebook is still worth trusting, because every line says where it came from and nothing was overwritten behind your back.

AI agents now keep notebooks of their own: memory files they write with ordinary file tools, in the middle of a conversation, during a nightly pass, or because another agent told them to. But most memory systems check a new memory only against the few stored memories that look most like it, delete what it contradicts, and keep no note of where a fact came from. So an old line in a file the agent reads on every turn can override a rule kept in another file, a guess comes back weeks later as if it had been observed, and a rule that retires old facts by their position in a file can hide facts that never changed.

We propose MNEMOSYNE, one check on every write to an agent's long-term memory, placed inside the tool that performs the write so that no writer can skip it. The check compares the new text with the facts on the same topic, with the rules the agent loads on every turn, and with what the current turn observed. A small model names the relation, and only that judgement can retire an old fact: the old line is struck through and kept, with two dates, one for when the change became true and one for when the agent learned it. Every fact carries its source (observed, told by the owner, inferred, assumed, or taken from untrusted content) and never an author. Before the check comes the choice of what to write: a live turn writes at once what the owner states and what contradicts the store, and a nightly pass picks the rest out of the day's session record.

In your own assistant, a correction made once stays made, a rule pinned to the first page beats an old note, a sentence lifted from a web page cannot become a standing instruction, and you can still ask what was true last month. The check costs one call to a small model; at published prices it pays for itself in money alone once about one write in sixty would have misled a single turn. This is a design, and §12 names the tests that would prove it.

If it holds, an agent's memory becomes something you can audit like a notebook and trust like one.

## 1. Introduction

An agent that serves one person for months learns things the way an assistant does: the person says something once and expects it to stick. The meeting moved. The supplier prefers calls before noon. Replies go out in the language the owner wrote in. The agent writes these down, and on a later day it reads them back and acts on them. Every serious agent harness now has some version of this. Anthropic's memory tool gives the model a directory of files it can create and edit (Anthropic, 2025); Letta gives it blocks of always-present text it rewrites itself (Packer et al., 2023); Mem0 and Zep extract facts from the conversation and store them in a database or a graph (Chhikara et al., 2025; Rasmussen et al., 2025).

And the hard part of memory, it turns out, is not storing. Disks are cheap and a full session record can be kept word for word. The hard part is that the memory store is written by many hands at many moments, and a single careless write can poison every turn that follows. Four failures recur in practice, and each one shaped a choice in this paper.

*A write that contradicts a rule in another file.* A line in the index file, written months ago, restates one of the owner's preferences in shorthand. Later the owner refines the preference, and the agent records the new version in the rules file it loads on every turn. The old line in the index file is never touched, and the index file is loaded on every turn too. Now two always-present texts disagree, and the agent follows whichever one it weighs more on that turn. A check that compares a new write with the nearest stored memories does not catch this, because the two lines sit in different files, were written months apart, and use different words.

*A fact that has forgotten where it came from.* The agent runs one query, gets nothing back, and concludes that a certain kind of item does not exist. It writes that conclusion down as a fact. Weeks later it reads the fact back and repeats the negative to the owner several times in one session, each time with the confidence of something it had seen. The stored line never said "inferred from one empty query", so nothing told the reader to look again. Zhan et al. (2026) measured the same failure across seven memory systems and named it authority collapse: consolidation keeps the claim and drops the conditions under which it may be used.

*A retire rule with no judge.* A system that keeps history marks old facts as superseded when a new one replaces them. If it decides "replaced" by position (same file, same line range, new text), then two fragments of one long note that inherit the same position will retire each other in a single pass, although neither fact changed. Nothing counts these closures, so the store hides text that is still true, for weeks, and nobody is told.

*A correction written beside the error.* When a stored fact turns out wrong, the easy edit is to append a note below it: "this is wrong, see below". The wrong line is still there, still reads as a plain statement, and an agent that reads only the first match picks it up again.

But none of these is exotic, and none is fixed by a better retriever. They happen at the moment of writing. They are hard for four reasons. The writers are many: a live turn, a nightly pass, the owner editing a file by hand, other agents. The contradictions that hurt are between files and against standing rules, not between near neighbours in an embedding space. Deleting the old version destroys the history that would explain what happened. And judging whether two sentences conflict takes language understanding, which costs money and time on every write.

Therefore we propose to put one check on every write. *The claim of this paper, in one sentence: an agent's long-term memory stays trustworthy if every write passes a single check inside the write tool that compares it with the same-topic facts, the always-loaded rules and the current turn's observations, stamps it with its source and two dates, and lets only a judge retire an old fact, which is struck through and kept.*

The contributions, each pointing to the section that argues it:

1. *A selection step* that says what a live turn writes at once and what the nightly pass picks out of the day's session record, each candidate tied to the record entries it rests on (§4).
2. *A gate in the write path* that every writer passes, with a receipt for every check, so the gate's health is read from counts and never from a switch that says "on" (§5).
3. *A comparison set built from the always-loaded files, the same-topic facts and the turn's own observations*, judged by a small model into a closed set of relations and outcomes (§6).
4. *Supersede by judgement only*, at the level of a fact line, with event time separated from ingestion time, an alarm on suspicious closures, and history kept in the file so that no re-index can lose it (§7).
5. *Source and date on every fact, never an author*, with the source class deciding what a fact may become (§8).
6. *A file shape* that makes the check cheap and the store easy to read: one fact per line, one topic per file, an index file that holds pointers only, use keys written with the fact, and edits as deltas (§9).
7. *A cost model* in the series' notation, showing the check pays for itself at a low error rate if, and only if, the judge is a small model (§10).

This paper is a design for the next build; it reports no results, and §12 names the tests that would decide each claim. The name MNEMOSYNE, the Greek personification of memory and mother of the Muses, is a handle and not an anchor: what matters is what the mechanism lets an agent do.

## 2. Where this sits

This is one of four designs for an agent's memory: keeping (J1), writing (J14), finding (J2), learning (J5). J1 decides what survives the context window and keeps the full session record as ground truth. J2 decides how the right fact is found fast. J5 turns repeated experience into rules and promotes them up a ladder from text to code. This paper owns the moment in between: what enters long-term memory, starting with the choice to write at all, in what shape, and under which checks. It checks what the other stages hand it, records what it did, and points to them wherever their ground begins.

Several systems already act at write time. We keep what works in each and say what we change.

*Mem0* (Chhikara et al., 2025) extracts candidate facts from each exchange, retrieves the most similar stored memories by embedding, and asks a model to choose one of four operations: add, update, delete or do nothing. Its graph variant marks contradicted relationships invalid instead of removing them. We keep the core move, a model that compares a candidate with what is stored and picks from a closed set. We change two things. The comparison set adds the always-loaded rules and the turn's observations to the nearest neighbours, because the contradictions that hurt most are not near neighbours (§6). And delete becomes supersede, struck and kept, for the plain-text store as well as the graph (§7). We also do not extract from every exchange; §4 says what is worth a line.

*Zep and Graphiti* (Rasmussen et al., 2025) store facts as edges in a temporal knowledge graph. A new edge is compared with related edges by a model; a contradicted edge is invalidated, not deleted; and each edge carries both the time the fact held in the world and the time the system ingested it. This is the closest prior work to our supersede step, and we adopt its two clocks outright. We differ in the unit and the store: our fact is a line in a human-readable file, the file is the ground truth, and any database is a cache rebuilt from it (§7.3). We add an alarm on closures and a hold for writes that clash with a standing rule.

*A-MEM* (Xu et al., 2025) builds each new memory as a note with keywords, tags and a context description, links it to related notes, and lets new notes update the descriptions of old ones. We keep the idea that the moment of writing is the moment to add what will help later; our use keys come from the same instinct (§9.4). We decline the automatic rewrite of old notes: a model that rewrites stored text every time something new arrives is a slow way to lose details, and in our design an old fact changes only by being superseded, visibly.

*ROAM* (Zheng et al., 2026) classifies each pair of a new and a stored fact as independent, equivalent, subsuming or conflicting, keeps one primary view and treats the rest as evidence, and reports large accuracy gains over managers that add and rewrite in one step. Its four relations map almost one-to-one onto our judge's outcomes (§6.2). We add two relations ROAM does not need, because its store has no standing rules and no untrusted sources: "clashes with an always-loaded rule" and "comes from untrusted content".

*Authority collapse* (Zhan et al., 2026) is the failure measured by the AuthMem benchmark: consolidation keeps a claim but drops the authority under which it may be reused, so a casual remark becomes a standing instruction. Collapse appeared in 48 of 49 configurations they tested, and persisted authority labels removed the unauthorised actions in their end-to-end test. Our source classes are such labels, and §8 makes them decide what a fact may become.

*Context collapse*, the loss of detail under repeated wholesale rewriting, is covered with its source in J1 §1.3; the gate's answer to it is the delta rule (§9.5).

*File and block tools.* Anthropic's memory tool runs on the client: the model asks for a file operation and the application executes it, which means the application sees every write and can check it (Anthropic, 2025). MemGPT and its successor Letta let the agent edit its own in-context memory blocks, and Letta's sleep-time agents move that editing to a background agent (Packer et al., 2023; sleep-time compute is covered in J5 §2). Both show where writes happen in practice: through tools, in the foreground and in the background. Our gate sits in exactly that tool layer, so it covers both (§5).

*Memory poisoning.* MINJA (Dong et al., 2025) injects malicious records into an agent's memory through ordinary queries and reports high success rates. Our untrusted source class and its ceiling (untrusted content never becomes a rule, §8.1) are the write-side defence.

Each piece of this design has precedent. What we did not find in the systems above is the placement: a check that sits in the file tool and therefore sees every writer, a comparison set that includes the rules the agent reads on every turn, and a retire step that only a judge may take and that is counted and alarmed. The contribution is that combination, aimed at a store people can read.

## 3. The design in one picture

Figure 1 shows the whole path of a write. Four kinds of writer can change memory: a live turn of conversation, the nightly pass that consolidates the day, the owner editing a file by hand, and another agent. Every write goes through one gate. The gate gathers what the write must be compared with, a small model judges the relation, the fact is stamped with its source and dates, and then it is written, with a receipt for the check.

![The life of a memory write. Every writer goes through one gate inside the write tool. The gate compares the write with the facts on the same topic, the always-loaded files and what the current turn observed; a small model names the relation; the fact is stamped with its source and two dates and written to its file, with a pointer in the index file and a receipt for every check. A write that clashes with a rule is held for the owner and written only after the owner answers.](images/fig1-write-gate.png){width=64%}

A few words carry the rest of the paper. A *fact* is one claim about the world, one line in a file. A *rule* is an instruction about behaviour; where it lives is J5's ladder (J5 §5). An *always-loaded file* is one the harness puts in front of the model on every turn. The *memory store* is the set of fact files, read only when something asks for them; it is a separate place from the always-loaded files, as in J5, and the gate guards writes to both. The *index file* is the always-loaded head of the store: one line per topic, naming the file that holds it. The *owner* is the person the agent serves. A *receipt* is the record the gate leaves for each check.

Walk the example from the abstract through it. On 9 March the owner says, in passing, that the weekly call moved to Thursday the day before. The live turn asks the write tool to add a line to the meetings file. The gate finds the meetings file through the index file, reads its lines, reads the rules, and sees that this turn's calendar lookup also shows Thursday. The judge answers: this replaces the line that says Wednesday. The old line is struck through and kept, marked superseded as of 8 March with a pointer to the new line. The new line carries "told by the owner", true since 8 March, learned 9 March. A receipt records the supersede. Nothing was deleted, and a question about last week still has its answer.

## 4. Choosing what to write

The write stage starts before the gate, with the choice to write at all. J1 keeps every session word for word, so a detail left unwritten stays in the record, a search and a read away. A line in the memory store earns its place when it saves a later session that search. In J2's notation, a detail that a later task needs with probability $q$ is worth a line when $q$ times the cost of digging it out of the record (a search and a read, two turns at least, J2 §7.1) exceeds the cost of keeping one line and checking it once (§10). Two kinds of detail pass easily: what the owner states about his world and his preferences, which is needed again almost by definition and cannot be derived from anything else, and observations that took real work to get (where a machine lives, how a problem was solved, what a supplier answered). Two kinds fail: the passing state of the task in hand, and content still on disk, which gets a pointer and never a copy.

### 4.1 What a live turn writes, and when

A live turn writes at once in three cases, because waiting for the night would leave the store wrong for the rest of the day: the owner states a fact or a preference about his world; a tool result disagrees with a stored fact (§8.5); or the turn makes a decision, which is written with its reason. Everything else waits for the nightly pass. A live turn does not extract facts from every exchange, as Mem0 does: each write costs a check, and most exchanges hold nothing a later session needs.

When the owner corrects the agent, J5's cause table sorts the correction first (J5 §3.3). A correction about behaviour becomes a rule in J5's ledger. A correction of a wrong fact has a class of its own there, and it comes here as a supersede of the wrong line (§7.5).

### 4.2 What the nightly pass picks out

The nightly pass reads the day's session records, never the compaction markers, since a summary of a summary has already lost detail (J1 §5.4). A model reads each session and returns candidate fact lines, each with the address of the record entries it rests on (J1 §4.2). A candidate with no address is dropped: a fact the record does not show is a guess. The address stays on the fact as its evidence, and the source class follows the author of those entries (J1 §4.1): an entry the owner wrote gives "told by the owner", a tool result "observed", the agent's own text "inferred", and a web page, a document or another agent's text "untrusted".

The pass looks for four kinds of candidate:

1. facts the owner stated or the agent observed that no live turn wrote down;
2. lines written in a hurry during the day that bundle several claims or sit in the wrong topic file (§9.1, §9.2);
3. lines marked "unchecked" when the judge was down (§5.3), and supersedes left as proposals (§7.2);
4. changes to the layout of the store proposed by J2 (§9.2).

Every candidate is an ordinary write through the gate, so the nightly pass can do nothing the gate does not see. The pass hands its candidates to the gate in event-time order (§7.4) and caps the lines it adds to one topic in a night; candidates past the cap go to the owner as proposals in J5's morning report (J5 §7.4).

## 5. Where the check sits

### 5.1 In the write path, as code

The gate is code, and it sits where every write already passes: the tool that changes a file. Why this is code and not a prompt: J5 §1.2.

Concretely, the gate wraps every tool that can change a file under the memory store or an always-loaded file: create, edit, insert, rename, delete. A shell command can also write a file, and a path guard catches the common forms (redirection, copy, move, in-place edit) aimed at memory paths. Those are refused with a pointer to the file tool, so every write arrives through a tool the gate can read. The same gate serves a client-side memory tool such as Anthropic's, where the application executes each operation itself.

### 5.2 Every writer, one gate

The gate does not care who writes, only what is written. The cases differ in what happens when the check objects.

- *A live turn.* The common case. The check runs before the write lands, and its verdict comes back to the agent as the tool result, so the agent sees "superseded line 4" or "held: clashes with the reply-language rule" and can tell the owner.
- *The nightly pass.* Same check. The pass often handles notes in an order that is not the order in which things happened, which is why the gate orders facts by event time and not by arrival (§7.4).
- *The owner by hand.* The owner is never blocked. A change he makes is checked after it lands, by watching the files, and a clash is reported to him in J5's morning report (J5 §7.4). He may have forgotten the rule he wrote three months ago; he may also mean to change it, and that is his call.
- *Another agent.* A sub-agent or a sibling session writes through the same tools and passes the same check. A write into another agent's memory is also a privacy boundary, so facts of the owner-sensitive classes are scrubbed or refused at that gate.

### 5.3 Fast, and never silent when it fails

The check is synchronous: the write waits for the verdict. The budget is one small-model call, well under a second in normal operation, and a turn makes many tool calls for each memory write, so the delay is a small share of a turn. When the judge cannot answer (a timeout, a provider error, a quota limit), the write goes through with an "unchecked" mark on the line and an "unchecked" receipt, and a sweep checks those lines later. The gate never fails open in silence, and never blocks the agent because a provider is down.

### 5.4 Receipts, and why a zero must mean zero

Every check writes a receipt: which file, which relation the judge named, which outcome was applied, which lines were touched, the judge's confidence and the time it took. Receipts are what the rest of the system reads. The health of the gate is computed from them: writes checked per day, outcomes by kind, holds waiting for the owner, unchecked lines waiting for a sweep, closures split by same-file and cross-file.

An empty table of contradictions must never read as "no contradictions" when it means "nothing was checked": the series-wide zero-means-zero rule (J5 §9.1) applies, so a count of zero checks on a day when the agent wrote memory is an alarm.

## 6. What a write is compared with

### 6.1 Three sources, not the nearest neighbours alone

A candidate fact is compared with three things.

*The facts on the same topic.* The write names its target file, and the index file links that file to its topic. The gate reads the target file and the files the index file lists under the same topic. An embedding search over the whole store adds a few near neighbours as a backstop for a fact written in the wrong place. Topic links come first because they are cheap, exact, and already maintained for reading.

*The always-loaded files.* All of them. Always-loaded files are small by design, since they cost context on every turn, and they are exactly where a contradiction does the most harm: a wrong line there is read on every turn, by every task. This is the source that nearest-neighbour checks miss. A line in the index file and a rule that disagree rarely look alike to an embedding, because one is a terse pointer and the other a sentence of instruction, yet they are about the same behaviour.

*What the current turn observed.* Tool results from the turn that mention the subject of the write. If the agent writes "the store has no items of kind X" in the same turn in which a query returned items of kind X, the gate sees both.

### 6.2 Relations and outcomes

The judge answers with one relation from a closed set, and each relation has one outcome. Table 1 is the whole decision.

| Relation the judge names | Outcome |
|---|---|
| New: nothing stored says this | Add the line, stamped |
| Same: already stored, same meaning | Skip the write; refresh the stored line's "last confirmed" date |
| Adds detail: compatible, more specific | Merge into the existing line; keep one line per fact |
| Replaces: same subject, newer state of the world | Supersede: strike the old line, keep it, point to the new one (§7) |
| Conflicts, unclear which is right | Write the new line beside the old, both marked "in conflict"; ask the owner (J5 §7.4) |
| Clashes with an always-loaded rule | Hold the write; tell the agent and ask the owner (J5 §7.4) |
| Comes from untrusted content and would act as a rule | Store it as a quoted claim with its source; never in an always-loaded file |

: The judge's relations and the gate's outcomes.

Two outcomes stop short of writing. A clash with a rule is held because rules are the owner's: either the new fact is wrong, or the rule is out of date, and only the owner can say which. A conflict with no clear winner is written in both versions because dropping either one loses information; the conflict mark makes the reader see both and look again. Both questions reach the owner through J5's morning report (J5 §7.4), the same approval path as every other change to what every turn loads.

### 6.3 The judge

The judge is a small, fast model that answers only in typed choices: the relation from Table 1, the line it refers to, and a confidence. It writes no free text that the gate must parse. Jev, a small model built to answer in typed choices, is one such judge (TypeSafe AI, 2026); any model that can return a closed choice will do. The instructions it receives describe the relations above, give a few contrasting examples of each, and say what counts as the same subject. The exact wording is kept with the code and changes as the judge improves; the paper does not print it.

Two habits keep the judge honest. First, its thresholds are set on a labelled sample, not on defaults: a confidence cut-off that was never tuned learns nothing from being used, and §12 names the sample. Second, people facts sent to a third-party judge carry opaque identifiers ("P17: good at sourcing specific hardware") and never names or contact details.

### 6.4 The brain does something similar

In the brain, recalling a memory can open it for change, and research on fear memory found that it opens only when the recall brings a surprise: a prediction error, a mismatch between what was expected and what happened (Sevenster et al., 2013). With no mismatch, the memory is read and left alone. The gate makes the same distinction explicit. A write that matches what is stored changes nothing but a date; a write that mismatches is the only kind that can change a stored fact, and the mismatch is named and recorded.

## 7. Retiring a fact without losing it

### 7.1 The unit is the fact line

A fact is retired, never a chunk, a file region or a database row. The reason is the third failure in §1. Any identity based on position (this file, these line numbers) will match pieces that have nothing to do with each other as soon as a long note is split, re-flowed or re-indexed. Facts change because the world changed, and only something that reads the meaning of two lines can tell that the second is a newer state of the first. So the supersede step is an outcome of the judge (§6.2) and nothing else can trigger it.

![Retiring a fact without losing it. Fact A, written on 2 March, holds until the change it describes; fact B, learned on 9 March, has been true since 8 March. A is struck through and kept, superseded as of 8 March, with a pointer to B. A question about now answers B; a question about 5 March still answers A. The triangles mark when each fact was written down, which is a different clock from when its claim became true.](images/fig2-supersede-timeline.png){width=86%}

### 7.2 Only a judge closes, and only when it has earned it

Automatic closing is a privilege the judge earns. Until a hand-audited sample shows that the judge's "replaces" verdicts are right at least nine times in ten, a supersede is written as a proposal: the new line is added, the old line gets a "possibly superseded by" mark, and the owner or the nightly pass confirms it. Once the judge clears that bar, it closes on its own for fact files. A closure that would retire a line in an always-loaded file is held for the owner in every case and put to him in J5's morning report (J5 §7.4).

### 7.3 The mark lives in the file

A retired line stays in place, struck through, followed by one machine-readable tag: superseded, the event date, a pointer to the line that replaced it. One format everywhere, so a person reading the file and a program parsing it see the same thing. Ad hoc markers ("WRONG", "see below", a strike-through with no date) are what a store collects when every writer improvises, and they cannot be counted or queried.

This puts history where it cannot be lost. J2's text index, or any database built over the files, is a cache: it may mirror the validity of each line in two columns for fast filtering, but it can be dropped and rebuilt from the files at any time. A re-index that deletes a file's rows before writing them again loses nothing, because the history was never in the rows. The reverse arrangement, history kept only in the rows of a search index, means that the most ordinary maintenance step erases it.

### 7.4 Two clocks

Every fact carries two dates. *Event time* is when the claim became true in the world: the call moved on 8 March. *Ingestion time* is when the agent learned it: 9 March. The supersede boundary uses event time when the text carries one and ingestion time when it does not.

The two clocks fix an ordering bug that one clock cannot. Suppose the nightly pass processes an old note ("the call is on Wednesday", event time 2 March) after the live turn has already stored the new one (event time 8 March). With ingestion time alone, the old note looks newest and would retire the new fact. With event time, the gate sees that the incoming claim is older than the current one and files it as history, below the current line, already marked superseded. Zep separates the same two timelines for the same reason (Rasmussen et al., 2025).

### 7.5 A correction replaces the line it corrects

When a stored fact proves wrong, the correction is a supersede of that line: struck, kept, pointed to the correct one, with the source of the correction ("observed in a tool result", "told by the owner"). A note appended below an untouched wrong line is refused by the gate as a write, because the judge sees that the new line contradicts the one above it and the outcome for that relation is a supersede, not an append. The agent that reads only the first match then reads a struck line and a pointer, and follows the pointer.

### 7.6 Count every closure, and alarm on the suspicious ones

Every closure writes a receipt (§5.4), and two patterns raise an alarm at their first occurrence. The first is a closure in which the old and new lines come from the same file in the same pass and the judge found no change of meaning: that is the signature of a position-based retire rule, and it should never happen in this design, so any instance means something outside the gate is closing facts. The second is a burst: more closures in a day than a threshold set from the store's normal rate. A burst pauses automatic closing until someone looks. The point of both is that a false closure hides a true fact from every reader, and the only defence that works is to notice it the day it happens.

### 7.7 When deleting is right

Two cases justify removing content: a privacy request (the owner asks to forget something about a person) and poisoned content (a line proved to have been injected). Even then the gate leaves a short tombstone in place of the line, saying that a line was removed, when and why, without the content. The tombstone keeps the file's history honest. It also stays in the comparison set for its topic, so a later write on the same subject is held for the owner instead of slipping back in unnoticed.

A fact file is rarely the only copy. A privacy deletion therefore covers every place the content lives:

- *Fact files and the index file.* The line becomes a tombstone, and a line in the index file that pointed only at the removed content goes too.
- *The session record.* The entries that carry the content are replaced by tombstones at the same addresses, so a pointer into the record resolves to "removed" and never to a neighbour. How a tombstone sits in a record that is otherwise never edited is J1's to state (J1 §4.3).
- *Compaction markers* that quote the content are rebuilt from the record (J1 §5.4), which now holds only the tombstone.
- *J2's text and asset indexes.* They are caches over the files and the record (§7.3), so their rows are dropped and rebuilt from the cleaned sources.

The deletion writes one receipt that lists every place it touched, and it counts as done only when a search of all of them for the removed content comes back empty. Poisoned content is handled differently in one place: the session record keeps the entries, flagged as untrusted, because they are what happened and the evidence of the attack. The fact lines and index rows built from them go.

## 8. Source and date on every fact

### 8.1 Source classes, and what each may become

Every fact carries one of five source classes:

- observed: read from a tool result in the turn that wrote it;
- told by the owner: read only from the owner-words field of the session record (J1 §4.1), so a wrapper or an injected instruction never gets this stamp;
- inferred: concluded by the agent from other facts or observations;
- assumed: taken as true to move on, not checked;
- untrusted: taken from content the owner did not write and the agent did not observe directly: a web page, an email, a document, another agent's text.

The class decides what a fact may become. Only facts told by the owner, or observed and then confirmed by the owner, may enter an always-loaded file as rules. Inferred and assumed facts live in fact files and are labelled as such. Untrusted content can be stored as a quoted claim ("the vendor's page says the part ships in May") but never as a rule, and never in a form that drops the quote marks. This is the write-side defence against both authority collapse (Zhan et al., 2026) and memory injection (Dong et al., 2025): a sentence crafted to look like an instruction can get into memory as a quotation, but it cannot get into the place where the agent looks for instructions.

### 8.2 No author

A fact says where it came from, never who wrote the line. Which agent, session or model typed a fact into a file tells the reader nothing about whether to trust it; the source class does. Memories, like skills, are knowledge shared by every agent that reads them, and knowledge needs no author: an author field only invites the reader to weigh a fact by its writer. The session record does keep authors (J1 §4.1), and that is where the source class comes from; the fact line keeps the class and drops the writer.

### 8.3 A rule carries its purpose and its exception

What a rule must carry is J5's to say (J5 §3.4): its purpose, and when it applies and when it does not. The gate enforces those fields on the write. A rule written to an always-loaded file (rungs 2–3 in J5) must arrive with a purpose and an exception, and the gate holds one that lacks either. A fact needs neither.

### 8.4 Dates, confirmation, and negatives

Each fact line carries its event date and its ingestion date, plus a "last confirmed" date that a "same" verdict refreshes (§6.2). A fact that keeps being confirmed is worth more than one written once and never seen again, and the confirmation date tells a reader which is which without any learned score.

Negative facts get a mark of their own. "There are no items of kind X" is the kind of claim that is most often wrong, because an empty answer has many causes, and the most expensive to believe, because it stops the search. The gate stamps a negative with its source (almost always "inferred") and the query that produced it, so that a later reader knows to run the query again before repeating it.

### 8.5 What happens when a stored fact meets an observation

How a found fact is presented to the model belongs to J2; the write side needs one rule. When a turn reads a stored fact and a tool result in the same turn disagrees with it, the observation wins, and the turn writes the correction then and there. The correction passes through the gate as "observed", the judge names it "replaces", and the old line is superseded (§7.5). The error is fixed in the store at the moment it is discovered, instead of being remembered as a lesson and fixed later, or never.

### 8.6 Importance is written, not guessed later

Corrections and decisions are marked important at the moment they are written, as a field on the fact. The gate knows when a write is a correction (the relation is "replaces" and the source is the owner or an observation) and when it records a decision, and it is cheaper to write that down than to infer it months later. How the mark and the last-confirmed date weigh in ranking, and whether unmarked facts fade, is J2's (J2 §5, "Combining keys").

## 9. The shape of what is written

The check is only as good as what it reads. Five rules for the shape of the store make the comparison cheap, the supersede exact and the result readable by a person. Figure 3 shows them together.

![The shape of the store. The index file holds one line per topic: a pointer and a hook saying when to read, never the fact itself. A fact file holds one topic, the facts read together, one fact per line, each with its source and its two dates; a retired line is struck through and kept, with a pointer to its replacement and a use key on the live line. The rules file is always loaded, and every rule carries its purpose and when it does not apply. Content from a web page, an email or another agent can be stored as a quoted claim, but never becomes a rule.](images/fig3-fact-shape.png){width=88%}

### 9.1 One fact per line

Each line holds one claim. A line that bundles three claims cannot have one of them retired without rewriting the other two, and a rewrite is exactly the kind of write that loses detail. One fact per line also makes the judge's job smaller: it compares a claim with claims, not paragraphs with paragraphs.

### 9.2 One topic per file, and files hold what is read together

A fact file holds one topic, and the facts that tend to be needed together live in the same file. The reason is cost. For an agent working through tools, reading a file costs a turn and the context it fills, so a topic spread over five files costs five reads and a file that mixes five topics fills the context with four that are not needed. J2 develops the cost model; here it decides the layout. J2 also sends this stage evidence about the layout: paths agents keep reaching for that do not exist (J2 §6.7, §8), and co-access pairs that suggest merging or splitting files (J2 §5). Each becomes a proposed write through the gate, and a merge or split waits for the owner's review in J5's morning report (J5 §7.4).

### 9.3 The index file holds pointers only

A line in the index file holds a pointer and a short hook saying when to read the file. It never restates the fact. This rule exists because of the first failure in §1: a fact restated in the index file is a second copy, and the second copy does not change when the fact does. Every such line that carries a claim is a contradiction waiting for the next update. With pointers only, the index file cannot disagree with the files it points to, and the gate refuses a write to it that contains a claim instead of a pointer. J14 owns the shape of a line in the index file; which entries the head holds and in what order is J2's (J2 §4.3), and the gate checks every line written there, whoever generated it. What leaves an always-loaded file when it outgrows its budget is J5's decision (J5 §7.1–§7.2).

### 9.4 Write the use key with the fact

How use keys are indexed and matched: J2 §5. The rule here is that the gate asks for a use key, such as "when a hardware part is hard to source", on facts about people and capabilities, where the gap between what a fact is about and when it is needed is widest.

### 9.5 Edit by delta, never by wholesale rewrite

The gate accepts small edits: add a line, merge into a line, supersede a line. It holds a write that replaces a whole memory file unless every line the old version had is accounted for: kept, merged, superseded or deleted with a tombstone. A model asked to rewrite a file "more concisely" drops details it judges minor, and repeated rewrites compound the loss (§2). The delta rule makes that loss impossible to commit by accident.

## 10. What the check costs, and when it pays

Every check costs one model call, and the design must say when that is money well spent. We derive the break-even point from published prices, in the series' notation (J2 §7.1): a cached token is read at $r$ times a model's base input price, and an output token costs $g$ times it. Write $\pi_s$ and $\pi_\ell$ for the base input price, in dollars per token, of a small and a large model.

*The cost of a check.* The judge reads the write plus its comparison set, $T_c$ tokens, and returns a typed verdict of about $o_j = 150$ tokens. A small model at $\pi_s$ = \$0.10 per million tokens with $g = 5$ (Anthropic, 2026) checks a write that reads 4,000 tokens for

$$C_{\text{check}} = (T_c + g\,o_j)\,\pi_s = \frac{(4000 + 5 \times 150) \times 0.10}{10^6} \approx \$0.00048.$$

*The cost of a bad write.* A wrong fact that reaches the store costs at least one wrong turn of the main model before anyone notices. Take a large model at $\pi_\ell$ = \$4 per million tokens, with $r = 0.05$ and $g = 5$ (\$0.20 per million cached tokens and \$20 per million output tokens on the same page), re-reading a cached context of $L$ = 150,000 tokens and writing $o$ = 1,500 tokens:

$$C_{\text{turn}} = (rL + g\,o)\,\pi_\ell = \frac{(7500 + 7500) \times 4}{10^6} = \$0.06.$$

That cache-read price lies inside the range J5 §5.2 quotes from the same page.

*Break-even.* Let $p$ be the share of writes that would mislead, $c$ the judge's catch rate (the share of those it catches), and $n$ the wrong turns each miss causes. The check pays when $p\,c\,n\,C_{\text{turn}} > C_{\text{check}}$, so the break-even share is

$$p^{*} = \frac{C_{\text{check}}}{c\,n\,C_{\text{turn}}}.$$

With a judge that catches half the bad writes ($c = 0.5$) and one wrong turn per miss, $p^{*} \approx 1.6\%$: the check pays once about one write in sixty would have misled a single turn. If a bad write costs three wrong turns, the bar drops to about one in two hundred. Figure 4 plots $p^{*}$ against the size of the comparison set.

![When the check pays for itself, in money alone. The vertical axis is the share of memory writes that would mislead at least one turn; above each curve the check saves more than it costs. A small-model judge breaks even at one to a few percent of writes across comparison sets of up to 20,000 tokens. The same check run on the large model breaks even only when a large share of writes would mislead, and past about 7,000 tokens it can never pay in money. Computed from Anthropic's published prices (October 2026) with a judge that catches half the bad writes; the owner's time is not counted.](images/fig4-check-breakeven.png){width=86%}

Three design choices follow. The judge is a small model: the same check on the large model costs forty times more and only pays when most writes are bad. The comparison set is kept tight (same-topic facts and the rules, not the whole store), because its cost grows with every token it reads. And the estimate is a floor: it counts no minute of the owner's time, and the failures in §1 cost the owner corrections, repeated explanations and lost trust, which are worth far more than a few cents of model time.

Latency follows the same logic: one small-model call per write is a small share of a turn, and §5.3 says what happens when it is not.

## 11. Conclusions

An agent's memory goes wrong at the moment of writing, and the fix belongs there. MNEMOSYNE first says what is worth writing: a live turn writes what the owner states and what contradicts the store, and the nightly pass picks the rest out of the session record, each candidate tied to the entries it rests on. It then puts one check inside the write tool, so that a live turn, the nightly pass, the owner's own edits and other agents all pass it. The check compares a write with the facts on the same topic, the always-loaded files and the turn's own observations; a small model names one of seven relations, and each relation has one outcome. Only that judgement can retire a fact, which is struck through and kept in the file with its event and ingestion dates. Every fact carries a source class that decides what it may become, and no author. The store is shaped so the check is cheap and exact: one fact per line, one topic per file, an index file of pointers only, use keys written with the fact, and edits as deltas. A deletion for privacy reaches every copy, from the fact file to the session record and J2's indexes. Every check leaves a receipt, so the gate's health is read from counts. At published prices the check pays for itself once roughly one write in sixty would mislead a single turn, provided the judge is a small model.

The design has limits. The judge's precision is unknown until it is measured, and a judge that holds too often will annoy the owner as surely as one that misses will mislead him. Topic links are only as good as the index file, so a fact filed under the wrong topic is compared with the wrong neighbours, and the embedding backstop narrows this gap without closing it. Checks on the owner's own edits only report, so a clash he does not read stays in place. The path guard on shell writes covers the common forms, and an indirect write (a script that writes a memory file) can still go around it. And the gate does nothing for a fact that is stored correctly and never found; that is J2's problem, just as making a rule bind is J5's.

If the tests below hold, the notebook from the first paragraph becomes something an agent can keep: every line dated, every source named, every correction made once and kept, and nothing true ever erased without a trace.

## 12. Next steps

The gate will be built and tested on our own agent, and an updated version of this paper will report the results. These tests decide the design:

1. *Catching the clashes that matter.* Build a labelled set from the dated corrections already written by hand in a long-lived memory store, plus every known case of an always-loaded line that contradicted a rule. Replay each original write through the gate with the store as it stood that day. Pass: the gate flags every rule clash and at least half of the later-corrected facts, at a precision of at least 0.9 on a hand audit of its flags.
2. *The judge's bar for closing on its own.* On a hand-audited sample of 200 "replaces" verdicts, automatic closing turns on only if at least nine in ten are right (§7.2). The same sample sets the confidence threshold.
3. *No closure by position.* Index the same file twice, split a long note into fragments, and re-flow a file. Pass: zero closures. Then write one fact in one file that contradicts a fact in another. Pass: exactly one closure, made by the judge, with a pointer.
4. *The alarm fires on day one.* Replay a burst of same-file, same-pass closures. Pass: the alarm fires on the first one, and automatic closing pauses.
5. *Authority survives the write.* In the style of AuthMem (Zhan et al., 2026), pair facts that differ only in their source, one told by the owner and one quoted from a web page or another agent. Pass: the untrusted twin never reaches an always-loaded file, and an action that depends on it is never taken without the owner.
6. *Errors fixed when found.* Over a month of session records, count turns in which a stored fact met a disagreeing tool result. Pass: the store was corrected in the same turn in at least nine of ten such cases.
7. *Cost and delay.* Measure tokens and time per check on real writes. Pass: median under one second, and a cost per check consistent with §10.
8. *The outcome that counts.* The share of the owner's prompts that repeat a correction about a stored fact, before and after the gate. Pass: it falls, and a fact corrected once is not corrected again.
9. *What the nightly pass misses.* Over a month of session records, take every fact the owner had to state twice. Pass: the nightly pass had proposed at least nine in ten of them after the first time, each with a record address, and the owner rejected fewer than one proposal in five.
10. *A deletion leaves no copy.* Plant a fact about a made-up person in a session, let it reach a fact file, a compaction marker and both of J2's indexes, then ask for it to be forgotten. Pass: a search of every store returns only tombstones, every pointer into the record still resolves, and a later write about the same person is held.

Two further ideas are worth trying once the gate runs. A judge could also propose use keys for facts written without one, and its proposals could be scored by whether J2's replay finds the fact sooner. And the conflict outcome (both versions kept, owner asked) could feed J5's rule ledger, since a fact that keeps flipping is often a rule that was never written down.

## References

Anthropic (2025). *Memory tool.* Claude Developer Platform documentation. <https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool>

Anthropic (2026). *Pricing.* Claude Developer Platform documentation, read 12 October 2026. <https://platform.claude.com/docs/en/about-claude/pricing>

Chhikara, P., Khant, D., Aryan, S., Singh, T., and Yadav, D. (2025). *Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory.* arXiv:2504.19413. <https://arxiv.org/abs/2504.19413>

Dong, S., Xu, S., He, P., Li, Y., Tang, J., Liu, T., Liu, H., and Xiang, Z. (2025). *Memory Injection Attacks on LLM Agents via Query-Only Interaction.* arXiv:2503.03704. <https://arxiv.org/abs/2503.03704>

Packer, C., Wooders, S., Lin, K., Fang, V., Patil, S. G., Stoica, I., and Gonzalez, J. E. (2023). *MemGPT: Towards LLMs as Operating Systems.* arXiv:2310.08560. <https://arxiv.org/abs/2310.08560>

Rasmussen, P., Paliychuk, P., Beauvais, T., Ryan, J., and Chalef, D. (2025). *Zep: A Temporal Knowledge Graph Architecture for Agent Memory.* arXiv:2501.13956. <https://arxiv.org/abs/2501.13956>

Sevenster, D., Beckers, T., and Kindt, M. (2013). Prediction error governs pharmacologically induced amnesia for learned fear. *Science* 339(6121), 830–833. <https://doi.org/10.1126/science.1231357>

TypeSafe AI (2026). *Introducing System One models and Jev.* <https://typesafe.ai/blog/introducing-system-one-models-and-jev>

Xu, W., Liang, Z., Mei, K., Gao, H., Tan, J., and Zhang, Y. (2025). *A-MEM: Agentic Memory for LLM Agents.* arXiv:2502.12110. <https://arxiv.org/abs/2502.12110>

Zhan, Q., Zhang, R., Guo, S., Zhao, L., and Liu, Z. (2026). *When Memory Becomes Authority: Benchmarking Authority Collapse at the Memory Consolidation Boundary.* arXiv:2608.01679. <https://arxiv.org/abs/2608.01679>

Zheng, J., Lai, P., Cheng, S., Zhao, J., Yang, L., and Chen, G. (2026). *ROAM: Robust Organization of Atomic Memories for Agents through Semantic Relations.* arXiv:2609.09778. <https://arxiv.org/abs/2609.09778>

---

_J-series paper J14 | Version 2.0 | 2026-10-12_
