Layered Bitemporal Graphs
This paper writes down the model behind tiramemsu precisely and proves what its operations guarantee. A statement has its own id, so other statements can point at it. Every statement has two clocks: when the database knew it, and when it was true. The paper asks what it means for such a memory to stay consistent when facts are retracted, corrected and read in the past.
Abstract
Agent memory needs durable statement identity, provenance, and a distinction between when a claim held and when the system recorded it. We study layered bitemporal graphs, in which statement occurrences can reference other occurrences and carry both transaction-time lifetimes and valid-time intervals. On a referentially complete history, reference-closed sets form an Alexandrov topology. Its interior operator, the ground core, characterises minimal retraction cascades, grounded snapshots, and effective valid-time intervals. We give a correction contract that preserves structural closure under explicit patch and lineage conditions; preservation of references excludes changes made to the corrected root. A typed anchor-and-role encoding of metagraphs commutes with well-formed bitemporal snapshots. Compact binary encodings require additional acyclicity for insertion under a live-reference discipline. The calculus is realised in Tiramemsu, an embedded SQLite graph database. Retained checks identified four implementation gaps; endpoint validation, closed retention and transaction-date guards now prevent those counterexamples. These checks support selected contracts rather than certifying the entire implementation. Our contribution is an operational account of recursive temporal reference integrity, rather than a new theory of temporal databases or finite topologies.
The main results
One operator
The ground core keeps the statements whose whole support is present. It is the interior operator of a topology, and the other results follow from it.
Retraction is forced
The cascade is the least retraction that leaves memory grounded. It takes everything it must and nothing more.
Lifetimes nest
Every as-of view is grounded exactly when lifetimes nest along layers. Valid time is a claim, so the reader takes its grounded slice through effective validity.
Bitemporal lifting
For well-formed temporal metagraphs, taking a snapshot commutes with the encoding. Metagraphs get time travel without a temporal theory of their own.
Who it is for
Readers who want to know why tiramemsu behaves as it does: why a retraction takes a fact's layers with it, why the past never changes once written, why a valid-time slice can hold a layer whose fact was not valid then, and why a correction keeps everything that was said about the fact. If you want the ideas without the proofs, start with the companion article.
Status
This is a draft preprint, archived on Zenodo (DOI 10.5281/zenodo.23139228) and prepared for arXiv (primary category cs.DB), not yet submitted there. It has not been peer reviewed. The source, the bibliography, a retained verification artifact and the arXiv upload package are in the repository.
Cite
@misc{pavlyshyn2026layered,
author = {Pavlyshyn, Volodymyr},
title = {Layered Bitemporal Graphs: Statement Identity, Two Clocks,
and Metagraphs as Tags},
year = {2026},
note = {Draft preprint, revision 4. CC BY 4.0},
doi = {10.5281/zenodo.23139228},
url = {https://doi.org/10.5281/zenodo.23139228}
}