LabGuardrails, Agentic & Future-proofingLive · open source plugin

Lorekeep

A local-first plugin that learns you, then keeps your knowledge true as it grows.

Answer first

Lorekeep is a local-first plugin for Claude Code and Cowork that turns the notes, documents and decisions scattered around a business into a maintained, cross-linked wiki an AI agent can read as working context. It builds on Andrej Karpathy's LLM wiki pattern and adds the governance a business needs: a structured interview that learns you before anything is written, a promotion gate no machine can pass alone, and an append-only ledger that makes every line of canon answerable. It is Apache 2.0, open core, and captures nothing silently.

The vault, the graph and the agent that maintains it. Watch it on YouTube.

What problem does Lorekeep solve?

An AI agent is only as good as the context you hand it. In most businesses that context is scattered across inboxes, chat threads, shared drives and the heads of two or three people, so every session starts by re-explaining the same things, and every answer is only as current as whatever happened to be pasted in. The usual fix is a wiki, and the usual outcome is an abandoned one.

Lorekeep treats the knowledge base as something a machine maintains and a human governs. Sources are captured verbatim and never rewritten. The agent drafts the distilled pages. Nothing reaches canon, the small set of files the agent treats as standing orders, until a person accepts the rewrite, and every acceptance is logged with its reason.

What is the LLM wiki pattern it builds on?

In an idea file published as a public gist, Andrej Karpathy set out the pattern: rather than retrieving chunks from raw documents at query time, the model incrementally builds and maintains a wiki that sits between you and the sources. Three layers do the work: immutable raw sources, an LLM-owned wiki of Markdown pages, and a schema file that tells the model how the wiki is structured. Three operations keep it alive: ingest, query and lint.

The reason it holds up is not clever retrieval. It is that the bookkeeping, the part humans quietly stop doing, costs a model almost nothing.

the wiki is a persistent, compounding artifact

Andrej Karpathy, LLM Wiki (gist)

What does Lorekeep add to the pattern?

The gist is deliberately abstract, and on the business case it is explicit that humans reviewing updates is optional: an internal wiki fed by threads, transcripts and customer calls, possibly with humans in the loop. Run that unattended against a real company and the failure mode is not a wrong answer, it is a confident one nobody can trace. Lorekeep makes the human loop the mechanism rather than an option.

  • Local first, capture nothing silently. The system asks and records while you watch. No server, no telemetry, no content leaves the device.
  • Suggest, do not act. Every change to canon arrives as a proposal you promote.
  • Governed promotion. Knowledge moves raw to quarantine to canon. Promotion is a rewrite a human accepts, never an automatic copy.
  • Append-only oplog. Every promotion and demotion is logged with its reason, so "why is this in canon" always resolves to an entry, and every entry is reversible.
  • Index-first retrieval. Answering reads the index, opens only what it points to, and cites the raw source rather than a derived page, so the knowledge base never ends up citing itself.
  • Ripple as proposal. When a new source contradicts canon, the conflict surfaces as a diff into quarantine, never as an unattended write across your pages.
  • Precedence, not a flat pile. Your canon outranks your skills, which outrank forks of third party tools, which outrank stock add-ons. A tool you installed never carries the same weight as a decision you made.

What does the vault look like?

Ordinary Markdown in ordinary folders, so nothing depends on the tool that made it. Obsidian sits on top for the graph view; if it vanished tomorrow every file would still open in anything that reads text.

  • `CLAUDE.md`: the constitution, edited by hand only. This is canon.
  • `raw/`: immutable inputs, read and never rewritten.
  • `wiki/index.md`: the retrieval entry point, read first every session.
  • `wiki/oplog.md`: the append-only promotion and demotion ledger.
  • `wiki/projects/ tools/ clients/ decisions/ people/ concepts/`: the maintained pages.
  • `quarantine/`: ripple proposals and anything pending promotion.

What does it install?

Nine skills and two hooks. The skills are the operations; the hooks load your index at session start, read only, and capture a stub to the raw tier at session end.

  • `onboard`: connects your machine to the vault and runs a fast, adaptive first interview.
  • `elicit`: the deeper interview that keeps learning you over time, one question at a time.
  • `scaffold`: creates the vault tree. Structure only, never content.
  • `ingest`: captures a source verbatim to raw and raises contradictions with canon at the door.
  • `promote`: the one gate to canon, and the thing that writes the oplog.
  • `verify`: the scheduled decay sweep for broken links, orphans, stale claims and promotions with no ledger entry.
  • `spec`: spec-driven build work, specify then plan then tasks then build, through the same proposal-first gate.
  • `curiosity`: a question queue that spends a small budget each session on the gaps ingest and verify found.
  • `scout`: inventories your installed skills and plugins, diffs against last time, and proposes what to adopt, where it sits in precedence, and what to de-fang.

Where does the knowledge actually live?

On your machine, by default and by design. Lorekeep has no server component and sends nothing off-device, which is the whole reason it can hold client work, commercial terms and half-formed thinking without a policy conversation first.

Because the vault is a plain git repository, syncing it is a choice the owner makes rather than a feature the tool imposes: a private remote if you want the same knowledge on a second machine, an encrypted drive if you would rather it never touched a third party, or nothing at all. Whichever you pick, decide it deliberately. A knowledge base worth having is a knowledge base worth protecting.

What is open, and what is not?

The governance primitives are the open core, under Apache 2.0: the interview, the promotion gate, the oplog, index-first retrieval, ripple as proposal, precedence and model routing. Ship patterns, keep payloads. Your content is yours, is never bundled with the plugin, and the methodology it packages is not claimed as anyone's intellectual property.

How do you try it?

  1. Install the Claude Code CLI, then clone the repository: `git clone https://github.com/PIE-AI-cmd/lorekeep.git`
  2. Run Claude Code with the plugin directory: `claude --plugin-dir ./lorekeep`. In Cowork, install the plugin and connect the folder that holds your vault.
  3. Say "onboard me". The onboard skill checks your experience level, scaffolds the vault, asks the few highest-leverage questions and gives you a first win.
  4. Feed it one real source and promote one page. The gate is the thing to feel early, because it is the thing that keeps the vault honest later.

Frequently asked questions about AEO guardrails and agentic search

Is Lorekeep a note-taking app?

No. It is a maintainer, not a store. It writes plain Markdown into a folder you own and can open in any editor, and its job is to keep those files true as they grow: distilling raw sources into pages, flagging contradictions, and refusing to let anything into canon without a person accepting it.

Does my data leave my machine?

No. Lorekeep has no server and no telemetry, and it captures nothing silently. The vault is a folder of Markdown files on your disk. If you choose to sync it to a private git remote or an encrypted drive, that is your decision and your infrastructure, not something the plugin does for you.

Do I need Obsidian to use it?

No. The vault is ordinary Markdown in ordinary folders and works in any editor. Obsidian is useful because its graph view shows the shape of the knowledge base, which pages are hubs and which are orphans, but nothing in Lorekeep depends on it.

Is it tied to one AI model or vendor?

The skills and hooks are packaged for Claude Code and Cowork, but the vault itself is model agnostic: plain text, plain folders, version controlled. Any capable agent can be pointed at it. The lock-in a knowledge base normally creates lives in the file format, and there is not one here.

How long before it is worth the effort?

The benefit compounds rather than arrives. Small gains show within weeks as context stops being re-explained at the start of every session, and the larger advantage lands over a few months once the distilled layer is thick enough that the system answers questions you would otherwise have gone looking for.