Source-linked AI summary

TOKI: A Bitemporal Operator Algebra for Contradiction Resolution in LLM-Agent Persistent Memory

Ziming Wang

arXiv:2606.06240v1cs.DBcs.AI

TL;DR

Production contradiction-resolution heuristics for LLM-agent memory leave their isolation assumptions and admitted write-time anomalies undeclared. TOKI types them as bitemporal operators with a dual-row schema and soundness guarantees; across eight systems, it excludes all three anomalies while keeping the judge on the write path.

  • Problem

    Production contradiction-resolution heuristics do not declare which isolation level they assume or which write-time anomalies they admit.

    Source: §1 · p. 1
  • Method

    TOKI types four production heuristics as bitemporal operators over a dual-row schema, with isolation preconditions and provenance that preserves losing facts.

    Source: §1 · p. 1
  • Results

    Across eight systems, every audited baseline admits at least one anomaly while TOKI excludes all three with the judge retained; its audit-row defence moves LoCoMo by 0.86.

    Source: §1 · p. 2
  • Takeaways & Limitations

    TOKI supplies a write-time correctness contract for production strategies whose isolation assumptions and provenance obligations are otherwise undeclared.

    Source: §6 · p. 12

    The cross-system LoCoMo comparison is underpowered and makes no superiority claim.

    Source: §6 · p. 12

Abstract

from arXiv · show

Persistent memory for an LLM agent is a write-heavy substrate: every belief update is a versioned write, and a new claim may contradict a stored one. Production systems use four resolution heuristics (last-writer-wins, evidence-weighted merge, await-confirmation, per-rule policy), yet none declares the isolation level it assumes or the write-time anomalies it admits. We show that contradiction resolution is write-time concurrency control and make the missing contract explicit. TOKI types the four heuristics as one family of bitemporal operators over a dual-row schema, each with an isolation precondition and a provenance annotation that preserves the losing fact in an audit row. Four soundness theorems close the contract across isolation, schema, and provenance, lift the guarantees to operator pipelines, and extend the fold operators to n-ary conflict sets. A tightness companion proves that, within the relational schedule model, keyed logging of the adjudicating judge is necessary for replay consistency, which every audited baseline omits. A verdict matrix over eight systems localizes the gap: every baseline that keeps a language-model judge on the write path admits at least one of three write-time anomalies (replay inconsistency, belief-drift skew, audit erasure); a content-addressed engine-layer comparator avoids them only by removing the judge, and TOKI alone excludes all three while keeping it. On its one natural-workload slice the audit-row defence moves LoCoMo by 0.86, and ablating the typed memory layer removes 0.49 accuracy on 1,444 answerable LoCoMo questions; the cross-system comparison stays underpowered and claims no superiority. The contribution is the contract: a write-time correctness specification, proved sound across isolation, schema, and provenance, pinning the guarantee every production heuristic assumes but no deployed system makes explicit.

1 INTRODUCTION

Persistent agent memory uses several contradiction-resolution heuristics, but they do not declare their isolation assumptions or admitted write-time anomalies. TOKI makes that contract explicit, and the paper reports that it excludes all three anomalies while retaining a language-model judge on the write path.

Problem

  • Production strategies include last-writer-wins, evidence-weighted merge, await-confirmation, and per-rule policy, but none declares its isolation assumption or admitted write-time anomalies.BeliefShift [51, Tab. 5] leaves up to 42% of cross-session contradictions unresolved across seven language-model families.Source: §1 · p. 1

Motivation

  • Adversarial writes can corrupt later retrieval when the store lacks a defensible record of what it overwrote.The audit row preserves the losing fact for recovery.Source: §1 · p. 1

Approach

  • TOKI types the four heuristics as bitemporal operators over a dual-row schema, with isolation preconditions and provenance that preserves the losing fact in an audit row.The workflow detects contradictions on a subject-predicate key and commits a current row beside an audit row.Source: §1 · p. 1, Figure 1 · p. 2

Contributions

  • Four soundness theorems cover isolation, schema, and provenance, lift guarantees to operator pipelines, and a tightness result makes keyed judge logging necessary for replay consistency within the relational schedule model.The paper reports that every audited baseline omits keyed judge logging.Source: §1 · pp. 1–2

Empirical evidence

  • Across eight systems, every audited baseline admits an anomaly while TOKI excludes all three with the judge retained; its audit-row defence moves LoCoMo by 0.86.Ablating the typed memory layer removes 0.49 accuracy on 1,444 answerable LoCoMo questions.Source: §1 · p. 2

2 BACKGROUND

TOKI builds on bitemporal data, multiversion isolation, and K-semiring provenance for the LLM-agent write path. It defines the facts and conflicts its operators resolve, then specifies the isolation and provenance vocabulary used by the algebra.

2 BACKGROUND

  • The framework combines bitemporal data, multiversion isolation, and K-semiring provenance as its classical substrates for the agent write path.This background establishes the core object, contradiction event, and vocabulary used by the later algebra.Source: §2 · p. 2

