ReadPrintedHistoryCompareGraphs

v1.0 → v1.1

What changed from v1.0 to v1.1

From v1.0 (16 Apr) to v1.1 (2 Jun): 5,024 words to 6,542 words, 1,630 words in new or rewritten paragraphs and 112 taken out, 72 paragraphs changed.

A contradiction now retires the old fact instead of blocking the new one

The contradiction check gets a third answer. Besides warning or refusing, it can now close the old fact's period of validity and open one for the new fact, so both stay on record and a search can ask what is true now or what was true at a given date. A new section, 9.5, explains how this rides on columns and a search filter that had just landed in the memory library. The folder's notes of 30 May give the reason: this was the third item on the open-source roadmap, bi-temporal validity.

  • New section 9.5 on the "supersede" answer, task scoring that knows a fact is out of date, and a list of what is not built yet.
  • The status table adds a row for the new layer: ready in the library, waiting in the plugin.
  • Unverifiable size claims (a 50,000-line codebase, 878,000 stored events) are removed.
  • The benchmark gap now also names the unmeasured cost of the new date filter.
v1.0 · 16 April 2026v1.1 · 2 June 2026

··· 1 unchanged paragraph folded ···

v1.0 · MNEMOSYNE: A Plugin-Layered Enhancement Suite for Personal-Agent Memory Systems**Paper:** J14 — MNEMOSYNE **Version:** 1.0 **Date:** 2026-04-16 **Author:** Oscar Serra **Plugin:** tinkerclaw-memory-enhancements (v0.1) **Status:** Production scaffold; hippocampus index + compaction capture live; task scoring + contradiction gate scaffolded
v1.1 · MNEMOSYNE: A Plugin-Layered Enhancement Suite for Personal-Agent Memory Systems**Paper:** J14 — MNEMOSYNE **Version:** 1.1 **Date:** 2026-06-02 **Author:** Oscar Serra **Plugin:** tinkerclaw-memory-enhancements (v0.1) **Status:** Production scaffold; hippocampus index + compaction capture live; task scoring + contradiction gate scaffolded. Bi-temporal substrate now live in memory-core (validity columns, temporal search predicate, supersede writer); MNEMOSYNE's validity layer (§9.5) is the plugin-side behavior on top.

··· 2 unchanged paragraphs folded ···

v1.0 · AbstractPersonal AI assistants that accumulate months of memory face four gaps that upstream 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 memory-core codebase. MNEMOSYNE registers four hooks — `retrieval_pre`, `before_message_write`, `before_compaction`, and `after_compaction` — on top of OpenClaw's 50k LOC markdown-first memory system. The hippocampus concept index and compaction-aware capture are deployed in production (v0.1); task-conditioned retrieval scoring and the contradiction gate are scaffolded for v0.2. The plugin architecture permits marketplace distribution as a single installable unit.
v1.1 · AbstractPersonal AI assistants that accumulate months of memory face four gaps that upstream 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 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 concept index and compaction-aware capture are deployed in production (v0.1); task-conditioned retrieval scoring and the contradiction gate are scaffolded for v0.2. We also describe how the contradiction gate evolves into 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." The plugin architecture permits marketplace distribution as a single installable unit.

··· 8 unchanged paragraphs folded ···

v1.0 · 1.2 Why a Plugin, Not a Fork1. **Failure isolation.** A crash in MNEMOSYNE does not take down memory-core. The hook runner catches exceptions and logs them; upstream retrieval continues unimpaired. 2. **Upgrade independence.** Upstream memory-core ships weekly 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 needing to maintain a fork. 4. **Composability.** Each of the four features can be independently enabled or disabled via plugin configuration.
v1.1 · 1.2 Why a Plugin, Not a Fork1. **Failure isolation.** A crash in MNEMOSYNE does not take down memory-core. The hook runner catches exceptions and logs them; upstream retrieval continues unimpaired. 2. **Upgrade independence.** Upstream memory-core ships weekly 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.

··· 1 unchanged paragraph folded ···

