Agent skill

Lemmalog

by JordyZomer in JordyZomer/lemmalog

Externalize working memory and logical state into the lemmalog Datalog engine (MCP).

MITAuto-check passedAgent Workflows

Install Lemmalog

skills CLI
$ npx skills add JordyZomer/lemmalog --skill lemmalog -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JordyZomer/lemmalog lemmalog --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JordyZomer/lemmalog.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lemmalog .claude/skills/lemmalog && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lemmalog
GitHub stars
329
Token cost
~2.8k tokens
SKILL.md length
1,426 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Externalize working memory and logical state into the lemmalog Datalog engine (MCP).

  • Works in 9 steps: Assert as you verify. The moment you… → Install rules when a pattern repeats. If… → Query before re-reasoning. Multi-hop,… → …
  • ANY multi-step task where state should outlive one context window
  • SKILL.md covers Setup, The discipline, Schema conventions and State that changes, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Lemmalog is an agent skill from JordyZomer/lemmalog. Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints, anything needing provenance for its conclusions. Trigger when lemmalog MCP tools are available and the task involves accumulating verified facts, tracking hypotheses or status over time, or repeatedly…

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers, Context engineering and Agent memory. It works with Model Context Protocol. The repository describes itself as: A Datalog engine for LLM agent memory: stratified rules, provenance-tracked facts, incremental derivation, and an MCP server that lets your harness use it as a shared brain. The licence is MIT.

When your agent uses it

  • ANY multi-step task where state should outlive one context window
  • Span agents: long investigations
  • Debugging sessions
  • Multi-agent searches

Example prompts

  • “/lemmalog”

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Assert as you verify. The moment you confirm something — a call
  2. Install rules when a pattern repeats. If you ask the same shape of
  3. Query before re-reasoning. Multi-hop, transitive, or
  4. lemmalog_why before trusting any derived fact. The proof tree
  5. Hypotheses have lifecycles. H --hypothesis--> claim,
  6. Correct by retracting. When you learn an asserted fact was
  7. Reconcile vocabulary, don't enforce it. Name things naturally;
  8. Decide from queries. Derive candidate views — unexplored items,
  9. Report from the engine. Final deliverables render from queries and

What it can do on your machine

Read from SKILL.md and the folder at commit 9cc2cf1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Lemmalog loads about 2.8k tokens when it runs. Until then it costs about 141 tokens; SKILL.md has 1,426 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~141
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JordyZomer/lemmalog at commit 9cc2cf1, republished under its MIT licence (© JordyZomer). 1,426 words, ~2,806 tokens.