2.1 Bitemporal facts and the contradiction event

  • A bitemporal fact records a subject-predicate-object with valid and system times, provenance, and confidence; shared-key disagreement plus overlapping valid time defines contradiction.Under the closed-open convention, contradiction holds for nine Allen base relations; histories use seven event types.Source: §2.1 · pp. 2–3

2.2 Isolation levels and provenance semirings

  • Isolation guards are indexed over RC ⪯ SI ⪯ SR with an orthogonal callback axis, while K-semiring provenance annotations make resolved losers algebraically recoverable.Carrier choice is decorative on the isolation axis but load-bearing on the provenance axis.Source: §2.2 · p. 3

3 THE TOKI OPERATOR ALGEBRA

This section presents TOKI as a typed algebra of bitemporal operators over a dual-row schema, with soundness contracts for isolation and provenance that extend to operator pipelines and n-ary conflicts. It characterizes keyed judge logging for replay consistency under a boundedly nondeterministic judge in the relational schedule model, and describes a standard-SQL implementation using typed operators, a dual-row schema, and an as-of predicate.

3.1 The dual-row schema

  • TOKI stores current and audit rows in one 11-column bitemporal table, while default retrieval filters to current rows and preserves answers to existing relational-algebra queries.The row_kind discriminator separates current from audit slices; Proposition 5 establishes the query-compatibility claim.Source: §3.1 · p. 3

3.2 Four typed operators

  • The four production strategies become typed operators that select a winner, invalidate the loser in system time, and emit an audit tuple under strategy-specific isolation preconditions.Last-writer-wins uses RC, evidence-weighted merge SI, await-confirmation RC plus callback, and per-rule resolution a serializable policy-table pin.Source: §3.2 · pp. 3–4

3.3 Soundness: What Toki Guarantees

  • Isolation guards exclude N1 and N2 when their required levels hold, while audit-row provenance excludes N3 by preserving each consumed loser’s provenance.The N2 defense is per named (subject, predicate) partition; the judge-log defense requires operators to read the keyed row before issuing a judge call.Source: §3.3 · pp. 4–5
  • Per-instance recovery from a carrier polynomial is possible exactly when the provenance degree for the erased row is at least two, which only the multidegree carrier preserves among the three shipped carriers.Boolean and multilinear carriers cap degree at one, while multidegree retains positive exponents.Source: §3.3 · p. 6
  • Sequential operator pipelines inherit the join of their isolation preconditions and the maximum of their schema requirements, lifting per-operator exclusions and audit-row guarantees.The stated composition contract covers fixed-order steps on one contradicting pair under a wrapping transaction.Source: §3.3 · pp. 6–7
  • For n pairwise-contradicting rows on one partition, last-writer-wins and evidence-weighted folds produce order-independent winners and merged provenance, with audit provenance dominating every loser.The stated confluence check covers n from 2 through 8.Source: §3.3 · p. 7
  • For n-ary conflict sets, the ⊕t and ⊕p folds return a permutation-invariant winner and merged provenance that dominates every fact, including the winner.The winner is selected by a total preference order: version time for ⊕t and confidence, then version, then identity for ⊕p.Source: §3.3 · p. 7
  • Under a boundedly nondeterministic judge, noncompliant systems admit N1, while H1-compliant systems at serializable judge-log reads exclude it in the relational schedule model.The lower bound does not cover deterministic oracles or systems that precompute verdicts offline.Source: §3.3 · pp. 7–8
  • Replay consistency decays toward zero for noncompliant baselines that re-query the judge, while TOKI’s committed keyed-log verdict keeps it at one.This trajectory applies to bounded-nondeterminism keys and is charted in Figure 6.Source: §3.3 · p. 8

3.4 The Toki System

  • TOKI implements the algebra in roughly 2,700 lines of Python on an unmodified relational engine, using standard SQL rather than native bitemporal support.Its implementation combines four typed operator classes, a dual-row schema, and an SQL:2011 as-of predicate for retrieval and audit replay; the write path records the adjudicated vote before operator commit.Source: §3.4 · p. 8

4 EMPIRICAL VALIDATION

The evaluation tests TOKI’s anomaly guarantees, defence mechanisms, operating costs, provenance carriers, and theorem predictions. Across eight systems, every agent-memory baseline admits at least one write-time anomaly, while TOKI excludes all three; the cross-system utility comparison remains underpowered.

4.1 Every agent-memory baseline admits at least one anomaly

  • TOKI alone excludes all three write-time anomalies while keeping a judge on the write path; every agent-memory baseline admits at least one, and WorldDB avoids them by removing the judge.The verdict matrix reports both design-path claims and running-code observations.Source: §4.1 · p. 9, Table 4 · p. 9

4.2 The audit-row defence moves LoCoMo by +0.86

  • +0.86 is the audit-row defence’s paired-bootstrap effect on its primary LoCoMo slice (CI [0.76, 0.94]); constructed controls saturate at +1.00.The natural-workload result does not support an end-to-end utility-superiority claim.Source: §4.2 · p. 9, Figure 2 · p. 10

