frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Bitemporal provenance in agent memory: What did we believe, when, and why

2•shanrizvi•12h ago
CozoDB, a transactional relational-graph-vector database with embedded Datalog in Rust, went dormant in December 2024. We hard-forked it as MnesticDB (not official CozoDB), under an MPL-2.0 license, to continue Ziyang Hu and the Cozo Project Authors' vision of building a "Hippocampus for AI", or agentic memory.

But agentic memory isn't a pile of current facts with a log of past decisions. It has to track change over time, and be auditable. We've recently shipped several features that make this possible.

First, we added a distinction between valid time (when a fact is true about the world) and transaction time (when the database came to believe it). This allows time travel, the ability to audit the memory at any point and see what knowledge any past decision was based on. Every write draws its transaction time from a crash-safe monotone commit clock, an atomic high-water mark persisted inside the same transaction that commits the data, so the clock can never advance without the write landing, even across a crash. Because the stamp is allocated in the commit critical section, transaction-time order equals commit order equals visibility order, which makes time travel sound.

Then we implemented the semiring provenance framework from Green et al.'s 2007 paper: the same recursive rule computes existence, cost, confidence, or supporting evidence just by swapping the combine operator, instead of a bespoke tracking system per application. In practice, an aggregate like min_cost_k returns not just an answer but the k best derivations behind it, each with the evidence chain that justifies it. And because those annotations are ordinary values, materializing a derivation into a transaction-time relation composes the two features into an annotated belief history. Every derivation carries the transaction time we came to believe it, so an as-of read tells you not just what we believed at T, but why.

Followed by some more improvements:

- Added ::kill and :timeout to provide the ability to interrupt long-running queries.

- Implemented a deterministic greedy join reorder to prevent naively-ordered conjunctions, the kind that an LLM may write, from spinning. 54.5x improvement with identical results.

- Added an opt-in Yannakakis-style per-key factorized count() instead of join enumeration, with a 4-342x improvement with identical results.

It's available on crates.io and PyPI.

https://crates.io/crates/mnestic https://pypi.org/project/mnestic/

If you're building agent memory and want time-travel + provenance in the graph database rather than bolted on, I'd love to exchange notes.

Special thanks to Matthias Autrata for providing valuable feedback and guidance that was critical to implementing the above improvements.

Ask HN: Are systems ready for the first negative leap second?

80•Asmod4n•5d ago•91 comments

Ask HN: Why isn't Google indexing information about the AT Protocol?

43•iameli•15h ago•31 comments

Google deleting all recently inactive accounts without phone number

47•superkuh•19h ago•36 comments

Ask HN: How do you use Vim in the era of AI?

46•rstagi•1d ago•86 comments

Bring seamless PQC encryption into every messenger you already use

4•kvasilev•8h ago•0 comments

Bitemporal provenance in agent memory: What did we believe, when, and why

2•shanrizvi•12h ago•0 comments

Tell HN: I De-Googled Myself

35•degoogled•1d ago•21 comments

Map of All Known Knowledge

4•Abhishek000001•15h ago•8 comments

One Wikipedia page costs your AI agent 68,000 tokens

14•arhamislam5766•1d ago•8 comments

Ask HN: Is anyone experimenting with different ways of using LLMs for coding?

212•yehiaabdelm•1w ago•206 comments

Ask HN: What was the last task where only a frontier model could do it?

24•thedebuglife•1d ago•29 comments

Ask HN: My father died and I need to find my path

4•c4kar•18h ago•5 comments

Ask HN: HN frontpage feels boring now?

50•xeonmc•3d ago•36 comments

Ask HN: Burned Tokens scented candle ideas

5•Tade0•1d ago•16 comments

Ask HN: Where are the good search engines for mathematical formulas?

56•lo0dot0•1w ago•16 comments

Ask HN: Who is hiring? (July 2026)

246•whoishiring•1w ago•405 comments

Ask HN: Is GitHub preparing to go behind a login wall?

56•reconnecting•4d ago•38 comments

Tell HN: Who wants to be hired" posts outpace "Who's hiring" 2 to 1

57•santiagobasulto•4d ago•35 comments

Ask HN: I hate coding agents. Is this skill issue?

18•cmar00•2d ago•18 comments

Ask HN: How has the internet devolved in recent years?

3•fridayblunt•1d ago•1 comments

Ask HN: I am not able to find a job. Should I switch stacks?

12•need_a_work23•2d ago•19 comments

Ask HN: Does anyone let AI agents play games just for fun?

2•nodivbyzero•2d ago•2 comments

You've reached the end!