Engineering

Why versioned memory is non-negotiable for long-running agents

Stateless retrieval breaks the moment a fact changes. We walk through the Kalairos bitemporal model — event time, ingest time, valid intervals — and why time-travel queries matter for legal, medical, and finance agents.

The first thing every memory system gets wrong is treating facts as immutable. They are not. Q3 revenue targets get revised. Drug dosages get updated. A client changes counsel mid-matter. If your memory system overwrites the old value with the new one, you have lost the answer to the most important question in regulated work: what did we believe on date X?

Kalairos stores every mutation as a new version. Each fact carries event time (when it was true), ingest time (when we learned it), a valid interval (the window during which it held), and a source chain. Queries can ask for the current state, or any historical state, with a single asOf parameter.

This is the bitemporal model from data warehousing, ported into agent memory. It is what lets a legal AI cite the law as it stood on the date of the contract. It is what lets a medical agent answer 'what protocol was in effect when this prescription was written.' Without it, every long-running agent quietly loses the truth as it ages.

The API surface is small: remember(fact), query(question), queryAt(question, timestamp), getHistory(entity). Three to four calls cover most agent workflows. Documentation and a 5-minute starter live at krishnalabs.ai/products.

Kalairos is open source and MIT-licensed. Read the source on GitHub or install with npm install kalairos.