4.3 Latency stays sub-linear on the single-process envelope

  • Across 0 to 10^5 facts, p50 latency stays between 3.88 and 4.15 ms and p99 remains under 18.20 ms; the study makes no scalability claim.These measurements bound the single-process envelope.Source: §4.3 · p. 9, Figure 3 · p. 10

4.4 Verdicts are carrier-invariant; recall is K-load-bearing

  • Every matched carrier-by-defence cell defends at 1.00, while token recall separates provenance-retaining carriers from the Boolean reduct.The carrier sweep finds verdicts invariant across carriers, but recall depends on the carrier’s natural order.Source: Table 5 · p. 10, §4.4 · p. 10

4.5 Every theorem’s predicted 0/1 boundary matches measurement

  • Observed admit rates match the predicted 0/1 boundaries across five structural grids, including iso-level guards, schema changes, partition pins, carrier sweeps, and operator pipelines.The grids include 1,364 pipelines up to length five.Source: §4.5 · p. 10, Figure 4 · p. 11
  • Replay consistency for non-compliant variants falls below 0.5 by re-query 3 and reaches about 0.06 by re-query 24; TOKI’s committed verdict stays at 1.0.The measured trajectory tracks the stated closed form on bounded-nondeterminism keys; deterministic-oracle keys are excluded from the rate.Source: §4.5 · pp. 10–11, Figure 6 · p. 11

4.6 Cross-system transparency ledger

  • All three measured cross-system utility confidence intervals cover zero, and the paper makes no utility-superiority claim from this underpowered comparison.The comparison has pre-registered power 0.42 for δ = 0.05 on n = 50.Source: §4.6 · p. 11

4.7 Memory-layer ablation on the answerable pool

  • Removing the typed memory layer lowers answerable-factual LoCoMo accuracy from 0.540 to 0.048, a paired Δ = +0.492 on 1,444 questions.The pool excludes speculative and adversarial-emptygold categories.Source: §4.7 · p. 12

5 RELATED WORK

Prior work supplies concurrency, bitemporal, and provenance machinery, while agent-memory systems and retrieval-side benchmarks leave the isolation precondition and write-time correctness contract undeclared. TOKI brings those pieces to the LLM-agent write path and identifies the gap in existing systems.

Agent-memory systems

  • Agent-memory systems use varied conflict and audit strategies, but none types the isolation precondition on the operator surface.WorldDB comes closest with engine-layer Merkle provenance, yet leaves the isolation signature and provenance algebra untyped over the agent write path.Source: §5 · p. 12

Classical concurrency and provenance

  • Classical concurrency, bitemporal data models, and K-relation provenance provide ingredients TOKI composes, but not the LLM-agent write path.The cited concurrency work covers schedule anomalies and isolation, while bitemporal and provenance frameworks address versioned facts and lineage.Source: §5 · p. 12

Novelty

  • TOKI types the (N1, N2, N3) triplet over the agent-memory (subj, pred) partition and bridges LLM-judge calls into the classical concurrency alphabet.It records the K-axis separation that locates the carrier’s load-bearing role on the schema axis.Source: §5 · p. 12

Retrieval-side benchmarks

  • Retrieval-side benchmarks measure retrieval or end-to-end outcomes and leave open a write-time specification with named predicates and soundness theorems.Other benchmarks test observable anomaly outcomes or audited updates at the benchmark layer.Source: §5 · p. 12

6 LIMITATIONS AND CONCLUSION

TOKI’s conclusion is that its typed operators and soundness results specify a correctness contract that production strategies leave implicit. The appendices map claims to evidence and develop the bridge from judge events to logged reads, including its schedule-level mechanism and scope.

6 LIMITATIONS AND CONCLUSION

  • The evaluation makes no superiority claim: cross-system LoCoMo cells are underpowered, the controlled MultiTQ slice is not natural-workload evidence, and the contention experiment is single-node.The N1 guarantee is at intra-deployment replay granularity for a fixed decoder tuple; the lower bound covers boundedly nondeterministic oracles, not deterministic oracles or engine-layer reconcilers.Source: §6 · p. 12
  • TOKI types four production strategies as bitemporal operators, proves soundness across three axes, and excludes all three anomalies while retaining the language-model judge on the write path.Its keyed-log discipline tightly characterises N1 exclusion; across eight systems, it alone combines judge retention with exclusion of all three anomalies.Source: §6 · p. 12

A CLAIM-TO-EVIDENCE MAP

  • The claim-to-evidence map links each load-bearing claim to reviewer risks, evidence, regeneration commands, licensed conclusions, and scope limits.Reproduction tokens point to a make target or the reproducibility runbook.Source: A CLAIM-TO-EVIDENCE MAP · p. 13, Table 6 · p. 13

B FORMAL WITNESSES AND PROOFS

  • The formal-witness appendix pairs graded results with minimal schedules, formal statements, proofs, changed scope, and commands to regenerate empirical anchors.Its supporting material includes tightness witnesses, prompt-sensitivity separation, composition results, and the expanded guard surface.Source: B FORMAL WITNESSES AND PROOFS · p. 14

