# MNEMOSYNE: One Check on Every Memory Write: v1.2 → v1.3

From v1.2 (2 Jun) to v1.3 (2 Jun): 6,718 words to 6,625 words, 490 words in new or rewritten paragraphs and 583 taken out, 74 paragraphs changed.

## Change note of v1.3

**The paper now stands alone, without the companion-paper names**

The paper stops leaning on its companion papers. References to the sibling papers by codename and number are cut, "upstream" becomes "the underlying memory library", and the agent's own name gives way to "the agent". Section 2.1 on the paper series is replaced by a section on the prior components this work builds on, and the reference list shrinks from 179 to 99 words. The claims and the design do not change.

## Changed paragraphs

Marks: [-removed-] {+added+}.

### Abstract

Personal AI assistants that accumulate months of memory face four gaps that [-upstream-] {+general-purpose+} retrieval systems do not close: constant-time concept lookup degrades to linear search at scale, retrieval scoring ignores the agent's current task, memory writes can silently introduce contradictions, and context compaction permanently destroys information that was used once but never queried again. We present **MNEMOSYNE**, a plugin-layered enhancement suite that addresses all four gaps without modifying the [-upstream-] {+underlying+} memory-core codebase. MNEMOSYNE registers four hooks — `retrieval_pre`, `before_message_write`, `before_compaction`, and `after_compaction` — on top of OpenClaw's markdown-first memory system. [-The hippocampus-] {+A+} concept index and compaction-aware capture are deployed in [-production (v0.1);-] {+production;+} task-conditioned retrieval scoring and the contradiction gate are scaffolded for [-v0.2.-] {+the next release.+} We also describe how the contradiction gate [-evolves into-] {+becomes+} a bi-temporal validity layer (§9.5): rather than blocking or warning, a contradicting write *supersedes* the prior fact by closing its validity interval, so the corpus retains full history and every retrieval can ask "what is true now" versus "what was true then." This [-evolution-] is [-no longer speculative-] {+not a paper design only+} — memory-core [-now-] ships the validity columns, the temporal search predicate, and the supersede writer, leaving MNEMOSYNE to route the gate's decision into a substrate that already exists. The plugin architecture permits marketplace distribution as a single installable unit.

### 1.1 The Personal-Assistant vs Enterprise-Wiki Divergence

[-Upstream-] {+The+} memory-core {+library that MNEMOSYNE builds on+} was designed as a general-purpose memory system — part personal assistant, part enterprise wiki. It provides hybrid FTS5 full-text search, vector embeddings with cosine similarity, Maximal Marginal Relevance (MMR) deduplication, and temporal decay scoring. For an enterprise wiki where queries are well-formed and contexts are stable, this suite is sufficient.

### 1.1 The Personal-Assistant vs Enterprise-Wiki Divergence

A personal assistant diverges in three structural ways. First, queries are ambiguous: "what was that thing about the cron job?" contains no entity that FTS5 can match. Second, the agent context-switches constantly — from debugging cron tasks to drafting emails to reviewing code — and retrieval scoring should reflect this. Third, the agent writes its own memories autonomously through nightly consolidation [-cycles (the "dreaming" phase described in J5 [Serra, 2026e]),-] {+cycles,+} and those writes can contradict earlier facts without any human review gate.

### 1.1 The Personal-Assistant vs Enterprise-Wiki Divergence

These divergences [-motivated-] {+motivate+} a layered enhancement approach rather than a fork of memory-core.

### 1.2 Why a Plugin, Not a Fork

1. **Failure isolation.** A crash in MNEMOSYNE does not take down memory-core. The hook runner catches exceptions and logs them; [-upstream-] {+the underlying+} retrieval continues unimpaired. 2. **Upgrade independence.** [-Upstream-] {+The+} memory-core {+library+} ships [-weekly-] {+frequent+} updates. A plugin does not create merge conflicts. 3. **Distribution.** A single `tinkerclaw-memory-enhancements` package can be installed via ClawHub, OpenClaw's plugin marketplace, without users maintaining a fork. 4. **Composability.** Each of the four features can be independently enabled or disabled via plugin configuration.

