Skip to main content
AI Tool Radar
OSI-openAgent memory and code knowledge

Lemmalog

JordyZomer

Datalog engine for LLM agent memory, stratified rules, provenance-tracked facts and incremental derivation instead of vector similarity.

317 stars(as of 2026-09-23)View on GitHub

What is Lemmalog?

A Rust Datalog engine built on the thesis that an agent's memory should be a deductive database: base facts are asserted at an LLM extraction boundary, and rules mechanically derive closures, temporal projections and contradiction candidates from them, with every fact carrying provenance back to its source episode. An MCP server with twelve tools (observe, query, why, what_if and more) plugs the engine into Claude Code or Kimi CLI, and a hybrid BM25-plus-entity-graph retrieval layer assembles budgeted context instead of dumping the whole store.

Lemmalog at a glance
FactValue
MaintainerJordyZomer
GitHub stars317 (as of 2026-09-23)
Forks30
LicenseMIT
License typeOSI-open
CategoryAgent memory and code knowledge
StatusRising
Edition2026-09
Last verified2026-09-23

Lemmalog in depth

Most agent-memory tools bet on 'remembering better': bigger embeddings, smarter chunking, a graph database bolted on the side. lemmalog, built by security researcher Jordy Zomer and released in August 2026, makes a different bet entirely: an agent's memory should be a deductive database. Base facts get asserted at the extraction boundary (an LLM turns conversation into triples), and from there a Rust Datalog engine mechanically derives closures, temporal projections and contradiction candidates; the reasoning happens in a verifiable logic engine, not by re-reading a summary and hoping the model gets the ordering right.

The engine is a stratified, seminaive-evaluation Datalog interpreter with bi-temporal facts (valid_from/valid_to), confidence and provenance carried as semiring annotations, and a why() call that returns a proof tree back to the source conversation turn rather than a black-box score. An MCP server exposes twelve tools to Claude Code or Kimi CLI (lemmalog_observe, lemmalog_query, lemmalog_why, lemmalog_what_if among them), so the host model reads the conversation and asserts facts while lemmalog derives everything downstream deterministically. A hybrid retrieval layer then combines BM25 keyword matching with entity-graph boosting to assemble a token-budgeted context, rather than dumping the whole fact store into every prompt.

It fits long-running, structured work where you want to interrogate what the agent believes and why, investigations, audits, multi-session debugging, more than open-ended chat memory. The why() proof trees and the explicit hypothetical what_if primitive (test a fact against the store, then restore it byte-identically) are the kind of feature that matters specifically when you need to trust and audit a derived answer, not just retrieve a plausible-sounding one. It is a fit for teams already comfortable wiring an MCP server into their agent, not a drop-in for someone who wants zero configuration.

This is a three-week-old project with no tagged release yet; install is cargo build from a checkout, not a package manager. All of the reported numbers (LongMemEval, LoCoMo, the synthetic long-horizon eval) are single or triple-repeated runs the project ran itself, and the README is unusually candid about measurement noise: on one benchmark, an answer 'flipped 1.00 to 0.00 across two same-configuration runs' because the model used rejects a temperature parameter. Fact extraction still depends entirely on an external LLM call to turn prose into triples; the Datalog engine reasons over facts, it does not read English itself, so extraction quality is a hard ceiling on everything downstream.

lemmalog is worth watching if deterministic, provenance-tracked reasoning over agent memory, rather than another vector-similarity layer, is what you actually need, and if you are comfortable running pre-release Rust from source. The engineering rigor (differential testing against a brute-force oracle, honest reporting of reverted experiments) is well above what a three-week-old repo usually shows. But there is no packaged release, a small contributor base, and every benchmark number is the project's own single-digit-run measurement; treat it as a serious research prototype worth tracking, not yet a production dependency.

Pros & Cons

Pros

  • A genuinely different architectural bet: facts are asserted and rules derive closures, temporal projections and contradiction candidates deterministically, with why() proof trees back to source episodes rather than similarity search
  • Unusually rigorous validation for a three-week-old project: 450 random programs checked against a brute-force fixpoint oracle, incremental-vs-single-shot equivalence checks, and 2,000-case parser fuzzing
  • Runs its own numbers on two standardized public leaderboards (ProsusAI MemEval's LongMemEval split and LoCoMo) and reports a 2nd-of-10 and mid-pack placement rather than only citing wins

Cons

  • Very early: created 2026-08-27, no tagged release yet, and the maintainer's own README documents engine bugs found and fixed during development
  • Fact extraction still depends entirely on an external LLM call to turn prose into triples; the Datalog engine itself has no language understanding, so extraction quality is a hard ceiling on everything downstream
  • Small team so far (5 contributors, led solo by Jordy Zomer with occasional outside PRs) and no CI badge or release process visible yet

License

MIT (OSI-open)

When it is interesting

Agent-memory setups where deterministic, auditable reasoning over facts (temporal ordering, contradiction detection, multi-hop queries) matters more than semantic recall.

When it is too early

Production use before a first tagged release, or if you need a memory system that doesn't depend on an LLM extraction step.

This repo featured in the 2026-09 edition of the Open-Source AI Radar.