B.1 Graded result: the judge-callback bridge

  • The judge-callback bridge maps each judge call and callback wait to keyed logged reads, allowing serializable isolation to serialize reads against operator commits.The appendix presents a minimal witness, an empirical replay, and the key-multiplicity invariant.Source: §B.1 · p. 14

B.1.1 Minimal witness schedule.

  • Below serializable isolation, an interleaved write can make a replay observe a different committed vote; serializable isolation on judge_log prevents that schedule.The witness keys the replay schedule by read set and decoder tuple.Source: §B.1.1 · p. 14

B.1.2 Formal statement.

  • The bridge maps each judge call to a read at its (R, θ)-keyed judge_log row and each callback wait to a keyed callback_log read, preserving key multiplicity.The resulting N1 predicate is a fuzzy read on the keyed log, excluded at serializable isolation.Source: §B.1.3 · p. 14, §B.1.2 · p. 14

B.1.3 Proof.

The appendix details the judge-bridge scope and the N1 lower bound, then shows that audit-erasure recovery depends on the provenance carrier’s ability to preserve and identify summands. Its empirical anchors distinguish keyed from unkeyed replay and compare carrier choices.

B.1.3 Proof.

  • The bridge’s empirical protocol reports 1.00 pass rates in 1,000 trials at schedule length 12, with every row preserving key multiplicity.The main-text guarantee fixes the decoder tuple; cross-deployment behavior with different tuples is treated separately.Source: §B.1.4 · p. 14

B.2 Graded result: the N1 lower bound

  • Without a keyed judge log, two calls on the same read set admit N1 with probability 2p(1 − p) when the oracle votes 1 with empirical probability p.The rate is zero for deterministic votes and is maximized at p = 1/2.Source: §B.2 · p. 14, §B.2.2 · p. 14

B.2.2 Formal statement.

  • A system that keys the judge log and holds it at serializable isolation admits N1 at rate 0 on every read set, independent of p.On replay, the keyed system reads the committed row rather than invoking the oracle again.Source: §B.2.2 · p. 14, §B.2.3 · p. 14

B.2.4 Scope and empirical anchor.

  • TOKI’s dispatched configuration admitted N1 at mean rate 0.0, while unkeyed baselines and the stripped ablation had mean rates between 0.167 and 0.204.All 245 candidate pairs in TOKI’s run were served from the log rather than the oracle.Source: §B.2.4 · p. 15

B.3 Graded result: carrier recoverability

  • Audit-erasure recovery is non-trivial exactly when the K-relation carrier retains enough structure to keep erased provenance reachable.The appendix pairs the recoverability result with carrier-level witnesses and a counterfactual ablation.Source: §B.3 · p. 15

B.3.1 Minimal witness schedule.

  • After the second transaction commits, the current row retains only the new fact, while the audit row combines the old and new provenance with strategy and timestamp.Recovering the old provenance requires it to remain identifiable as a summand in the carrier.Source: §B.3.1 · p. 15

B.3.2 Formal statement.

  • The multidegree multiset carrier recovers erased provenance on every instance, the multilinear carrier only when monomials remain distinguishable, and the Boolean reduct loses it when values collapse.The multidegree carrier keeps summands identifiable; Boolean disjunction retains no multiplicity.Source: §B.3.3 · p. 15, §B.3.2 · p. 15

B.3.3 Proof.

The counterfactual ablation varies only the provenance carrier while holding the schedule and operator algebra fixed, and its recovery results differ substantially by carrier.

B.3.3 Proof.

  • The multidegree carrier recovered 375 of 375 instances at accuracy 1.0, the multilinear carrier recovered 106 of 375 at accuracy 0.683, and the Boolean carrier recovered none at accuracy 0.345.A 200-instance run showed the same 1.0/0.0 ordering for multidegree and Boolean carriers.Source: §B.3.4 · p. 15

B.4 Graded result: the composition theorem

Sequentially composed operators require the lattice join of their component preconditions, and the appendix gives tightness witnesses for the isolation and audit-row guarantees. It also separates fixed-prompt engine replay guarantees from cross-deployment prompt sensitivity.

B.4 Graded result: the composition theorem

  • A composite operator is well-typed exactly when the schedule satisfies the component-wise lattice join of its isolation and callback preconditions.Per-table SRpolicy remains an annotation on the named policy table, while the composite schema requirement is the maximum of the per-step requirements.Source: §B.4 · p. 15, §B.4.3 · p. 16

B.4.1 Minimal witness schedule.

  • For ⊕p ◦⊕t, RC alone permits a split-snapshot evidence read, while the composite requires RC ∨ SI = SI.The join excludes the schedule admitted by RC alone.Source: §B.4.1 · p. 15

B.5 Witness schedules for the two soundness theorems

  • Eight witness schedules—seven for classical anomalies and one for audit erasure—hold the immediate predecessor of the corresponding defending level.Together with the soundness inductions, the witnesses establish the theorems’ if-and-only-if claims.Source: §B.5 · p. 16, §B.5.1 · p. 16, §B.5.2 · pp. 16–17

