RSSAmplifier

javatask.dev · Jun 7, 2026

Bi-Temporal Edges: Giving Agent Memory a Clock It Can Be Audited Against

0
Sign in to vote or save

Andrii Melashchenko · javatask.dev

A flat memory store can tell you what the agent knows now. It cannot tell you what the agent believed last Tuesday, or where it learned that belief. In a financial compliance review, that gap is an audit finding. In a healthcare system, it is a patient-safety question. In a regulated industrial facility, it is a certification failure.

The mechanism is not better retrieval but a different data model. Bi-temporal edges attach two independent clocks to every relationship in the memory graph, making the store auditable rather than merely fast.

The two clocks#

Every fact an agent holds has two independent time intervals, and conflating them is the source of most temporal reasoning failures.

Valid-time is when the fact was true in the world — the interval from when a configuration setting was applied until it was changed, or when a regulatory rule was in force. Represented as valid_from and valid_until on the edge.

Transaction-time is when the system recorded the fact. The agent may not learn about a change until days after it occurred. This clock captures when knowledge entered the graph, not when the underlying event happened.

The two clocks are independent by design. A fact can be valid in the world for a year before the agent learns it. A fact recorded in the graph may later be discovered wrong — a correction writes a new transaction-time record without altering the original valid-time history. Collapsing both into a single timestamp makes both kinds of error invisible.

Bi-temporal agent memory in three views: one edge carrying two clocks — valid-time (when the fact was true in the world) and transaction-time (when the system learned it); an as-of query timeline showing the same edge resolving to different believed states depending on which past moment is queried; and a lineage strand where every derived belief traces back to its immutable originating episode.

As-of queries and what they buy#

With both clocks on every edge, the memory graph supports time-travel queries: reconstruct the agent’s world-state as-of any past moment without semantic approximation. The query is precise — not “find facts relevant to last Tuesday” but “return all edges whose valid-time interval includes last Tuesday and whose transaction-time was recorded before the audit cutoff.”

An auditor asking why an agent took a specific action needs the memory state at that moment, not a current-state approximation. A bi-temporal graph answers that deterministically; a flat store — or single-timestamp graph — cannot, having already overwritten the prior state. The same property supports compliance workflows that require proving the agent acted on the rules in force at the time — a structural guarantee, not retrofittable with logging.

Knowing when a fact was recorded is necessary but not sufficient. You also need to know where it came from.

Frameworks like Zep implement this through immutable episodes — raw, non-lossy records of every ingested data object. Entity extraction builds the graph from those episodes; every derived node and edge maintains a structural link to its originating episode.

This link makes episode metadata projection work. Metadata tags applied at ingestion time — source system, verification status, data classification — propagate to every downstream graph element. Lineage is embedded in the graph topology, not a separate lookup.

The practical consequence: you can scope retrieval to verified sources by filtering on propagated metadata without deleting unverified data. An agent in a compliance context retrieves only from edges tagged as authoritative, while raw conversational inputs remain undeleted and queryable.

The lakehouse underneath#

The memory graph is a reasoning surface, not the system of record.

The durable substrate is Apache Iceberg on AWS S3 Tables, which provides snapshot isolation and its own time-travel capability at the storage layer. Iceberg’s snapshot model means every table state within the configured retention window is preserved and queryable as-of any prior snapshot — the same append-only, non-overwriting principle as bi-temporal edges, applied to the raw data that feeds graph construction.

The relationship is layered: the lakehouse holds the immutable source data; the graph is a structured projection over it optimized for multi-hop agent reasoning. Bi-temporal edges in the graph build on the immutability guarantee of the lakehouse below — the lakehouse ensures source records are never overwritten; the graph’s two-clock model adds valid-time semantics that Iceberg itself does not provide. When a graph edge needs to be corrected, the source data in the lakehouse is not modified — a new transaction-time record is written and the graph is updated accordingly. The full history remains intact at both layers.

The Digital Coworker series, Part 5 covers the data layer architecture in depth. The Apache Iceberg for Industrial OT series covers the Iceberg mechanics. The design principle: the graph projects over the lakehouse; the lakehouse is the anchor.

Where bi-temporal modeling earns its cost#

Bi-temporal edges add schema complexity and query overhead — not always worth that cost.

They earn their cost in domains with explicit audit requirements — finance, healthcare, regulated industrial environments — where the question “what did the system believe, and when, and from where” has legal or safety weight, and in long-running multi-agent systems where memory state diverges and reconciliation requires knowing when each agent learned what.

They do not earn their cost in short-horizon, single-session agents where state does not persist and no audit trail is required. A flat vector store or simple property graph is the right tool there. The graph-vs-RAG comparison covers that tradeoff directly.

What structured memory defends against#

The Graph-Native Memory for Agents Blueprint documents the six operational failure modes a structured memory graph defends against. Bi-temporal edges are specifically load-bearing for two of them: context rot (stale facts remaining active past their valid-until date) and context collision (the audit surface that makes divergent writes detectable after the fact).

The runtime memory graph and whether the agent used it correctly are separate concerns. Testing memory hygiene across long-horizon sessions is the domain of the evaluation harness.

Read the original on javatask.dev

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.