Security researcher Jordy Zomer built Lemmalog, a tool that treats an AI model's growing knowledge during an investigation as logical facts rather than raw conversation history, according to his blog, pwning.systems.
Lemmalog uses a Datalog engine, a rule-based logic system, to store facts such as "the attacker controls object A" and automatically derive or retract conclusions as new evidence arrives, Zomer wrote. Large language models handle the fuzzy part, turning natural language, code and debugger output into structured facts, while the Datalog engine handles deterministic reasoning: when a fact changes, dependent conclusions update automatically instead of requiring the model to reread the entire transcript.
On the LongMemEval benchmark, Lemmalog scored an F1 of 0.463 while using roughly 2,700 tokens per question, about 38 times less context than a system that stores everything, Zomer reported. On the adversarial-question subset of the LoCoMo benchmark, Lemmalog reached 70.7% accuracy against 50.9% for an approach that dumps the full conversation into context.
"This started to feel a little familiar to me," Zomer wrote of maintaining evolving facts during an investigation. "This looks like program analysis."
The technique targets a real problem for anyone running long AI-assisted investigations, whether security research or complex debugging: long-running agent sessions accumulate contradictory or outdated conclusions that a model has no reliable way to invalidate. Treating memory as a logic program instead of a transcript gives that process a way to correct itself instead of just getting longer.