### 2.1 The Serra Paper Series

[-### 2.1 The Serra Paper Series-]

### 2.1 The Serra Paper Series

[-MNEMOSYNE builds directly on four prior papers in this series:-]

### 2.1 The Serra Paper Series

[-**J1 ENGRAM** [Serra, 2026a] defines the event-sourced memory architecture with pointer-based compaction. ENGRAM's write model — where the context window is treated as a cache over a durable store — is the substrate on which MNEMOSYNE's compaction capture operates. When ENGRAM evicts context, it inserts pointer markers; MNEMOSYNE intercepts the eviction to capture content that pointers alone cannot recover.-]

### 2.1 The Serra Paper Series

[-**J2 HIPPOCAMPUS** [Serra, 2026b] introduces the pre-computed concept-to-memory-address index that enables O(1) retrieval. HIPPOCAMPUS v5.0 defines the anchor vocabulary, importance scoring, and CORF (Contextual Ownership Retrieval Failure) taxonomy. J2 also owns the bi-temporal *schema* — the `validity_start / validity_end / ingestion_time` columns and the temporal search predicate — that MNEMOSYNE's validity layer (§9.5) sits on top of. MNEMOSYNE's Feature 1 is the production plugin implementation of the HIPPOCAMPUS retrieval architecture described theoretically in J2.-]

### 2.1 The Serra Paper Series

[-**J4 CORTEX** [Serra, 2026c] addresses identity persistence and consistency preservation across sessions. CORTEX's PersonaState structure defines what the agent "believes" to be true about itself; MNEMOSYNE's contradiction gate (Feature 3) protects this structure from silent corruption.-]

### 2.1 The Serra Paper Series

[-**J5 Prompt Cerebellum** [Serra, 2026e] describes the nightly reflection and consolidation cycles ("dreaming") that produce autonomous memory writes. These are precisely the writes that Feature 3 gates and Feature 4 captures.-]

### 2.1 Underlying Memory-Core Architecture

### [-2.2 Upstream-] {+2.1 Underlying+} Memory-Core Architecture

### 2.2 Prior Components This Work Composes

{+### 2.2 Prior Components This Work Composes+}

### 2.2 Prior Components This Work Composes

{+MNEMOSYNE assembles four mechanisms that have been described and built separately, and which we summarize here so this paper stands on its own.+}

### 2.2 Prior Components This Work Composes

{+**An event-sourced memory store with pointer-based compaction.** In this model the context window is treated as a cache over a durable event log; when context is evicted, the system inserts time-range pointer markers (e.g., "cron debugging happened between 14:00 and 15:30") rather than discarding the slot silently. MNEMOSYNE's compaction capture (Feature 4) operates on this substrate: it intercepts the eviction to preserve the content that a pointer alone cannot recover.+}

### 2.2 Prior Components This Work Composes

{+**A pre-computed concept-to-address index for constant-time retrieval.** The idea is to map a finite vocabulary of recurring concepts — project names, people, tools, error classes — to their associated memory chunks offline, so that a query containing a known concept can be answered without a full hybrid scan. MNEMOSYNE's Feature 1 is the production plugin implementation of this index, and it also owns the bi-temporal *schema* — the `validity_start / validity_end / ingestion_time` columns and the temporal search predicate — that MNEMOSYNE's validity layer (§9.5) sits on top of.+}

### 2.2 Prior Components This Work Composes

{+**An identity-and-consistency layer that keeps a persona coherent across sessions.** A long-running agent maintains a structured record of what it "believes" to be true about itself; that record must not drift or contradict itself across restarts. MNEMOSYNE's contradiction gate (Feature 3) protects this kind of structure from silent corruption.+}

### 2.2 Prior Components This Work Composes

{+**Nightly reflection and consolidation ("dreaming").** Between sessions, the agent summarizes the day's events and promotes durable memories autonomously. These autonomous writes — not human edits — are precisely what Feature 3 gates and Feature 4 captures.+}

### 3.1 Plugin-Layered Design

``` /** * [-FORK:-] MNEMOSYNE plugin entry point. * Registers four hooks on [-upstream-] memory-core's retrieval [-*-] and write {+*+} pipelines. No [-upstream-] {+modification of the underlying+} source [-modification-] required. */ export function activate(api: PluginAPI): void { api.hooks.register('retrieval_pre', conceptIndexLookup); api.hooks.register('retrieval_pre', taskConditionedScoring); api.hooks.register('before_message_write', contradictionGate); api.hooks.register('before_compaction', compactionCapture); } ```

### 3.3 Failure Isolation

Each hook is wrapped in a try-catch at the memory-core level. If MNEMOSYNE throws, the exception is logged to the plugin's own log file (`<agent-logs>/tinkerclaw-memory-enhancements.log`) and the [-upstream-] pipeline continues as if the hook were not registered. This means:

### 4. Feature 1: Concept Index for O(1) Retrieval

## 4. Feature 1: [-Hippocampus-] {+Concept Index for+} O(1) [-Concept Index-] {+Retrieval+}

### 4.1 Design

The concept index [-implements the architecture described in J2 HIPPOCAMPUS [Serra, 2026b] §4 as-] {+exploits+} a [-production plugin component. The core insight is that-] {+simple observation:+} a personal assistant's memory corpus contains a finite vocabulary of recurring concepts — project names, people, tools, error classes — and mapping these concepts to their associated memory chunks offline enables constant-time retrieval at query time.

### 4.2 Data Structure

``` /** * [-FORK: Hippocampus concept-] {+Concept+} index. [-*-] Maps concept tokens to their associated memory {+*+} chunk IDs [-*-] with importance scoring for retrieval ranking. * Persisted to anchors.json, loaded lazily on first query. */ type ConceptEntry = { chunkIds: Set<string>; importance: number; lastSeenAtMs: number; };

### 4.3 Ingestion

The index is built during nightly [-consolidation (the "dreaming" phase from J5).-] {+consolidation.+} For each memory chunk processed during consolidation:

### 4.7 Complexity Analysis

| Operation | Hybrid search [-(upstream)-] {+(memory-core)+} | Concept index (MNEMOSYNE) | |-----------|-------------------------|---------------------------| | Query-time retrieval | O(n log n) — FTS5 scan + vector cosine + MMR | O(\|Q\|) — token lookup in Map, where \|Q\| is query token count | | Index build | N/A | O(n \* \|V\|) — one-time, during nightly consolidation | | Incremental update | N/A | O(\|V\|) per new chunk | | Storage | FTS5 index + vector store | anchors.json (~50KB for 2,000 concepts) |

### 5.1 Motivation

Consider: [-Jarvis-] {+the agent+} is debugging a cron failure. The user asks "what did we change last week?" Without task conditioning, the retrieval system returns all changes from last week — code commits, email drafts, configuration edits — ranked by textual similarity to "change" and "last week." With task conditioning, chunks tagged with cron-related metadata are boosted, surfacing the specific cron script modifications that the user implicitly meant.

### 5.4 Weight Calibration

The default of 0.3 was chosen empirically: high enough to promote task-relevant chunks from page 2 to page 1 of results, low enough that a query about an unrelated topic still returns correct results. Formal calibration against [-a CORF-annotated-] {+an annotated retrieval-failure+} benchmark [-(proposed in J2 §7)-] is planned for [-v0.2.-] {+the next release.+}

### 6.1 Threat Model: Agent Self-Corruption

1. **Hallucinated consolidation.** During nightly [-dreaming (J5),-] {+dreaming,+} the LLM summarizes the day's events. If the summary includes a hallucinated detail — a wrong date, an incorrect attribution, a confused sequence of events — that hallucination is promoted to durable storage and becomes a "fact" the agent retrieves in future sessions.

### 6.1 Threat Model: Agent Self-Corruption

These threats are not hypothetical. [-The SCF (Self-Contradiction Failure) mode identified in J2 v5.0 [Serra, 2026b]-] {+A self-contradiction failure+} was [-discovered-] {+observed+} in production when [-Jarvis-] {+the agent+} flagged a calendar conflict for a meeting it had already noted as postponed.

### 6.2 Gate Mechanism

The `detectContradictions` function uses entity-level comparison: it extracts named entities (dates, names, project identifiers, status labels) from both the candidate and existing facts, then checks for direct conflicts (same entity, different value). This is a conservative approach — it catches explicit contradictions ("meeting on Wednesday" vs "meeting on Thursday") but not subtle semantic drift. Semantic drift detection [-is deferred to v0.3.-] {+remains future work.+}

### 6.3 Modes: Warn, Block, Supersede

**Supersede mode** (§9.5): The contradiction is resolved rather than logged or blocked. The prior fact's validity interval is closed and the new fact opens its own — both rows are retained, so nothing is lost. This is [-the-] {+a+} non-lossy [-resolution that the v1.0 design lacked;-] {+resolution;+} §9.5 describes the mechanism and its grounding in memory-core's [-now-live-] bi-temporal substrate.

### 6.3 Modes: Warn, Block, Supersede

[-In v1.0, warn was the default precisely because block is lossy. With supersede available, the default question is revisited in §9.5.4.-]

### 6.4 Relationship to J1 and J4

[-### 6.4 Relationship to J1 and J4-]

### 6.3 Modes: Warn, Block, Supersede

{+Warn is the conservative default because block is lossy and supersede changes live behavior; §9.5.4 examines when the default should change.+}

### 6.4 Relationship to the Write Model and Identity Layer

{+### 6.4 Relationship to the Write Model and Identity Layer+}

### 6.4 Relationship to the Write Model and Identity Layer

The contradiction gate sits at the intersection of two architectural [-concerns:-] {+concerns.+}

### 6.4 Relationship to the Write Model and Identity Layer

[-**J1 ENGRAM's write-] {+The event-sourced **write+} model** treats memory writes as cache promotions — content moves from the ephemeral context window to durable storage. The contradiction gate adds a validation step to this promotion, analogous to a database constraint check before an INSERT.

### 6.4 Relationship to the Write Model and Identity Layer

[-**J4 CORTEX's consistency preservation**-] {+The **identity-and-consistency layer**+} maintains agent identity across sessions by keeping [-the PersonaState structure-] {+its persona record+} coherent. The contradiction gate protects not just the persona but the entire fact base from inconsistency. Where [-CORTEX-] {+the identity layer+} guards the "who am I?" question, the contradiction gate guards the "what do I know?" question.

### 7.1 The Gap: Messages Used Once and Never Queried Are Lost

[-ENGRAM's pointer-based-] {+Pointer-based+} compaction [-(J1)-] replaces evicted messages with time-range markers containing topic hints. The pointers are enough for the agent to know that "something about cron debugging happened between 14:00 and 15:30" — but the actual content (the exact error message, the specific fix attempted, the user's aside about a related problem) is gone from the context window.

### 7.1 The Gap: Messages Used Once and Never Queried Are Lost

[-Memory-core's nightly-] {+Nightly+} dreaming [-(J5)-] can recover some of this content by promoting memories that were recently searched for. But dreaming promotes only what has been queried. Content used once — read, acted upon, and never referenced again — is permanently lost after compaction.

### 7.4 Integration with the before_compaction Hook

### 7.4 Integration with {+the+} before_compaction Hook

### 7.5 Relationship to J1 ENGRAM

[-### 7.5 Relationship to J1 ENGRAM-]

### 7.5 Relationship to Pointer-Based Compaction

{+### 7.5 Relationship to Pointer-Based Compaction+}

### 7.5 Relationship to Pointer-Based Compaction

[-ENGRAM's pointer-based-] {+Pointer-based+} compaction and MNEMOSYNE's capture are complementary, not competing:

### 7.5 Relationship to Pointer-Based Compaction

- [-**ENGRAM pointers**-] {+**Pointers**+} tell the agent *what happened* (time range, topic hints) so it can decide whether to search for details. - **MNEMOSYNE capture** ensures the *details exist to be found* when the agent does search.

### 7.5 Relationship to Pointer-Based Compaction

Without capture, [-ENGRAM's-] {+the+} pointers point to content that may no longer exist in any searchable form. Without pointers, capture would be insufficient because the agent would not know to search for captured content. The two mechanisms close each other's gaps.

### 8.1 Plugin Manifest

``` { "id": "tinkerclaw-memory-enhancements", "name": "MNEMOSYNE — Memory Enhancement Suite", "version": "0.1.0", "description": [-"Hippocampus concept-] {+"Concept+} index, task-conditioned scoring, contradiction gate, and compaction capture for personal-agent memory systems.", "entryPoint": "dist/index.js", "configSchema": { "conceptIndex": { "enabled": { "type": "boolean", "default": true }, "confidenceThreshold": { "type": "number", "default": 0.4 }, "pruneThresholdDays": { "type": "number", "default": 90 } }, "taskScoring": { "enabled": { "type": "boolean", "default": false }, "weight": { "type": "number", "default": 0.3 } }, "contradictionGate": { "enabled": { "type": "boolean", "default": false }, "mode": { "type": "string", "enum": ["warn", "block", "supersede"], "default": "warn" } }, "compactionCapture": { "enabled": { "type": "boolean", "default": true }, "trivialityThresholdTokens": { "type": "number", "default": 20 } } } } ```

### 8.1 Plugin Manifest

[-Note the `configSchema` field — mandatory since the 2026-03-05 upstream merge. Missing this field blocks all plugin loading (a lesson learned from the hippocampus extension incident documented in the fork's operational history).-]

### 8.1 Plugin Manifest

{+The `configSchema` field is mandatory in current memory-core: a plugin that omits it fails to load entirely. This is a load-time contract, not a runtime check, so a missing schema blocks the plugin before any hook can register.+}

### 8.3 Deployment Status

### 8.3 [-v0.1-] {+Deployment+} Status

### 8.3 Deployment Status

| Feature | Status | Notes | |---------|--------|-------| | [-Hippocampus concept-] {+Concept+} index | **Live** | anchors.json persisted, lazy loading, nightly rebuild | | Compaction-aware capture | **Live** | Capturing to `<agent-data>/mnemosyne/captured/`, FTS5 indexing confirmed | | Task-conditioned scoring | Scaffolded | Hook registered but returns early (no task descriptor extraction yet) | | Contradiction gate | Scaffolded | Hook [-registered, `detectContradictions` returns empty array (entity extraction-] {+registered; today it injects passive contradiction warnings into the retrieval pack rather than blocking, and entity-level conflict detection is+} not [-wired)-] {+yet wired+} | | Bi-temporal supersede (§9.5) | Core-ready, plugin-pending | memory-core ships the validity columns, search predicate, and [-`supersede-writer`/`invalidate`;-] {+supersede writer;+} MNEMOSYNE must route the gate's decision into them |

### 9.3 The Complementarity Argument

This divergence justifies maintaining MNEMOSYNE as a separate enhancement layer rather than lobbying for its features to be merged into [-upstream memory-core.-] {+the memory-core mainline.+} The [-upstream-] {+mainline+} maintainers optimize for the general case; MNEMOSYNE optimizes for the personal-assistant edge.

### 9.4 Potential ClawHub Distribution

The plugin architecture and configSchema compliance make MNEMOSYNE a candidate for ClawHub distribution once [-v0.2-] {+the next release+} reaches stability. Distribution requirements:

### 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-Resolver

The contradiction gate [-of v1.0-] (§6) is a *single-valued-present* operation: it decides allow / warn / block over a corpus implicitly assumed to be a flat snapshot of "what is true now." That assumption is exactly what the §6.1 *stale-override* and *semantic-drift* threats violate. Bi-temporal validity replaces *overwrite/block* with *supersede*: a contradicting write neither destroys the prior fact (lossy — the reason [-§6.3 defaulted to warn)-] {+warn is the conservative default)+} nor silently keeps both (the [-SCF /-] calendar-conflict failure of §6.1). Instead it **closes the prior fact's validity interval and opens the new one**, so the corpus carries the full history and every retrieval can ask "valid-at-now" versus "valid-at-time-T." This upgrades the gate from a *logger of conflicts* into a *resolver of conflicts*, and it makes task-conditioned scoring (§5) honest: a debugging query asking "what's the cron schedule" gets the currently-valid value, not the superseded one written three weeks ago.

### 9.5.1 Division of Labor: The Index Owns the Schema, MNEMOSYNE Owns the Behavior

#### 9.5.1 Division of Labor: [-J2-] {+The Index+} Owns the Schema, [-J14-] {+MNEMOSYNE+} Owns the Behavior

### 9.5.1 Division of Labor: The Index Owns the Schema, MNEMOSYNE Owns the Behavior

The schema work belongs to [-J2 HIPPOCAMPUS;-] {+the concept-index subsystem;+} the write/retrieve *semantics* belong [-here. As of this revision, the J2-] {+to MNEMOSYNE. The+} substrate has landed in memory-core and can be verified directly in the codebase:

### 9.5.1 Division of Labor: The Index Owns the Schema, MNEMOSYNE Owns the Behavior

- The `chunks` table [-now-] carries `validity_start`, `validity_end`, `ingestion_time`, and `superseded_by` columns, added idempotently via `ensureColumn()` in `memory-schema.ts`, with a covering index `idx_chunks_validity` on `validity_end` so the hot-path "current" filter does not table-scan. (`validity_end IS NULL` means currently-valid / unbounded; back-filled legacy rows are NULL and so remain retrievable in the default mode.) - `StoredChunk` (`storage/types.ts`) carries the matching optional [-fields,-] {+fields `validityStart`, `validityEnd`, `ingestionTime`, and `supersededBy`,+} and `SearchParams` gains `temporalMode: "current" | "valid-at" | "all"` plus `asOfTime`. - The read path is already temporal-aware: `manager-search.ts` exports `temporalPredicate()`, threaded into the vector, FTS, and hybrid SELECTs — `current` appends `validity_end IS NULL OR validity_end > now`, `valid-at` binds `validity_start <= asOf AND (validity_end IS NULL OR validity_end > asOf)`, and `all` drops the predicate entirely.

### 9.5.1 Division of Labor: The Index Owns the Schema, MNEMOSYNE Owns the Behavior

So [-J14's-] {+MNEMOSYNE's+} claim is [-no longer "gated-] {+not gated+} on a future [-J2 migration."-] {+migration.+} The substrate exists. What MNEMOSYNE owns is routing the contradiction gate's decision into it and keeping task scoring validity-aware.

### 9.5.2 The Supersede Write Decision

MNEMOSYNE extends the gate's `WriteDecision` with a `supersede` variant alongside [-the legacy-] `warn`/`block`. memory-core already ships the executor: `engram/supersede-writer.ts` exposes `decideSupersede(db, candidate, mode = "supersede")`, which finds the currently-valid (`validity_end IS NULL`) prior chunk(s) at the candidate's identity and returns `{ action, supersedes: ChunkId[], reason }`; and `applySupersede(db, decision, candidate)`, which — only in `supersede` mode — calls `invalidate()` once per superseded chunk. `invalidate()` (in [-`temporal-invalidation.ts`, at the memory module root)-] {+`temporal-invalidation.ts`)+} stamps `validity_end` and `superseded_by` on rows that are *still open* (`WHERE … AND validity_end IS NULL`), never deleting and never resurrecting a closed row. The behavior is non-lossy: the prior row stays queryable in `all` / `valid-at` mode.

### 9.5.3 Validity-Aware Task Scoring

A related correctness note: recency-based importance [-(`computeImportance`)-] should derive its recency tier from `validity_start`, not [-`updatedAt`-] {+the row's last-updated timestamp+} — a fact reinstated after being superseded became *true again* at its new `validity_start`, and that is the date a recency bonus should reflect. `ingestion_time` is stamped once at first insert and never on re-touch, so it stays the honest "when did the system first learn this" clock.

### 9.5.4 The One Genuine Product Decision

memory-core defaults `decideSupersede` to `supersede` mode, but MNEMOSYNE's published plugin [-still-] defaults `contradictionGate.mode` to `warn` for backward compatibility (§8.1). Whether the *plugin* default should flip to `supersede` is a product call, not a code-derivable one. The argument for flipping is that supersede is strictly safer than block — nothing is destroyed — and resolves rather than merely logs the §6.1 failure. The argument against is that it changes live behavior for every existing installation, and a false-positive contradiction would close the interval of a fact that was actually still valid (recoverable via `all`-mode query, but no longer surfaced by default). The conservative path — ship `supersede` [-opt-in for v0.2,-] {+opt-in,+} observe the `contradictions.jsonl` false-positive rate, then consider flipping the default [-in v0.3-] {+later+} — is the one this paper recommends.

### 9.5.5 What Is Not Yet Built

Two pieces [-from-] {+of+} the [-original-] design remain unimplemented and are stated honestly as future work:

### 9.5.5 What Is Not Yet Built

1. **Cascade retraction.** `temporal-invalidation.ts` is explicit that there is *no cascade in [-v1*:-] {+the current build*:+} invalidating a fact does not invalidate facts that depended on it. A `depends_on` edge plus a topological, visited-set-guarded cascade (to terminate on cyclic dependencies) is a [-v0.3-] {+future+} item, and it overlaps the [-Zettelkasten edge-] {+link-graph+} work [-(J2 Upgrade 9,-] {+—+} the `backlinks` table {+is+} already in the [-schema).-] {+schema.+} 2. **Fact-level (triple) validity.** The landed schema is *chunk-level*: one validity interval per chunk row. A true fact-level bi-temporal graph — `(subject, predicate, object, valid_from, valid_to)` — is richer but a larger build, and is left as an open granularity question rather than claimed.

### 9.5.5 What Is Not Yet Built

A third design question — whether the supersede boundary uses *ingestion time* (simple, what the current executor assumes via the candidate's `validity_start`) or an *extracted event time* from the content (correct for "the meeting moved to Thursday," but requires reliable temporal entity extraction) — is unresolved. Using ingestion time can mis-order the §6.1 stale-override scenario when an old memory is consolidated after a newer one; event-time extraction is the principled fix and a [-v0.3 candidate.-] {+candidate for a later release.+}

### 10.1 Hook Dependency on Memory-Core

### 10.1 Hook Dependency on [-Upstream-] {+Memory-Core+}

### 10.1 Hook Dependency on Memory-Core

MNEMOSYNE's four hooks (`retrieval_pre`, `before_message_write`, `before_compaction`, `after_compaction`) are not part of memory-core's public API. They exist as extension points but are not contractually stable. [-An upstream-] {+A+} refactor could rename, remove, or change the signature of any hook.

### 10.1 Hook Dependency on Memory-Core

**Mitigation:** [-The-] {+A+} merge-guardian automation [-(documented in the fork's operational infrastructure)-] checks for hook availability after every [-upstream-] {+memory-core+} merge. If a hook disappears, the guardian logs a warning and MNEMOSYNE degrades gracefully — the missing feature is disabled, {+the+} others continue.

### 10.2 Ingestion Wiring

The concept index [-in v0.1-] is populated during nightly consolidation. Real-time ingestion — indexing new memories as they arrive during the session — is implemented as an incremental update in `compactionCapture` but is not yet triggered from all memory write paths. Full real-time ingestion is planned for [-v0.2.-] {+the next release.+}

### 10.3 Contradiction Detection Depth

The current contradiction detector [-(v0.1 scaffold)-] uses entity-level comparison: same entity, different value. This catches explicit contradictions but misses:

### 10.3 Contradiction Detection Depth

Temporal contradictions — facts that were true at time T but not at T+1 — are no longer a detection gap so much as a *resolution* one: the bi-temporal validity layer (§9.5) is the mechanism that resolves them once the gate routes through `supersede`. Deeper semantic and implication detection using LLM-assisted comparison is planned for [-v0.3.-] {+a later release.+}

### 10.4 Benchmarks

No formal benchmarks have been run comparing O(1) concept index retrieval against hybrid search. The complexity analysis (§4.7) predicts constant-time retrieval, but wall-clock measurements on the production corpus (thousands of concepts) are needed to quantify the actual speedup. [-Benchmarking against the CORF-annotated dataset from J2 is planned for v0.2.-] The bi-temporal read path adds a per-query filter on `validity_end`; §9.5.1 notes the covering index that keeps it off the table-scan path, but the overhead has likewise not been measured under production load.

### 10.5 Capture Volume

Compaction-aware capture increases the total volume of stored content. Over time, the captured corpus may grow to rival the original memory corpus. A retention policy (e.g., captured chunks older than 180 days with zero retrieval hits are pruned) is planned for [-v0.2.-] {+the next release.+}

### 11. Conclusion

MNEMOSYNE demonstrates that four significant improvements to a personal-agent memory system — constant-time concept retrieval, task-conditioned scoring, write-time contradiction gating, and compaction-aware capture — can be delivered as a single plugin layered on top of an unmodified [-upstream codebase.-] {+memory-core.+} The plugin architecture provides failure isolation, upgrade independence, and marketplace distributability. Two features are live in [-production (v0.1);-] {+production;+} two are scaffolded and [-awaiting-] {+await+} entity extraction and task descriptor [-wiring (v0.2).-] {+wiring.+} The contradiction gate's most consequential evolution — bi-temporal supersession (§9.5) — [-is no longer speculative:-] {+rests on a substrate that already exists:+} memory-core [-now-] ships the validity schema, the temporal search predicate, and the supersede writer, leaving MNEMOSYNE to route the gate's decision into [-a substrate that already exists.-] {+them.+} The approach validates a design principle: that personal-assistant memory diverges enough from enterprise-wiki memory to justify a separate enhancement layer rather than [-upstream modification.-] {+modification of the shared core.+}

### References

[-- Serra, O. (2026a). ENGRAM: Event-Navigated Graded Retrieval & Archival Memory. *J1, Serra Paper Series.* v4.0. - Serra, O. (2026b). HIPPOCAMPUS: A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI Agents. *J2, Serra Paper Series.* v5.0. - Serra, O. (2026c). CORTEX: Identity Persistence and Consistency Preservation for Long-Running AI Agents. *J4, Serra Paper Series.* v4.0. - Serra, O. (2026e). The Prompt Cerebellum: How Structured Nightly Prompting Produces Emergent Intelligence in Stateless AI Agents. *J5, Serra Paper Series.* v1.1.-] - Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. *NeurIPS 2020.* - Packer, C., et al. (2023). MemGPT: Towards LLMs as Operating Systems. *arXiv:2310.08560.* - Xu, Z., et al. (2025). A-MEM: Agentic Memory for LLM Agents. *arXiv preprint.* - Croft, W.B., Metzler, D., & Strohman, T. (2010). *Search Engines: Information Retrieval in Practice.* Addison-Wesley. - MemoryOS. (2024). Mem0: Multi-Level Memory Architecture. *mem0.ai.* - Carbonell, J. & Goldstein, J. (1998). The Use of MMR, Diversity-Based Reranking for Reordering Documents and Producing Summaries. *SIGIR 1998.* - Robertson, S. & Zaragoza, H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond. *Foundations and Trends in IR.*