Download SKILL.mdSave it as .claude/skills/lemmalog/SKILL.md (or your agent's skills folder).
name
lemmalog
description
Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints, anything needing provenance for its conclusions. Trigger when lemmalog_ MCP tools are available and the task involves accumulating verified facts, tracking hypotheses or status over time, or repeatedly re-deriving the same relationships.

Lemmalog — external working memory

lemmalog is a Datalog engine exposed as MCP tools. It is your working memory: assertions with provenance and confidence, derived consequences computed by rules, hypotheses with lifecycles — persistent across agents and context resets.

The division of labor: the engine owns state and consequence; you own perception and choice; every choice's outcome returns to the engine. A claim that isn't in the engine doesn't exist — nothing durable lives in your context.

Setup

  • The lemmalog_* tools must be registered (see the README of the lemmalog repo). If they are absent, tell the user the one-line registration command and continue without memory — never block the task.
  • Persistence across sessions exists if LEMMALOG_MCP_PATH was set at registration; lemmalog_save forces a snapshot. Snapshots carry rule batches too — installed analyses survive restarts under their batch ids.
  • No MCP access (sub-agents that don't inherit MCP connections, scripts, cron)? lemmalog-cli works on the SAME snapshot: LEMMALOG_MCP_PATH=... lemmalog-cli observe --facts 'S --rel--> O', plus query/retract/context/why/rules/dump. Mutations are visible to the MCP server on its next load and vice versa — but the two hold separate in-process copies, so don't write from both at once: hand sub-agents the CLI and keep the parent on it too, or have the parent only read while a sub-agent writes.

The discipline

  1. Assert as you verify. The moment you confirm something — a call edge, a config value, a decision, a step completed — assert it: S --rel[conf]--> O. Tag read-and-verified facts [1.0] and inferences [0.4]–[0.7]. Do not omit the tag on anything you expect to derive over: the default is 0.9 and confidence is a product down the proof chain, so four hops of "verified" facts land at 0.66 and a deep closure decays to noise. Anchor evidence with located(Entity, "file:line") (or any stable reference) so provenance survives derivation — source references are valid entity tokens as long as they contain no spaces. Never assert what you haven't checked.
  2. Install rules when a pattern repeats. If you ask the same shape of question twice, write the Datalog for it: transitive closures, guard tracking, status rollups, count/min/max/sum aggregates. Rules are experiments: one named batch per analysis idea, validated on install (rejections are spec feedback), backfilled against everything already asserted, lemmalog_uninstall when the idea dies.
  3. Query before re-reasoning. Multi-hop, transitive, or not-X-reachable questions go through rules and lemmalog_query — never mental closure, and never re-deriving what a prior agent derived. For grounded answering, lemmalog_context retrieves the question-relevant facts plus their verbatim source episodes under a token budget, with an attribution contrast (which subjects hold facts on the topic — a question-mentioned party with zero topic facts is a false-premise signal) and, for current-state questions, the latest value per slot with supersessions as history — use it instead of lemmalog_dump when preparing answers; selection beats dumping.
  4. lemmalog_why before trusting any derived fact. The proof tree shows which asserted edges carry it; a chain is only as good as its lowest-confidence edge. Re-verify the weakest edges against their located anchors.
  5. Hypotheses have lifecycles. H --hypothesis--> claim, H --status--> proposed|supported|refuted|validated (supersedes), H --evidence--> ref (accumulates). Test counterfactuals with lemmalog_what_if — temporary facts, answered goal, store untouched.
  6. Correct by retracting. When you learn an asserted fact was wrong — not changed, wrong — lemmalog_retract it: the response lists every derived conclusion that died with it, so the repair is visible, not silent. (A value that merely changed is re-asserted under the same relation; see "State that changes".) After a context reset or another agent's turn, lemmalog_changes with your last epoch resyncs you without re-reading the store.
  7. Reconcile vocabulary, don't enforce it. Name things naturally; when two names mean one thing, local --alias_of[conf]--> canonical via lemmalog_canonicalize. Conflicts surface as alias_conflict facts; they never silently merge.
  8. Decide from queries. Derive candidate views — unexplored items, blocked-by-what, what-needs-attention — and choose among them. The queries propose; you dispose (including off-list when judgment says so). Then assert the decision so state stays complete.
  9. Report from the engine. Final deliverables render from queries and why trees, not from memory. A conclusion's confidence is the product of its edges (the engine multiplies down the proof chain) — deep derivations need high-confidence inputs to stay believable.

Schema conventions

The only shared vocabulary (everything else: invent precisely, and assert describes(Relation, "one-line meaning") so others discover it):

All asserted through the line protocol (the predicate forms below are descriptions, not assertable syntax):

text
kernel_func --located--> vm/vm_map.c:3052     % evidence anchor (multi-valued)
works_at --describes--> person is employed at % self-documenting schema
hyp_1 --hypothesis--> claim in plain words    % lifecycle-tracked claim
hyp_1 --status--> proposed                    % supersedes on change:
                                              % proposed|supported|refuted|validated
hyp_1 --evidence--> vm_map.c:3052            % multi-valued: accumulates
decision_7 --decision--> chose scope X because Y

Evidence objects take a bare source reference (space-free) or a punctuation-free phrase; spaces plus punctuation read as leaked prose and are dropped. Symmetric quotes around subjects/objects are stripped ("mean field" lands as mean field) — multi-word values are fine up to 8 words; compress longer prose into a short name or split it.

Show full SKILL.md (650 more words)Show less

State that changes

Values, quantities, and sets evolve — assert them so the engine can maintain them (these conventions are what the update policy and the aggregates need):

  • Update by re-asserting the same relation. When a value changes, assert the new value under the SAME relation name: the policy supersedes the old fact automatically. Never invent a synonym relation for the new value (uses → switched_to) — that leaves both values open, and every current-state query gets flaky. If you need the history, the superseded fact is still queryable by its validity interval.
  • Bare numbers are integers. launch --monthly_cost--> 120 (never $120 or 120 dollars) — digit-only objects feed sum/count aggregates and </>= comparisons. Mixed forms are opaque symbols.
  • Bare dates order correctly. moved_on with YYYY-MM-DD (or YYYY-MM) objects; derive orderings with a rule (earlier(A, B) :- on(A, D1), on(B, D2), D1 < D2) rather than judging from prose.
  • Evolving sets: one fact per item, plus lifecycle verbs. Track a watchlist/checklist as added(X) per item and watched(X)/done(X) when consumed; current membership is then a rule — pending(X) :- added(X), !watched(X). — not something you recount.
  • Conditional preferences stay conditional. prefers_when(user, lively, with_friends) — never assert the condition itself as a fact unless the source says it holds now.

Grammar

  • Bare capitalized words are variables — quote entity names: reports_to("Alice", Y), never reports_to(Alice, Y).
  • Fact line protocol: S --rel[conf]--> O, one per line.
  • An asserted fact is current(S, rel, O), not rel(S, O). Rule bodies match the triple: reaches(X, Y) :- current(X, depends_on, Y). Writing depends_on(X, Y) instead installs cleanly, reports a backfill count, and then derives nothing — the failure is silent, so check a new rule with one lemmalog_query before building on it.
  • Rule syntax: head(X, Y) :- atom(X, Y), X \= Z. with !atom negation, now(T), comparisons, arithmetic; aggregates only in heads.
  • Time is bitemporal, and the clocks are separate. ts on lemmalog_observe is the valid-from time of the facts in that call; asserted_at (written for you, unix seconds) is when the store learned them; now(T) in a rule is the reader's present, synced to the wall clock on every read. Backdating a batch is safe — it dates those facts without hiding anything asserted after them, and the wall-clock stamp preserves when you learned them. "What did we know at time T?" is believed(E, R, O, T) (query with T bound, e.g. lemmalog_query_deep) — a fact counts only after its asserted_at, even if it was valid earlier. Omit ts unless the facts really are about the past, and give one call one coherent timestamp rather than mixing eras in a single batch.
  • Errors are actionable: every isError result carries the offending input, the reason, and a hint — fix and resend; lemmalog_observe reports dropped lines with reasons, so a zero-add result is loud, not silent.

Anti-patterns

  • Guesses as untagged facts (tag low confidence or don't assert).
  • Batching assertions to the end (assert as you verify).
  • Encoding your judgment as rules (queries inform; you decide).
  • Trusting derived facts without why.
  • Re-deriving in context what the engine already closes.
  • Letting two names for one thing drift (alias them).
  • Renaming a relation when its value changes (supersede, don't fork).
  • Numbers or dates buried in prose objects ("about $50", "last March") — bare values are what the engine can aggregate and order.

Boundary

Stays in your head: in-flight reading, semantic judgment. Must land in the engine: conclusions, state changes, decisions — before you move on — and dead ends most of all: a searched-and-ruled-out avenue is the most valuable thing a future agent can inherit (X --dead_end--> why it failed, where confirmed). Assert them in bulk — one observe call, one line each; fifty at once is fine.

Scope honesty: for a short task that fits one context window, working memory in your head is cheaper — lemmalog pays when state must outlive a window, span agents, or survive a restart. A single-session audit with four items to track is overhead; a multi-day investigation or a swarm reading each other's dead-ends is the payoff case.

© JordyZomer, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/lemmalog of JordyZomer/lemmalog.

Open the folder on GitHubat commit 9cc2cf1

Compare with similar skills

Lemmalog next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lemmalog compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lemmalog this skillJordyZomer/lemmalog329—~2.8kAutomated safety check: PassMIT
Cortex Mem MCPsopaco/cortex-mem313—~2.8kAutomated safety check: PassMIT
Context Mode Searchmksglu/context-mode26k—~250Automated safety check: PassCustom licence
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
MemPalace Setup and OperationMemPalace/mempalace60k—~2.2kAutomated safety check: PassMIT
agentmemory Setup and Diagnosticsrohitg00/agentmemory29k—~1kAutomated safety check: NotesApache-2.0

Similar skills

  • Cortex Mem MCP

    sopaco/cortex-mem

    Persistent memory enhancement for AI agents. An agent skill from sopaco/cortex-mem.

    313 GitHub stars~2.8k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Context Mode Search

    mksglu/context-mode

    Search context-mode's persistent FTS5 knowledge base for previously indexed local project content, documentation, or session memory. Trigger…

    26k GitHub stars~250 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Installs and configures MemPalace as a private local palace, a shared-brain hub or a client of an existing hub, including MCP registration and version-correct initialization.

    60k GitHub stars~2.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Sets up and troubleshoots a local agentmemory install, covering the MCP connection, environment variables, ports, authentication and optional feature flags.

    29k GitHub stars~1k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed

Categories

Questions about Lemmalog

What does Lemmalog do?

Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Lemmalog is an agent skill from JordyZomer/lemmalog. Externalize working memory and logical state into the lemmalog Datalog engine (MCP).

When should I use Lemmalog?

Lemmalog fits situations like: ANY multi-step task where state should outlive one context window; span agents: long investigations; debugging sessions; multi-agent searches.

How do I install Lemmalog in Claude Code?

Run `npx skills add JordyZomer/lemmalog --skill lemmalog -a claude-code`. Or copy the skill folder (skills/lemmalog in JordyZomer/lemmalog) into .claude/skills/lemmalog in your project. Claude Code loads it when a task matches its description.

How do I install Lemmalog in Codex?

Run `npx skills add JordyZomer/lemmalog --skill lemmalog -a codex`. Or copy the skill folder (skills/lemmalog in JordyZomer/lemmalog) into .agents/skills/lemmalog in your project. Codex loads it when a task matches its description.

Can I use Lemmalog in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JordyZomer/lemmalog --skill lemmalog -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lemmalog, .gemini/skills/lemmalog, .github/skills/lemmalog and .opencode/skills/lemmalog in your project.

What does Lemmalog need to run?

SKILL.md names no scripts, command-line tools or credentials: Lemmalog is instructions for the agent only.

Does Lemmalog access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Lemmalog safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Lemmalog use?

Lemmalog is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lemmalog use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Lemmalog?

Skills that share tags, products or a category with Lemmalog: Cortex Mem MCP (sopaco/cortex-mem, 313 stars), Context Mode Search (mksglu/context-mode, 26k stars), Context Mode Output Sandbox (mksglu/context-mode, 26k stars) and MemPalace Setup and Operation (MemPalace/mempalace, 60k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lemmalog?

JordyZomer (a GitHub user) maintains it in JordyZomer/lemmalog, which has 329 GitHub stars. The repository was last updated on October 1, 2026.

Source: JordyZomer/lemmalog on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.