AI NewsOpen sourceAnnouncement
Lemmalog's Datalog agent memory uses 45 times fewer tokens than full context
Lemmalog is a five-day-old Rust project that treats an agent's memory as a Datalog database with proof trees, and reports 45 times fewer tokens per question on LongMemEval than the full-context baseline.
Image: GitHub
Why it mattersIf the numbers are confirmed on your own workload, a deductive memory can replace a vector store while giving you a written reason for every fact the agent believes.
Lemmalog is a new open-source project that takes a different approach to agent memory from the vector store that most teams use. Its author's own line is: an agent's memory should be a deductive database, so the agent builds a verifiable model of what it knows and reasons about how that knowledge changes.
The repository was created on 27 August by JordyZomer and has 245 stars in the five days since. It is written in Rust, licensed MIT, and is available as a Rust crate, a command-line REPL, and an MCP server that a harness can call.
What it does
The engine stores facts and stratified rules. When a new fact arrives, only the rules that use it re-run, so a new derivation reuses everything the engine already knows. Every fact the engine has ever derived carries a proof tree that traces back to the source episodes. Ask why the agent believes something and the answer is a chain of rules and inputs, with the exact input events that triggered each rule.
Temporal support is built in. Facts carry valid_from and valid_to timestamps, so an assertion that was true last Tuesday can be marked as no longer true today without deleting it.
The benchmark numbers, and the caveats
The README reports scores from three runs on two standard long-context memory benchmarks. On LoCoMo, F1 is 0.573 plus or minus 0.002, which the author places second of ten systems in the comparison. On LongMemEval, F1 is 0.487 plus or minus 0.011 and accuracy is 0.566 plus or minus 0.009.
The token-efficiency figures are the striking ones. On LongMemEval the engine uses about 2,300 tokens per question against about 104,000 for the full-context baseline, a 45 times reduction. On LoCoMo it uses about 3,200 tokens against about 18,900, a 6 times reduction. In a longer real-agent trace at 500 turns the author reports 2,500 tokens per question against a million for full context, a 400 times reduction.
All of those numbers come from the author. There is no independent replication yet, and the ranking on LoCoMo is against a set of systems the author chose to compare with. Treat the figures as a starting point to reproduce, not as a settled result.
Vector-based memory answers a specific question well: given some new text, what earlier text is similar. It struggles with the questions that show up as an agent does real work: what did the user tell me yesterday about this table, is that still true, and why do I believe it. A deductive store answers those directly, and the proof tree is the audit log a compliance-sensitive team already wants.
The trade-off is that a Datalog schema is code you have to write and maintain. A vector store accepts any text you give it. Lemmalog is worth trying where the agent operates over a knowable domain, such as a customer record, a codebase or a support ticket, and where a wrong answer with no explanation is a real cost. On unstructured chat memory, the vector approach is still easier.
Source
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