B.5.2 Schema-axis witness for audit erasure.

  • At the base schema, the N3 schedule leaves only the newer provenance recoverable; the audit-row refinement retains the loser’s provenance alongside the winner.The provenance reachability argument applies to commutative semirings with natural order.Source: §B.5.2 · p. 17
  • The seven iso-axis witnesses are parametric in the provenance carrier because their read, write, commit, and abort event schedules omit provenance annotations.The current-row projection leaves the witness verdicts unchanged when lifted to the dual-row schema.Source: §B.5.1 · p. 16, §B.5.2 · p. 17

B.5.3 Induction case ledger for the seven classical anomalies.

  • The induction ledger pairs each classical anomaly’s guard level with the conflict-graph invariant preserved by an appended operation and a tightness witness below the guard.The A5B case is detailed in the main-text proof; the remaining six cases follow the same template.Source: §B.5.3 · p. 17, Table 7 · p. 17

B.6 Judge prompt-sensitivity separation

  • For a fixed judge parameter θ, SR on judge_log excludes replay inconsistency; deployments using different prompts can nevertheless commit different votes.Cross-deployment stability depends on the workload-and-judge boundary measure, not the engine’s isolation lattice.Source: §B.6 · p. 18
  • On the PARTIAL slice, 42 of 46 unstable Haiku items show prompt-only disagreement, compared with zero temperature-only and four involving both axes.The four-band Haiku sweep used n = 75 per band; the three additional judges were swept on PARTIAL only.Source: §B.6 · p. 18, Table 8 · p. 19

B.7 Write-path configuration composition

The write-path configuration lemma distinguishes read-path invariance, which composes, from write-path perturbations, which can propagate non-monotonically. The appendix connects these guarantees to operator preconditions and their reference implementation.

B.7 Write-path configuration composition

  • Read-path invariance is closed under sequential composition, but write-path dependence can propagate non-monotonically through intermediate storage state.The configuration lemma does not cover source-code changes to storage or operator implementations, which receive a fresh commit pin.Source: §B.7 · pp. 19–20
  • In the multi-seed sweep, read-path invariance held within every seed, while a write-path cell perturbed the baseline triple on four of five seeds.The composite case was observed indirectly in cross-system runs; matched-retrieval cells isolated the path on three paired systems and two datasets.Source: §B.7 · pp. 19–20

B.8 Operator-precondition witnesses and the composition table

  • The four operator preconditions are RC, SI, RC+cb, and SRpolicy; pairwise composition requires their component-wise join, with SR applying only to the named policy table.Table 10 enumerates 16 ordered pairs, all exercised by integration tests.Source: §B.8 · p. 20, Table 10 · p. 20

B.9 Expanded anomaly guard surface

  • Table 11 separates anomaly-guard representation, checking, and enforcement across the isolation and schema axes.The main paper retains a review-facing summary; this appendix provides expanded wording.Source: §B.9 · p. 20, Table 11 · p. 21

C.1 Dual-row bitemporal schema; C.2 The four operator algorithms

  • The dual-row schema stores current facts and loser lineage, while each pure operator returns a stamped winner and an AuditRow under its typed isolation precondition.All four operators share provenance merging and audit-row construction; their winner selectors differ.Source: §C.1 · p. 21, §C.2 · p. 22

C.3 Transaction boundary at the ingestion seam

  • The ingestion seam closes the loser, inserts the winner, then persists the audit row; the caller owns transaction commit and rollback.This sequence implements the operator’s Fact × Fact → (Fact, Audit) output at the storage boundary.Source: §C.3 · p. 22

C.4 Isolation pin per session

  • The PostgreSQL backend pins each worker transaction to SERIALIZABLE, while the DuckDB reference path relies on typed annotations and a single-incumbent invariant.The PostgreSQL path supplies multi-process serializable evidence; the DuckDB path demonstrates the abstraction’s implementation.Source: §C.4 · pp. 22–23

C.5 Judge-log write ordering

  • The dispatcher logs each judge vote under the contradiction signature and parameter pin before resolution and the commit hook.Synchronous ordering supplies the keyed-log condition structurally rather than leaving it to caller discipline.Source: §C.5 · p. 23

C.6 Schema-lift conservatism

The audit-row schema adds a current/audit discriminator while preserving answers to queries written over the original base columns. The accompanying pipeline and verdict-ledger material specifies how the comparison is scoped and documented.

C.6 Schema-lift conservatism

  • Every Qbase query returns the same answer on the audit-row schema as on the base table containing only current-kind rows.The lift filters current rows at table scans and preserves existing query constructors; audit retrieval remains available without rewriting existing read paths.Source: §C.6 · p. 24

C.7 Memory-pipeline decomposition

  • The algebra specifies contradiction resolution on the write path and candidate set, while leaving retrieval and answer synthesis choices unconstrained.Pipeline accuracy deltas isolate the algebra axis only when retrieval policies and synthesis stages match.Source: §C.7 · p. 24

