Toolspublished

Lemmalog Turns Agent Memory Into Datalog State, Cutting LongMemEval Context 38-Fold

The experimental system moves long-running agent work away from recalling old notes and toward maintaining conclusions with explicit support. Its early benchmark results suggest a substantial context-saving path, while leaving the probabilistic extraction step as the central weakness.

By 3 min read
Lemmalog Turns Agent Memory Into Datalog State, Cutting LongMemEval Context 38-Fold

Listen to this story

The audio brief

About 1:41
0:001:41
Read transcript
Lemmalog, an experimental memory engine for long-running AI agents, cut the context sent to an answering model from roughly 104,000 tokens to about 2,700 per question—a 38-fold reduction in tests reported by its creator, Jordy Zomer. The tradeoff is that its memory system is still imperfect. Lemmalog treats an investigation as maintained logical state, rather than a transcript an agent repeatedly rereads. An LLM extracts observations from material such as source code or debugger output, then a Datalog engine applies explicit rules to derive conclusions. Each conclusion keeps provenance: a record of which facts support it. If one fact is retracted, dependent conclusions can disappear, while conclusions with an independent support path remain. That is meant to prevent a disproved observation from quietly keeping its downstream claims alive. On LongMemEval, Zomer reported an F1 score of 0.463, plus or minus 0.010, and accuracy of 0.575, plus or minus 0.004, across three runs. That was below the cited results for PropMem and SimpleMem, but above Full Context. Lemmalog did better on knowledge updates, at 0.579, than on multi-session memory, where it scored 0.211 versus PropMem’s 0.582. The key limitation is upstream: Claude Sonnet 4.6 performs the extraction, and mistakes become bad facts the deterministic rules cannot repair. These are self-reported conversational-memory results, not an independent test of vulnerability research. The next question is whether provenance and retractions work reliably during a real, extended investigation.

Story brief

3 key points

Lemmalog, an experimental memory engine built by Jordy Zomer for vulnerability-research agents, maintains Datalog-derived conclusions so invalidated evidence can retract dependent claims while independently supported claims persist. In Zomer’s reported LongMemEval tests, it reduced per-question context from about 104,000 to 2,700 tokens—roughly 38×—but scored 0.463 F1, behind PropMem and SimpleMem while beating Full...

  1. 01

    Lemmalog reported 0.463 ± 0.010 F1 and 0.575 ± 0.004 accuracy across three LongMemEval runs.

  2. 02

    Its multi-session score was 0.211, versus 0.582 for PropMem; knowledge-updates performance reached 0.579.

  3. 03

    Datalog rules and provenance expose support paths, enabling retractions without deleting conclusions backed by independent derivations.

Long-running AI agents often face a subtle failure: an old observation is disproved, yet its downstream conclusions survive in the model’s reasoning. Lemmalog is an experimental memory engine designed to make those conclusions retractable, treating an investigation as maintained logical state rather than a transcript an LLM must repeatedly reread.

Jordy Zomer built the system for LLM-assisted vulnerability research, where agents may work through source code, debugger output and hypotheses over hours. The core split is deliberate: the LLM extracts messy material into structured observations, while a Datalog engine applies explicit rules to determine what follows from them.

From recalled notes to supported conclusions

The distinction is more than a storage choice. Semantic retrieval can answer which past material seems relevant to a question. It does not inherently establish whether a statement was later disproved or which other conclusions relied on it. Lemmalog’s aim is the second task: determining what remains supported now.

What changes when a fact changes

  • An LLM can turn an observation, such as a pointer relationship found in debugging, into a structured fact for the engine to use.
  • Rules derive conclusions from those facts. When an input fact is retracted, Lemmalog can invalidate the conclusions that depended on it.
  • A conclusion with another independent derivation remains in place, rather than disappearing merely because one supporting path failed.
  • Provenance and validity intervals let the system show why a conclusion was supported and distinguish a current belief from an earlier one.
The reported context gap
~104,000Full-context prompting

Zomer reported roughly 104,000 tokens passed to the answering model under full-context prompting.

~2,700Lemmalog prompting

Zomer reported roughly 2,700 tokens passed per question with Lemmalog, about 38 times less context than the full-context setup.

A smaller prompt is not the same as a stronger memory system

Zomer tested Lemmalog on LongMemEval and LoCoMo using standardized reader models and evaluation procedures; Claude Sonnet 4.6 handled extraction during ingestion. On the described LongMemEval split, it posted 0.463 plus or minus 0.010 F1 and 0.575 plus or minus 0.004 accuracy across three runs.

That score sits below published results cited for PropMem at 0.550 F1 and SimpleMem at 0.480, but above the cited Full Context result of 0.222. The performance profile fits the design goal: a representative knowledge-updates result reached 0.579, while the reported multi-session score was 0.211, versus 0.582 for PropMem.

The deterministic layer starts after an uncertain step

Lemmalog does not eliminate hallucinations at the point where they enter the system. If the extraction model misunderstands evidence or fails to convert an event into a fact, the rule engine has no correct input to maintain. The project also combines its maintained state with hybrid retrieval, rather than positioning logical state as a total replacement for semantic search.

The results are project-reported and have not been independently validated. They also come from conversational-memory benchmarks, not a real vulnerability investigation—the setting that motivated the tool. The consequential next test is whether provenance and automatic retractions keep abandoned exploit paths from returning during that kind of extended work.

Sources

  1. pwning.systemsI accidentally turned LLM memory into program analysis :: pwning.systems