Current
Bi-temporal knowledge graph
Benchmark first
Corpora: DocRED · WDC Products · KILT · QASC
Protocol: Measure blocking pairs completeness and reduction ratio, entity pair/cluster F1, relation micro-F1, provenance precision/recall, and multi-hop answer accuracy. Then run graph-off and graph-on retrieval with identical seeds to attribute recall gains. Every projected passage must retain its source node and path.
TemporalFact tracks valid time (when a claim applies) and transaction time (when the system knows it), supporting historical queries and late corrections.
How it works
An assertion is append-only and carries two intervals. A correction learned today may close an older assertion’s transaction interval while preserving its historical valid interval. Query at filters valid time; known_at filters transaction time; both must contain their requested timestamp. Contradictions create explicit edges or superseding revisions instead of destructive overwrites.
Research basisZep uses a temporally aware graph to maintain historical relationships for agent memory, while the temporal knowledge-graph survey catalogs representations and inference tasks for facts that change over time. Mari adds explicit valid-time and transaction-time query semantics; interval boundaries and contradiction policy require conformance tests.
valid timeJan ───────── Aug
transaction timelearned Sep 01 ───▶
from datetime import datetime, timezone
from mari_components.graph import TemporalFact, query_temporal_facts
utc = timezone.utc
facts = [
TemporalFact(
fact_id="refund-window@1",
subject="plan:enterprise",
predicate="refund_window_days",
object=30,
valid_from=datetime(2026, 1, 1, tzinfo=utc),
valid_to=datetime(2026, 9, 1, tzinfo=utc),
recorded_from=datetime(2026, 1, 3, tzinfo=utc),
)
]
visible = query_temporal_facts(
facts,
at=datetime(2026, 6, 1, tzinfo=utc),
known_at=datetime(2026, 8, 1, tzinfo=utc),
)