D.1 Reading a cell

  • Imported-cell verdicts use pinned commits and deterministic-judge runs; six of fifteen imported cells abstain for structural reasons.The abstentions arise because a deterministic stub cannot witness judge-vote divergence or because the upstream schema lacks the confidence-weighted partition needed to define N2.Source: §D.1 · p. 25, §D.2 · p. 25, §D.4 · p. 27

D.2 Pinned commits

  • The manifest pins each clone to a revision, including a paper revision for WorldDB and the in-repository implementation for Toki.The imported Zep cell additionally pins its Cloud service boundary.Source: §D.2 · p. 25

D ADAPTER VERDICT LEDGER

  • The witness ledger records each system-predicate verdict with its mechanism, source, and raw-log path, making the verdict cells auditable.Claim and Wire columns distinguish the structural model from runtime adapter evidence.Source: D ADAPTER VERDICT LEDGER · p. 24, §D.3 · p. 25

D.3 Witness ledger

  • The ledger’s Graphiti, Letta, Zep, and mem0 v3 rows record concrete anomaly witnesses, including missing audit records and unpinned judge calls.For example, Graphiti’s transcribed N1 and N3 cells admit the predicates, while mem0 v3’s imported N3 history has no audit entry naming the superseded fact.Source: §D.3 · p. 26
  • Toki excludes N1, N2, and N3 using judge-table serializability, partition serializability, and the audit-row schema lift, respectively.WorldDB also excludes all three at the engine layer, using a deterministic reconciler and content-addressed ancestry rather than a language-model judge.Source: §D.3 · p. 26

D.5 AnomalyWire deployment-configuration scope

The deployment-configuration analysis distinguishes read-path knobs from write-path inputs and tests how they affect anomaly verdicts. The cross-system LoCoMo measurements are small and underpowered, with intervals that do not establish a winner.

D.5 AnomalyWire deployment-configuration scope

  • Anomaly verdicts are constant across read-path configurations but need not remain constant across write-path configurations.On mem0 v3, four read-path perturbations preserved the baseline verdict triple, while a custom adjudicator instruction flipped N2 to trigger.Source: §D.5 · p. 27

D.6 Cross-system measurement protocol

  • Δaccuracy was −0.04 for mem0 v3, −0.08 for Graphiti, and +0.02 for Zep; all three paired 95% confidence intervals cover zero.The comparison used n=50 per measured row; the reported cross-system comparison makes no superiority claim.Source: §D.6 · p. 28, Table 18 · p. 28
  • The cross-system study had power 0.42 for δ=0.05 at n=50, placing measured |Δ|≤0.08 within its stated detection envelope.The LongMemEval-S pilot reported n=5 and was classified as retrieval-bound rather than algebra-bound.Source: §D.6 · p. 28

E EXPERIMENT PROTOCOLS AND STATISTICS

  • The protocol cards fix each experiment’s estimand, sample construction, random seed, bootstrap method, correction, and regeneration path.The G2 grid pairs three defences with three benchmarks, using a single pinned judge model for extraction, synthesis, and adjudication.Source: E EXPERIMENT PROTOCOLS AND STATISTICS · p. 29

E.1 G2 utility (3×3 defence-by-benchmark grid)

The G2 utility study tests three defences on matched and off-target benchmarks using paired accuracy deltas. The matched diagonal results survive joint correction, while the stated conclusion is limited to benchmark-specific paired gains and off-target abstention.

E.1 G2 utility (3×3 defence-by-benchmark grid)

  • Each defence raises paired accuracy on its matched benchmark and abstains off-target under the nine-cell Holm correction at α=0.05.The study uses paired accuracy deltas; these do not measure absolute headroom over a no-memory baseline.Source: §E.1 · p. 29
  • Three positive confirmatory results survive joint Holm and Benjamini–Hochberg correction, while judge-pin and all three cross-system cells remain nonsignificant.The joint correction covers seven paired-accuracy tests; judge-pin evidence is structural, and the cross-system comparison claims no superiority.Source: §E.1 · p. 29
  • Audit-row on LoCoMo rejected at Holm rank 2 (exact p=2.3 × 10^-13), and partition-SR on MultiTQ rejected at rank 1 (exact p=1.8 × 10^-15).The six off-diagonal controls show abstention on non-target benchmarks, although audit-row and partition-SR controls saturate against a synthetic skew admitted by every cell.Source: §E.1 · p. 29

E.2 G3 systems performance (five axes)

The G3 measurements characterize latency and throughput across workload axes, with sub-linear scaling on concurrency and AS_OF selectivity, linear conflict-rate decay, and a flat audit-retention tail. A small PostgreSQL pilot confirms serialization failures under contention, while the reported p99 results have limits on single-query axes.

