Jordy Zomer · 2026-08-28 · notable
Lemmalog — agent memory as a Datalog database, not a pile of text
Lemmalog is an open-source Datalog engine that acts as memory for LLM agents. Every fact carries its provenance, so changing one fact automatically invalidates the conclusions built on it, using 6-38x fewer context tokens than full transcripts.
Lemmalog swaps an agent's vector-store memory for a Datalog database that tracks why every fact is still believed.
Key specs
| Long mem eval f1 | 0.463 |
|---|---|
| Lo co mo f1 | 0.533 |
| Context saving | 6-38x |
What is it?
Lemmalog stores an agent's memory as a deductive database instead of retrieved text snippets. Jordy Zomer built it after watching LLM agents on long vulnerability-research sessions lose track of which facts were still true and keep reasoning from ideas that had already been ruled out. The engine is written in Rust, released under MIT, and ships an MCP server so Claude Code or Kimi CLI can use it as shared memory.
How does it work?
Facts and rules go into a stratified Datalog program, and every fact carries provenance. Incremental evaluation means a changed fact only re-derives the conclusions that depended on it and drops the ones that no longer hold. Agents can request a proof tree showing why any fact exists, and hybrid retrieval mixes the rule engine with text search. Entity resolution canonicalizes names so the same thing is not stored twice.
Why does it matter?
The measured win is in updates and in resisting stale claims, not raw recall. On the LongMemEval oracle split Lemmalog scores 0.463 F1 using about 2,300 tokens per question, and on LoCoMo it scores 0.533 F1, third of ten systems while using 6x fewer tokens. The write-up reports 0.707 on adversarial questions against 0.509 for full-context prompting, which is the case where an agent must notice a fact was retracted.
Who is it for?
agent builders and security researchers
Try it
cargo run --bin lemmalog