v1.0 · 1.3 Contributions1. An O(1) concept index that short-circuits hybrid retrieval for known concepts (Feature 1). 2. A task-conditioned score modifier that biases retrieval toward the agent's current work (Feature 2). 3. A contradiction gate that intercepts memory writes before promotion to durable storage (Feature 3). 4. A compaction-aware capture pass that snapshots context before it is evicted (Feature 4). 5. A unified plugin architecture that delivers all four as a single distributable unit.
v1.1 · 1.3 Contributions1. An O(1) concept index that short-circuits hybrid retrieval for known concepts (Feature 1). 2. A task-conditioned score modifier that biases retrieval toward the agent's current work (Feature 2). 3. A contradiction gate that intercepts memory writes before promotion to durable storage (Feature 3), and its bi-temporal evolution into a supersession layer (§9.5). 4. A compaction-aware capture pass that snapshots context before it is evicted (Feature 4). 5. A unified plugin architecture that delivers all four as a single distributable unit.

··· 5 unchanged paragraphs folded ···

v1.0 · 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. MNEMOSYNE's Feature 1 is the production plugin implementation of the HIPPOCAMPUS architecture described theoretically in J2.
v1.1 · 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.

··· 3 unchanged paragraphs folded ···

v1.0 · 2.2 Upstream Memory-Core ArchitectureOpenClaw's memory-core (approximately 50,000 lines of TypeScript) implements a markdown-first memory system with five retrieval stages:
v1.1 · 2.2 Upstream Memory-Core ArchitectureOpenClaw's memory-core implements a markdown-first memory system with five retrieval stages:
v1.0 · 2.2 Upstream Memory-Core Architecture1. **FTS5 full-text search** over a SQLite corpus, currently at ~878K events in production. 2. **Vector embedding similarity** using cosine distance against pre-computed chunk embeddings. 3. **MMR deduplication** to prevent redundant chunks from consuming retrieval budget. 4. **Temporal decay** that exponentially down-weights older memories (half-life configurable, default 30 days). 5. **Relevance threshold** that filters chunks below a minimum combined score.
v1.1 · 2.2 Upstream Memory-Core Architecture1. **FTS5 full-text search** over a SQLite corpus. 2. **Vector embedding similarity** using cosine distance against pre-computed chunk embeddings. 3. **MMR deduplication** to prevent redundant chunks from consuming retrieval budget. 4. **Temporal decay** that exponentially down-weights older memories (half-life configurable, default 30 days). 5. **Relevance threshold** that filters chunks below a minimum combined score.

··· 8 unchanged paragraphs folded ···

v1.0 · 3.1 Plugin-Layered Design```typescript /** * FORK: MNEMOSYNE plugin entry point. * Registers four hooks on upstream memory-core's retrieval * and write pipelines. No upstream 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); } ```
v1.1 · 3.1 Plugin-Layered Design``` /** * FORK: MNEMOSYNE plugin entry point. * Registers four hooks on upstream memory-core's retrieval * and write pipelines. No upstream 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); } ```

··· 2 unchanged paragraphs folded ···

v1.0 · 3.2 Hook Surface| Hook | Timing | Receives | Returns | |------|--------|----------|---------| | `retrieval_pre` | Before hybrid FTS+vector search | Query string, task descriptor, retrieval config | Modified query, injected candidates, or `skip_search` signal | | `before_message_write` | Before promotion to MEMORY.md | Candidate chunk, existing facts | `allow`, `warn`, or `block` | | `before_compaction` | Before context eviction | Messages about to be dropped | Captured chunks (written to corpus) | | `after_compaction` | After eviction completes | Eviction metadata | Void (used for bookkeeping) |
v1.1 · 3.2 Hook Surface| Hook | Timing | Receives | Returns | |------|--------|----------|---------| | `retrieval_pre` | Before hybrid FTS+vector search | Query string, task descriptor, retrieval config | Modified query, injected candidates, or `skip_search` signal | | `before_message_write` | Before promotion to MEMORY.md | Candidate chunk, existing facts | `allow`, `warn`, `block`, or (§9.5) `supersede` | | `before_compaction` | Before context eviction | Messages about to be dropped | Captured chunks (written to corpus) | | `after_compaction` | After eviction completes | Eviction metadata | Void (used for bookkeeping) |