E.2 G3 systems performance (five axes)

  • The p99 statistic uses only 30 samples on the single-query axes, so it does not support tail-percentile ranking there.The mean trajectory is identified as the primary scaling signal.Source: §E.2 · pp. 29–30, Table 20 · p. 30
  • Mean latency scales as x^0.86 on writer concurrency and AS_OF selectivity; throughput falls 62.7% as conflict rate rises from 0 to 1, while audit-retention p99 is similar at 104× and 0× retention.The concurrency and selectivity fits have R^2 values of 0.992 and 0.990; the 104× setting reads at 13,093 μs versus 14,477 μs at 0×.Source: §E.2 · p. 31, Figure 8 · p. 31
  • Four of five axes contain a p99 decrease as the input grows, but each reversal coincides with high CV and overlapping mean bootstrap intervals.The authors attribute this pattern as consistent with small-sample p99 tail variance, not a mean-monotone violation.Source: §E.2 · p. 31
  • In a PostgreSQL 17.6 pilot, serialization failures rose from 0 at concurrency 1 to 18 at concurrency 2 and 25 at concurrency 4.The three-run pilot supports the conclusion that SERIALIZABLE aborts conflicting writers, but not a latency comparison with DuckDB.Source: §E.2 · p. 31

E.3 G4 carrier ablation

G4 finds that anomaly-defence verdicts are invariant across provenance carriers, while concrete write-identity recovery depends on the carrier. The later grids test structural predictions, concurrency behavior, and n-ary confluence, followed by the artifact’s reproducibility setup.

E.3 G4 carrier ablation

  • Matched operator-defence cells reach 1.00 and off-target cells 0.00 across carriers; multi-degree provenance recovers 375/375 write identities, multilinear recovers 106/375, and Boolean recovers 0/375.The matched operator diagonal reaches 0.94 for await-confirm on N1, 0.88 for evidence on N2, and 0.98 for per_rule on N3, versus a last-writer-wins floor no higher than 0.24.Source: §E.3 · p. 32, Table 22 · p. 32, Table 21 · p. 32

E.4 G5 structural grids

  • The G5 grids match the typed guard predictions, including the unique role of (subj, pred)-SR in eliminating N2 across partition sizes and contention levels.These rates are exhaustive schedule censuses, not probabilities; the composition grid includes a modeled 0.02 noise floor on dominating cells.Source: §E.4 · p. 32, Table 23 · p. 33

E.5 Cross-system slice

  • All four cross-system N1 rate comparisons have |t| < 2, consistent with the shared-oracle prediction but not a formal equivalence result.Five seeds per system leave the Welch tests underpowered for tiny effects.Source: §E.5 · pp. 32–33

E.6 Multi-writer concurrency: the operator-to-isolation mapping under real contention

  • On PostgreSQL 17.10, read committed admits lost updates at rate 1.00 under every multi-writer condition, while repeatable read and serializable exclude them by aborting writers.Serializable also uniquely excludes write skew and phantoms in the companion grids; Figure 9 depicts the anomaly-by-isolation mapping.Source: §E.6 · p. 33, Figure 9 · p. 34, Table 24 · p. 34

E.7 N-ary conflict-set confluence grid

  • For conflict sets of two through eight facts, every permutation yields the same winner and merged provenance, which dominates every member under the K-semiring order.The judge-logged dispatcher records a stable winner identity under an order-independent set key and replays it after a crash.Source: §E.7 · pp. 34–35

F ARTIFACT REPRODUCIBILITY RUNBOOK / F.1 Build environment

  • The runbook packages source, configuration, build environment, input-generation procedures, workloads, and figure/table scripts to support independent reproduction of the main-text numeric claims and G1 verdict matrix.The reference implementation uses a locked Python environment and a containerized reviewer build.Source: F ARTIFACT REPRODUCIBILITY RUNBOOK · p. 35, §F.1 · p. 35

F.2 The command catalogue

  • A shared Makefile routes runnable surfaces; only the live-LLM repro-g2 path requires network access beyond optional DOI resolution.The command catalogue states the outputs, network requirement, and approximate runtime for each target.Source: §F.2 · p. 35

F.3 Deterministic judge versus live LLM

  • Most experiments use a deterministic hash-seeded judge stub, whereas the G2 utility slice uses a live judge at temperature zero and records prompt and output hashes for audit.The live path can be reviewed against its trace hashes without reissuing the provider call.Source: §F.3 · p. 35

F.4 Data provenance

This block records the data and artifact provenance, then bounds the empirical and theoretical claims. The limits include workload and deployment scope, oracle assumptions, and open extensions to the calculus.

F.4 Data provenance

  • Bitemporal-core and wire experiments generate inputs from pinned seeds, while the G2 utility slice uses LoCoMo, LongMemEval-S, and MultiTQ traces with recorded partition traces and judge replay data.Imported adapters pin upstream systems to exact commits and verify revisions before running.Source: §F.4 · pp. 35–36

F.5 Archival plan / F.6 Per-claim map

  • A version-frozen Zenodo archive is planned but has no DOI yet; the per-claim map links each main-text claim to its evidence object, reproduce token, runner, seed, and pinned commit.Precomputed verdict and runtime ledgers, plus the reviewer Dockerfile and seed manifest, are included in the artifact.Source: §F.5 · p. 36, §F.6 · p. 36

