v1.1 → v1.2
What changed from v1.1 to v1.2
From v1.1 (2 Jun) to v1.2 (2 Jun): 6,542 words to 6,718 words, 409 words in new or rewritten paragraphs and 233 taken out, 32 paragraphs changed.
Two diagrams and a test plan for the new validity layerTwo figures arrive: one shows the four hooks over the library's search and write paths, the other follows one fact through a supersede event on a timeline. A new section, 9.5.6, lists the tests that would prove the validity layer works: the old period closes, a "now" search returns only the new fact, a dated search returns the old one, and nothing is deleted. The changelog block at the end and the version header are dropped from the text.
v1.1 · 2 June 2026v1.2 · 2 June 2026
v1.1 · MNEMOSYNE: A Plugin-Layered Enhancement Suite for Personal-Agent Memory Systems# MNEMOSYNE: A Plugin-Layered Enhancement Suite for Personal-Agent Memory Systems
removed in v1.2
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.
removed in v1.2
v1.1 · MNEMOSYNE: A Plugin-Layered Enhancement Suite for Personal-Agent Memory Systems---
removed in v1.2
··· 1 unchanged paragraph folded ···
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.
v1.2 · 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." This evolution is no longer speculative — 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.
v1.1 · Abstract---
removed in v1.2
··· 10 unchanged paragraphs folded ···
v1.1 · 1.3 Contributions---
removed in v1.2
··· 14 unchanged paragraphs folded ···
v1.1 · 2.3 Related Systems---
removed in v1.2
··· 5 unchanged paragraphs folded ···
not in v1.1
v1.2 · 3.1 Plugin-Layered DesignFigure 1 shows the full data flow: how a query enters through the two `retrieval_pre` hooks, how a write passes the contradiction gate before promotion, and where the supersede path routes the gate's decision into memory-core's bi-temporal writer (§9.5).
not in v1.1
v1.2 · 3.1 Plugin-Layered Design
··· 9 unchanged paragraphs folded ···
v1.1 · 3.4 Storage Isolation---
removed in v1.2
··· 34 unchanged paragraphs folded ···
v1.1 · 4.8 Persistence---
removed in v1.2
··· 20 unchanged paragraphs folded ···
v1.1 · 5.5 Interaction with Concept Index---
removed in v1.2
··· 20 unchanged paragraphs folded ···
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.
v1.2 · 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 design lacked; §9.5 describes the mechanism and its grounding in memory-core's now-live bi-temporal substrate.
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.
v1.2 · 6.3 Modes: Warn, Block, SupersedeIn v1.0, warn was the default precisely because block is lossy. With supersede available, the default question is revisited in §9.5.4.
··· 4 unchanged paragraphs folded ···
v1.1 · 6.4 Relationship to J1 and J4---
removed in v1.2
··· 24 unchanged paragraphs folded ···
v1.1 · 7.5 Relationship to J1 ENGRAM---
removed in v1.2
··· 15 unchanged paragraphs folded ···
v1.1 · Restart gateway (SIGUSR1 does not reload ES modules) openclaw-restart --full ```---
removed in v1.2
··· 16 unchanged paragraphs folded ···
not in v1.1
v1.2 · 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-ResolverFigure 2 illustrates a single fact's life across a supersede event: fact A is written with an open interval, a contradicting fact B closes A's interval and opens its own, and a `current` query returns only B while a `valid-at` query before B's write still returns A.
not in v1.1
v1.2 · 9.5 Bi-Temporal Validity: From Contradiction-Logger to Contradiction-Resolver
··· 2 unchanged paragraphs folded ···
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.
v1.2 · 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, 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.
··· 2 unchanged paragraphs folded ···
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.
v1.2 · 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`, at the memory module root) 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.
··· 3 unchanged paragraphs folded ···
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.
v1.2 · On apply (supersede mode only): close each prior interval as of the candidate's validity_start applySupersede(db, decision, { id: candidate.id, validityStart: now }) ````decideSupersede` defaults its `mode` argument to `"supersede"`. `applySupersede` exposes an `onClosed(closedIds, reason)` callback that fires only when an interval is actually closed; the production caller (`manager-embedding-ops.ts`) uses that seam to emit a `fork.prefrontal.trailEvent` of kind `recipe-supersede`, so the UI renders a supersede icon. The MNEMOSYNE side is the configuration default it advertises — see §9.5.4.
··· 10 unchanged paragraphs folded ···
v1.1 · 9.5.5 What Is Not Yet Built---
removed in v1.2
not in v1.1
v1.2 · 9.5.6 Test Plan for the Validity Layer#### 9.5.6 Test Plan for the Validity Layer
not in v1.1
v1.2 · 9.5.6 Test Plan for the Validity LayerThe substrate ships with tests; the plugin-side behavior needs its own, matching the subsystem's vitest convention (`pnpm vitest src/memory/...`). The cases that pin the supersede semantics:
not in v1.1
v1.2 · 9.5.6 Test Plan for the Validity Layer- **Supersede closes the prior interval.** Insert fact A (`validity_end = NULL`); write a contradicting fact B in `supersede` mode. Assert A's `validity_end` equals B's `ingestion_time` and B's `validity_end` is NULL, and that both rows are still present — no `DELETE`. - **Current-mode filter.** `search(temporalMode: 'current')` returns B, not A. - **Valid-at query.** `search(temporalMode: 'valid-at', asOfTime: T)` with `A.validity_start < T < B.validity_start` returns A — the "what was true then" path. - **All-mode.** `search(temporalMode: 'all')` returns both A and B. - **Scoring honesty.** In `valid-at` mode a superseded chunk that matches the task descriptor scores below the current chunk despite higher textual similarity (`HISTORICAL_TASK_DAMP` applied). - **Index guard.** `PRAGMA index_list(chunks)` includes `idx_chunks_validity`, since every `current`-mode search filters on `validity_end`.
not in v1.1
v1.2 · 9.5.6 Test Plan for the Validity LayerThe end-to-end target is the §6.1 calendar-conflict reproduction: a recipe-conditioned query at `asOf = now` never surfaces the superseded "Wednesday" fact once the "Thursday" write has passed through the gate in `supersede` mode.
··· 14 unchanged paragraphs folded ···
v1.1 · 10.5 Capture Volume---
removed in v1.2
··· 2 unchanged paragraphs folded ···
v1.1 · 11. Conclusion---
removed in v1.2
··· 2 unchanged paragraphs folded ···
v1.1 · References---
removed in v1.2
v1.1 · Changelog## Changelog
removed in v1.2
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.
removed in v1.2
Changed paragraphs in the same form, for scripts: JSON
· Markdown