··· 6 unchanged paragraphs folded ···

v1.0 · 3.4 Storage IsolationThis separation ensures that uninstalling the plugin leaves memory-core's data untouched.
removed in v1.1
not in v1.0
v1.1 · 3.4 Storage IsolationThis separation ensures that uninstalling the plugin leaves memory-core's data untouched. The one exception is the bi-temporal validity layer (§9.5), which writes through memory-core's own `chunks` table rather than a separate store — because superseding a fact must close *that fact's* validity interval, not a shadow copy.

··· 6 unchanged paragraphs folded ···

v1.0 · 4.2 Data Structure```typescript /** * FORK: Hippocampus 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; };
v1.1 · 4.2 Data Structure``` /** * FORK: Hippocampus 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; };

··· 8 unchanged paragraphs folded ···

v1.0 · 4.4 Lookup```typescript function conceptIndexLookup(ctx: RetrievalContext): RetrievalResult | null { const tokens = tokenize(ctx.query); const matches: ConceptEntry[] = [];
v1.1 · 4.4 Lookup``` function conceptIndexLookup(ctx: RetrievalContext): RetrievalResult | null { const tokens = tokenize(ctx.query); const matches: ConceptEntry[] = [];

··· 5 unchanged paragraphs folded ···

v1.0 · 4.5 Importance ScoringImportance is computed as a weighted product of three factors:
v1.1 · 4.5 Importance ScoringImportance is computed as a weighted sum of three factors:

··· 5 unchanged paragraphs folded ···

v1.0 · 4.6 PruningPruning is conservative: a concept is only removed if both conditions hold. A rarely-seen but highly distinctive concept (e.g., a unique project name) may persist indefinitely because its distinctiveness score keeps importance above the threshold.
v1.1 · 4.6 PruningPruning is conservative: a concept is removed only if both conditions hold. A rarely-seen but highly distinctive concept (e.g., a unique project name) may persist indefinitely because its distinctiveness score keeps importance above the threshold.

··· 1 unchanged paragraph folded ···

v1.0 · 4.7 Complexity Analysis| Operation | Hybrid search (upstream) | 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 (~878K events) | anchors.json (~50KB for 2,000 concepts) |
v1.1 · 4.7 Complexity Analysis| Operation | Hybrid search (upstream) | 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) |
v1.0 · 4.7 Complexity AnalysisThe critical property is that query-time retrieval is **O(1) in corpus size n**. As the memory corpus grows from thousands to hundreds of thousands of chunks, hybrid search degrades (FTS5 scan time grows, vector search requires more comparisons); the concept index remains constant.
v1.1 · 4.7 Complexity AnalysisThe critical property is that query-time retrieval is **O(1) in corpus size n**. As the memory corpus grows from thousands to hundreds of thousands of chunks, hybrid search degrades (FTS5 scan time grows, vector search requires more comparisons); the concept index remains constant. This is a theoretical property of the data structure; §10.4 notes that wall-clock confirmation on the production corpus is still pending.

··· 1 unchanged paragraph folded ···

v1.0 · 4.8 PersistenceThe index is serialized to `anchors.json` using JSON with `Set` values converted to arrays:
v1.1 · 4.8 PersistenceThe index is serialized to `anchors.json` using JSON, with `Set` values converted to arrays:
v1.0 · 4.8 Persistence```json { "cron": { "chunkIds": ["c_4a2f", "c_891b", "c_3e7d"], "importance": 0.72, "lastSeenAtMs": 1744675200000 }, "whatsapp": { "chunkIds": ["c_12ab", "c_56cd"], "importance": 0.61, "lastSeenAtMs": 1744588800000 } } ```
v1.1 · 4.8 Persistence``` { "cron": { "chunkIds": ["c_4a2f", "c_891b", "c_3e7d"], "importance": 0.72, "lastSeenAtMs": 1744675200000 }, "whatsapp": { "chunkIds": ["c_12ab", "c_56cd"], "importance": 0.61, "lastSeenAtMs": 1744588800000 } } ```

··· 9 unchanged paragraphs folded ···

v1.0 · 5.2 Task Descriptor```typescript type TaskDescriptor = { keywords: string[]; // e.g., ["cron", "merge", "guardian"] projectId: string | null; // e.g., "tinkerclaw" taskType: string | null; // e.g., "debugging", "writing", "review" }; ```
v1.1 · 5.2 Task Descriptor``` type TaskDescriptor = { keywords: string[]; // e.g., ["cron", "merge", "guardian"] projectId: string | null; // e.g., "tinkerclaw" taskType: string | null; // e.g., "debugging", "writing", "review" }; ```

··· 3 unchanged paragraphs folded ···

v1.0 · 5.3 Score Modifier```typescript function taskConditionedScoring(ctx: RetrievalContext): void { const task = ctx.taskDescriptor; if (!task || task.keywords.length === 0) return; // no task context available
v1.1 · 5.3 Score Modifier``` function taskConditionedScoring(ctx: RetrievalContext): void { const task = ctx.taskDescriptor; if (!task || task.keywords.length === 0) return; // no task context available

··· 1 unchanged paragraph folded ···

v1.0 · 5.3 Score ModifierThe modifier does not replace existing scores — it adds a weighted bonus. Chunks that are already highly relevant to the query remain highly ranked; the task bias adjusts marginal rankings.
v1.1 · 5.3 Score ModifierThe modifier does not replace existing scores — it adds a weighted bonus. Chunks already highly relevant to the query stay highly ranked; the task bias adjusts marginal rankings.

··· 2 unchanged paragraphs folded ···

v1.0 · 5.4 Weight CalibrationThe 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 benchmark (as proposed in J2 §7) is planned for v0.2.
v1.1 · 5.4 Weight CalibrationThe 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 benchmark (proposed in J2 §7) is planned for v0.2.

··· 8 unchanged paragraphs folded ···

v1.0 · 6.1 Threat Model: Agent Self-Corruption2. **Stale override.** The agent learns a new fact ("the meeting was moved to Thursday") but a later consolidation cycle processes an older memory that still says "the meeting is on Wednesday." If the older memory is promoted after the newer one, the durable store now contains a contradiction, and temporal ordering may not resolve it.
v1.1 · 6.1 Threat Model: Agent Self-Corruption2. **Stale override.** The agent learns a new fact ("the meeting was moved to Thursday") but a later consolidation cycle processes an older memory that still says "the meeting is on Wednesday." If the older memory is promoted after the newer one, the durable store now holds a contradiction, and temporal ordering may not resolve it.

··· 4 unchanged paragraphs folded ···

v1.0 · 6.2 Gate Mechanism```typescript async function contradictionGate(ctx: WriteContext): Promise<WriteDecision> { const candidate = ctx.chunk; const existingFacts = await queryRelatedFacts(candidate);
v1.1 · 6.2 Gate Mechanism``` async function contradictionGate(ctx: WriteContext): Promise<WriteDecision> { const candidate = ctx.chunk; const existingFacts = await queryRelatedFacts(candidate);

··· 4 unchanged paragraphs folded ···

v1.0 · 6.2 Gate Mechanismreturn { action: config.contradictionMode, // 'warn' or 'block' reason: formatContradictionReport(contradictions), }; } ```
v1.1 · 6.2 Gate Mechanismreturn { action: config.contradictionMode, // 'warn', 'block', or 'supersede' (§9.5) reason: formatContradictionReport(contradictions), }; } ```

··· 1 unchanged paragraph folded ···

v1.0 · 6.3 Modes: Warn, Block, Supersede### 6.3 Modes: Warn vs Block
v1.1 · 6.3 Modes: Warn, Block, Supersede### 6.3 Modes: Warn, Block, Supersede
v1.0 · 6.3 Modes: Warn, Block, SupersedeThe gate operates in one of two modes, configured per-plugin:
v1.1 · 6.3 Modes: Warn, Block, SupersedeThe gate operates in one of three modes, configured per-plugin:
v1.0 · 6.3 Modes: Warn, Block, Supersede**Warn mode** (default): The contradiction is logged to `contradictions.jsonl` with the candidate chunk, the conflicting existing facts, and a timestamp. The write proceeds. The agent (or its operator) can review the log periodically to identify patterns of self-corruption.
v1.1 · 6.3 Modes: Warn, Block, Supersede**Warn mode**: The contradiction is logged to `contradictions.jsonl` with the candidate chunk, the conflicting existing facts, and a timestamp. The write proceeds. The agent (or its operator) can review the log to identify patterns of self-corruption.
v1.0 · 6.3 Modes: Warn, Block, Supersede**Block mode**: The write is refused. The candidate chunk is not promoted to MEMORY.md. The blocked write is logged with the same detail as warn mode, plus the `blocked: true` flag. This is the safer mode but risks losing legitimate updates if the contradiction detector produces false positives.
v1.1 · 6.3 Modes: Warn, Block, Supersede**Block mode**: The write is refused. The candidate chunk is not promoted to MEMORY.md. The blocked write is logged with the same detail as warn mode, plus a `blocked: true` flag. This is safer than warn but risks losing legitimate updates when the detector produces false positives.
v1.0 · 6.3 Modes: Warn vs BlockThe default is warn mode because the contradiction detector is conservative — blocking on false positives would cause information loss, which is worse than allowing a contradiction that can be manually reviewed.
removed in v1.1
not in v1.0
v1.1 · 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 non-lossy resolution that the v1.0 paper's two-mode design lacked; §9.5 describes the mechanism and its grounding in memory-core's now-live bi-temporal substrate.
not in v1.0
v1.1 · 6.3 Modes: Warn, Block, SupersedeIn v1.0, warn was the default precisely because block is lossy. With supersede available (§9.5), the default question is revisited there.

··· 3 unchanged paragraphs folded ···

v1.0 · 6.4 Relationship to J1 and J4**J4 CORTEX's consistency preservation** maintains agent identity across sessions by ensuring the PersonaState structure remains coherent. The contradiction gate protects not just the persona but the entire fact base from inconsistency. Where CORTEX guards the "who am I?" question, the contradiction gate guards the "what do I know?" question.
v1.1 · 6.4 Relationship to J1 and J4**J4 CORTEX's consistency preservation** maintains agent identity across sessions by keeping the PersonaState structure coherent. The contradiction gate protects not just the persona but the entire fact base from inconsistency. Where CORTEX guards the "who am I?" question, the contradiction gate guards the "what do I know?" question.

··· 3 unchanged paragraphs folded ···

v1.0 · 7.1 The Gap: Messages Used Once and Never Queried Are LostENGRAM's pointer-based compaction (J1) replaces evicted messages with time-range markers containing topic hints. The pointers are sufficient 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.
v1.1 · 7.1 The Gap: Messages Used Once and Never Queried Are LostENGRAM's 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.
v1.0 · 7.1 The Gap: Messages Used Once and Never Queried Are LostMemory-core's nightly dreaming (J5) can recover some of this content by promoting memories that were recently searched for. But dreaming only promotes what has been queried. Content that was used once — read, acted upon, and never referenced again — is permanently lost after compaction.
v1.1 · 7.1 The Gap: Messages Used Once and Never Queried Are LostMemory-core's 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.

··· 5 unchanged paragraphs folded ···

v1.0 · 7.2 Capture Protocol```typescript async function compactionCapture(ctx: CompactionContext): Promise<void> { const messagesToEvict = ctx.messages; const captured: CapturedChunk[] = [];
v1.1 · 7.2 Capture Protocol``` async function compactionCapture(ctx: CompactionContext): Promise<void> { const messagesToEvict = ctx.messages; const captured: CapturedChunk[] = [];

··· 17 unchanged paragraphs folded ···

v1.0 · 8.1 Plugin Manifest```json { "id": "tinkerclaw-memory-enhancements", "name": "MNEMOSYNE — Memory Enhancement Suite", "version": "0.1.0", "description": "Hippocampus 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"], "default": "warn" } }, "compactionCapture": { "enabled": { "type": "boolean", "default": true }, "trivialityThresholdTokens": { "type": "number", "default": 20 } } } } ```
v1.1 · 8.1 Plugin Manifest``` { "id": "tinkerclaw-memory-enhancements", "name": "MNEMOSYNE — Memory Enhancement Suite", "version": "0.1.0", "description": "Hippocampus 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 } } } } ```

··· 2 unchanged paragraphs folded ···

v1.0 · 8.2 Hook RegistrationsAll four hooks are registered in `activate()` and are individually gated by their `enabled` config flag. Hook registration order:
v1.1 · 8.2 Hook RegistrationsAll four hooks are registered in `activate()` and individually gated by their `enabled` config flag. Hook registration order:
v1.0 · 8.2 Hook Registrations1. `conceptIndexLookup` on `retrieval_pre` — runs first, may short-circuit. 2. `taskConditionedScoring` on `retrieval_pre` — runs second, only if concept index did not fire. 3. `contradictionGate` on `before_message_write` — synchronous, returns allow/warn/block. 4. `compactionCapture` on `before_compaction` — synchronous, must complete before eviction proceeds.
v1.1 · 8.2 Hook Registrations1. `conceptIndexLookup` on `retrieval_pre` — runs first, may short-circuit. 2. `taskConditionedScoring` on `retrieval_pre` — runs second, only if concept index did not fire. 3. `contradictionGate` on `before_message_write` — synchronous, returns allow/warn/block/supersede. 4. `compactionCapture` on `before_compaction` — synchronous, must complete before eviction proceeds.

··· 1 unchanged paragraph folded ···

v1.0 · 8.3 v0.1 Status| Feature | Status | Notes | |---------|--------|-------| | Hippocampus 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 not wired) |
v1.1 · 8.3 v0.1 Status| Feature | Status | Notes | |---------|--------|-------| | Hippocampus 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 not wired) | | Bi-temporal supersede (§9.5) | Core-ready, plugin-pending | memory-core ships the validity columns, search predicate, and `supersede-writer`/`invalidate`; MNEMOSYNE must route the gate's decision into them |

··· 3 unchanged paragraphs folded ···

v1.0 · 8.5 Deployment```bash # Build the plugin cd <agent-workspace>/extensions/tinkerclaw-memory-enhancements pnpm build
v1.1 · 8.5 Deployment``` # Build the plugin cd <agent-workspace>/extensions/tinkerclaw-memory-enhancements pnpm build

··· 12 unchanged paragraphs folded ···

v1.0 · 9.3 The Complementarity ArgumentEnterprise-wiki and personal-assistant are not just different products — they produce different *failure modes*. An enterprise wiki fails when it returns outdated information (solved by version history and review processes). A personal assistant fails when it contradicts itself (solved by contradiction gating) or loses context (solved by compaction capture). Designing for one set of failures does not address the other.
v1.1 · 9.3 The Complementarity ArgumentEnterprise-wiki and personal-assistant are not just different products — they produce different *failure modes*. An enterprise wiki fails when it returns outdated information (solved by version history and review processes). A personal assistant fails when it contradicts itself (solved by contradiction gating and supersession) or loses context (solved by compaction capture). Designing for one set of failures does not address the other.

··· 4 unchanged paragraphs folded ···

not in v1.0
v1.1 · 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-Resolver### 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-Resolver
not in v1.0
v1.1 · 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-ResolverThe 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) 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.
not in v1.0
v1.1 · 9.5.1 Division of Labor: J2 Owns the Schema, J14 Owns the Behavior#### 9.5.1 Division of Labor: J2 Owns the Schema, J14 Owns the Behavior
not in v1.0
v1.1 · 9.5.1 Division of Labor: J2 Owns the Schema, J14 Owns the BehaviorThe schema work belongs to J2 HIPPOCAMPUS; the write/retrieve *semantics* belong here. As of this revision, the J2 substrate has landed in memory-core and can be verified directly in the codebase:
not in v1.0
v1.1 · 9.5.1 Division of Labor: J2 Owns the Schema, J14 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 `validityStart`, `validityEnd`, `ingestionTime`, `supersededBy`, and `SearchParams` gains `temporalMode: "current" | "valid-at" | "all"` plus `asOfTime`. - The read path is already temporal-aware: `manager-search.ts` builds a `temporalPredicate()` clause 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.
not in v1.0
v1.1 · 9.5.1 Division of Labor: J2 Owns the Schema, J14 Owns the BehaviorSo J14's claim is no longer "gated on a future J2 migration." The substrate exists. What MNEMOSYNE owns is routing the contradiction gate's decision into it and keeping task scoring validity-aware.
not in v1.0
v1.1 · 9.5.2 The Supersede Write Decision#### 9.5.2 The Supersede Write Decision
not in v1.0
v1.1 · 9.5.2 The Supersede Write DecisionMNEMOSYNE 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`) stamps `validity_end` and `superseded_by` on rows that are *still open*, never deleting and never resurrecting a closed row. The behavior is non-lossy: the prior row stays queryable in `all` / `valid-at` mode.
not in v1.0
v1.1 · 9.5.2 The Supersede Write Decision``` type WriteDecision = | { action: "allow" } | { action: "warn", supersedes, reason } | { action: "block", supersedes, reason } | { action: "supersede", supersedes: ChunkId[], reason } // resolves the conflict
not in v1.0
v1.1 · 9.5.2 The Supersede Write Decisionfunction contradictionGate(ctx): candidate = ctx.chunk decision = decideSupersede(db, candidate, config.contradictionMode) // memory-core if decision.action == "allow": return decision logContradiction(candidate, decision) // still append to contradictions.jsonl return decision // 'warn' | 'block' | 'supersede'
not in v1.0
v1.1 · On apply (supersede mode only): close each prior interval as of the candidate's validity_start applySupersede(db, decision, { id: candidate.id, validityStart: now }) ```# On apply (supersede mode only): close each prior interval as of the candidate's validity_start applySupersede(db, decision, { id: candidate.id, validityStart: now }) ```
not in v1.0
v1.1 · On apply (supersede mode only): close each prior interval as of the candidate's validity_start applySupersede(db, decision, { id: candidate.id, validityStart: now }) ```memory-core's `decideSupersede` defaults its mode argument to `"supersede"`, and an `onClosed` producer hook emits a `recipe-supersede` trail event so the UI renders a supersede icon when an interval is actually closed. The MNEMOSYNE side is the configuration default it advertises — see §9.5.4.
not in v1.0
v1.1 · 9.5.3 Validity-Aware Task Scoring#### 9.5.3 Validity-Aware Task Scoring
not in v1.0
v1.1 · 9.5.3 Validity-Aware Task ScoringBecause the read-path predicate (§9.5.1) already excludes superseded chunks in `current` mode, the scoring change is small. In `valid-at` / `all` modes, where historical chunks *are* returned, `taskConditionedScoring` (§5.3) must not let a stale-but-textually-similar fact out-rank the current one on task bias alone. The guard down-weights — not zeros — a candidate whose validity interval does not contain the query's `asOf`:
not in v1.0
v1.1 · 9.5.3 Validity-Aware Task Scoring``` function taskConditionedScoring(ctx): if not ctx.taskDescriptor: return asOf = ctx.asOfTime ?? now for cand in ctx.candidates: rel = computeTaskRelevance(cand.metadata, ctx.taskDescriptor) if cand.validityEnd != null and cand.validityEnd <= asOf: rel = rel * HISTORICAL_TASK_DAMP # down-weight, don't zero cand.score += TASK_WEIGHT * rel ```
not in v1.0
v1.1 · 9.5.3 Validity-Aware Task ScoringA related correctness note: recency-based importance (`computeImportance`) should derive its recency tier from `validity_start`, not `updatedAt` — 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.
not in v1.0
v1.1 · 9.5.4 The One Genuine Product Decision#### 9.5.4 The One Genuine Product Decision
not in v1.0
v1.1 · 9.5.4 The One Genuine Product Decisionmemory-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, observe the `contradictions.jsonl` false-positive rate, then consider flipping the default in v0.3 — is the one this paper recommends.
not in v1.0
v1.1 · 9.5.5 What Is Not Yet Built#### 9.5.5 What Is Not Yet Built
not in v1.0
v1.1 · 9.5.5 What Is Not Yet BuiltTwo pieces from the original design remain unimplemented and are stated honestly as future work:
not in v1.0
v1.1 · 9.5.5 What Is Not Yet Built1. **Cascade retraction.** `temporal-invalidation.ts` is explicit that there is *no cascade in v1*: 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 item, and it overlaps the Zettelkasten edge work (J2 Upgrade 9, the `backlinks` table already in the 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.
not in v1.0
v1.1 · 9.5.5 What Is Not Yet BuiltA 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.

··· 9 unchanged paragraphs folded ···

v1.0 · 10.3 Contradiction Detection Depth- **Semantic contradictions**: "The project is going well" vs "The project has critical blockers." - **Temporal contradictions**: Facts that were true at time T but not at time T+1, where the detector cannot determine which is current. - **Implication contradictions**: "All tests pass" followed by "Feature X is broken" (the second implies at least one test should fail).
v1.1 · 10.3 Contradiction Detection Depth- **Semantic contradictions**: "The project is going well" vs "The project has critical blockers." - **Implication contradictions**: "All tests pass" followed by "Feature X is broken" (the second implies at least one test should fail).
v1.0 · 10.3 Contradiction Detection DepthDeeper contradiction detection using LLM-assisted semantic comparison is planned for v0.3.
removed in v1.1
not in v1.0
v1.1 · 10.3 Contradiction Detection DepthTemporal 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.

··· 1 unchanged paragraph folded ···

v1.0 · 10.4 BenchmarksNo formal benchmarks have been run comparing O(1) concept index retrieval against hybrid search. The theoretical complexity analysis (§4.7) predicts constant-time retrieval, but wall-clock measurements on the production corpus (878K events, ~2,000 concepts) are needed to quantify the actual speedup. Benchmarking against the CORF-annotated dataset from J2 is planned for v0.2.
v1.1 · 10.4 BenchmarksNo 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.

··· 4 unchanged paragraphs folded ···

v1.0 · 11. ConclusionMNEMOSYNE 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. The plugin architecture provides failure isolation, upgrade independence, and marketplace distributability. Two features are live in production (v0.1); two are scaffolded and awaiting entity extraction and task descriptor wiring (v0.2). 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.
v1.1 · 11. ConclusionMNEMOSYNE 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. The plugin architecture provides failure isolation, upgrade independence, and marketplace distributability. Two features are live in production (v0.1); two are scaffolded and awaiting entity extraction and task descriptor wiring (v0.2). The contradiction gate's most consequential evolution — bi-temporal supersession (§9.5) — is no longer speculative: 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. 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.

··· 5 unchanged paragraphs folded ···

v1.0 · Changelog- **v1.0 (2026-04-16):** Initial paper. Covers 4 features (hippocampus O(1) index, task-conditioned scoring, contradiction gate, compaction capture), v0.1 plugin scaffold with 680 LOC, v0.2 roadmap.
removed in v1.1
not in v1.0
v1.1 · Changelog- **v1.1 (2026-06-02):** Added §9.5 Bi-Temporal Validity — the contradiction gate's evolution from logger to resolver via supersession, grounded against the now-live memory-core substrate (`validity_*`/`ingestion_time`/`superseded_by` columns + `idx_chunks_validity` in `memory-schema.ts`; `temporalPredicate()` in `manager-search.ts`; `decideSupersede`/`applySupersede`/`invalidate` in `engram/supersede-writer.ts` + `temporal-invalidation.ts`). Added `supersede` as a third contradiction mode (§6.3, §8.1 configSchema, §8.2). Corrected the status table (§8.3) and limitations (§10.3/§10.4) to reflect the landed schema. Stated honestly what is NOT built (no cascade in v1, chunk-level not fact-level granularity, ingestion-time vs event-time boundary). Tightened prose throughout (removed product-claim of a specific corpus size where unverifiable; trimmed hedges). Abstract and §1.3 updated to name the bi-temporal contribution. - **v1.0 (2026-04-16):** Initial paper. Covers 4 features (hippocampus O(1) index, task-conditioned scoring, contradiction gate, compaction capture), v0.1 plugin scaffold with 680 LOC, v0.2 roadmap.

Changed paragraphs in the same form, for scripts: JSON · Markdown