G.1 G2 off-target controls measure mechanism stress under saturating perturbation

  • The G2 audit-row defence moves its natural-workload LoCoMo slice by +0.86, but saturating controls prevent a specificity or end-to-end utility-superiority claim.The reported interval is [0.76, 0.94], and the judge-pin estimand is absent from this grid.Source: §G.1 · p. 37

G.2 G3 SERIALIZABLE saturation is disclosed honestly under concurrency / G.5 The single-process envelope makes no distributed-deployment claim

  • The G3 cost envelope is a single-process DuckDB measurement; its PostgreSQL pilot exposes serialization failures, and distributed scalability remains unaddressed.The concurrency fit is μ∼c^0.86 with R^2 = 0.992; the distributed provenance-aware quorum question remains open.Source: §G.2 · p. 37, §G.5 · p. 37

G.3 Cross-system utility is reported as transparency, with intervals covering zero

  • On a shared LoCoMo slice, all three measured Toki-versus-baseline confidence intervals cover zero, and the study is underpowered to detect a small superiority margin.The stated power is 0.42 for δ = 0.05 at n = 50; the paper reports downstream utility as statistically indistinguishable at this scale.Source: §G.3 · p. 37

G.4 The N1 lower bound holds for boundedly nondeterministic oracles / G.6 The N1 defence holds at intra-deployment replay granularity

  • The N1 lower bound applies to boundedly nondeterministic judge oracles, while keyed-log replay guarantees apply within one deployment for a fixed decoder tuple.Deterministic oracles and engine-layer reconciliation fall outside the lower-bound hypothesis; model upgrades and prompt drift change the decoder tuple.Source: §G.4 · p. 37, §G.6 · p. 38

G.7 Open Problems

  • Open problems include confidence-aware indexing, cross-modal similarity predicates, distributed adaptive keys, and reconciling audit retention with GDPR erasure.The section also identifies compression, retrieval, neuro-symbolic reasoning, and deployment-governance integrations as unresolved directions.Source: §G.7 · p. 38

G.8 Deferred Wire Imports and Benchmark Integrations

Several candidate wire imports and benchmarks were deferred after exceeding preset work caps, with blockers documented for future work. The manuscript also separates these deferred extensions from its core contributions and positions the algebra against neighboring literatures.

G.8 Deferred Wire Imports and Benchmark Integrations

  • Five candidate extensions—three active open-source memory projects and two benchmarks—exceeded the preset working-day caps for wire imports or benchmark integrations.The appendix records the cap-and-convert outcomes and their blockers.Source: §G.8 · p. 39, Table 26 · p. 39

G.9 Experimental Extensions for a Future Revision

  • The 2026-05 review classified six compute-bound experimental extensions as strengthening passes rather than load-bearing contributions.Each deferred item is paired with a smallest follow-on protocol.Source: §G.9 · p. 39

H EXTENDED RELATED WORK AND POSITIONING

  • Related work is organized around prior lines that address storage, retrieval, provenance, or belief updates, positioning Toki’s typed write-time operator and isolation contract as the missing piece.The appendix extends the main-text comparison across five additional literatures.Source: H EXTENDED RELATED WORK AND POSITIONING · p. 39

H.1 Agent-memory architectures

Prior work addresses how agents store and retrieve memory, how language models operate over data, and how beliefs change. Toki focuses on the admissible schedules and isolation conditions for applying contradiction-resolution writes.

H.1 Agent-memory architectures

  • Agent-memory systems organize storage and retrieval—MemGPT [53], Generative Agents [54], HippoRAG [32], MemoriesDB [72], and Engram —while Toki types contradiction writes and their isolation conditions.Source: §H.1 · pp. 39–40

H.2 Semantic-operator data systems

  • LOTUS, Abacus [60], and DocETL [64] type language models on read/query paths; Toki instead adjudicates contradictions on writes, making admissible interleavings central.Source: §H.2 · p. 40

H.3 Provenance and semiring lineage

  • Semiring provenance traces query results to inputs; Toki applies this carrier to audit rows so superseded facts remain recoverable under the natural order.Theorem 2 respects the boundary of where provenance for difference by using a semiring without multiplicative inverses.Source: §H.3 · p. 40

H.4 Bitemporal and temporal data models

  • Datomic and XTDB make valid and transaction time first-class; Toki assumes this substrate and types four contradiction strategies above it.RoMem [39] offers a representation-time analogue, rotating obsolete facts out of retrieval without deleting them.Source: §H.4 · p. 40

H.5 Belief revision and contradiction handling

  • Belief-revision work [47] [10] [55] asks which belief should hold; Toki asks which concurrent write schedules are admissible and which anomalies isolation admits.The revision rule and isolation level are independent axes, connected by the alphabet bridge of Lemma 1.Source: §H.5 · p. 41

H.6 Concurrency control and context-memory conflict

  • Toki formalizes replay inconsistency, belief-drift skew, and audit erasure as write-time anomalies; Theorem 5 lower-bounds replay risk without keyed-judge logging.Adaptive concurrency control [84] and altruistic locking tune isolation, while other work characterizes or reconciles memory conflicts [71] [85].Source: §H.6 · p. 41
Loading 2606.06240v1…