DEV Community

Cover image for I built an implementation of Karpathy's LLM wiki idea (MCP server, open source)
frank chu
frank chu

Posted on

I built an implementation of Karpathy's LLM wiki idea (MCP server, open source)

I built an implementation of Karpathy's "LLM wiki" idea: instead of
doing RAG over your notes at query time, the model maintains a wiki as you add sources. It's an MCP server plus a small web UI. MIT licensed, everything is markdown on your own disk.

https://github.com/frankchu91/mindbase

the web UI

How it works

When you add a source (a thought, a PDF, a URL), the model updates the relevant wiki pages and rewrites context.md, a page that summarizes your current position on the topics you're tracking. When you ask a question later, the answer is mostly already written — the model reads context.md and the linked pages instead of re-deriving everything from raw chunks.

The data layout has three parts with different owners:

sources/       you write, the model reads. Append-only.
context.md     the model writes, you read.
README.md      per-project rules. You write, the model follows.
Enter fullscreen mode Exit fullscreen mode

The append-only guarantee is enforced by tooling, not prompts. Each
operation runs as a sub-agent with a restricted tool list — the agent that rebuilds context.md has no general file-write tool, only one MCP call that does an atomic write with a snapshot of the previous version. I started with prompt-based rules and they held most of the time, which isn't good enough for a layer that's supposed to never be rewritten.

Links between pages are typed (mentions, elaborates, supersedes,
contradicts) and stored in a sqlite index derived from the markdown. The lint command uses this to report actual conflicts, e.g.: a post you saved yesterday claims prefix caching helps long conversations most, but your notes from March say the benefit concentrates in short agentic loops. It also reports orphan pages and stale claims.

There are several other implementations of this pattern in the comments of Karpathy's gist. The main things mine does differently: it runs as an MCP server so it works inside Cursor, Windsurf, Cline, Claude Desktop, and Claude Code, and it has the typed link index for contradiction detection.

Install

Any MCP client — one entry in the config:

{ "mcpServers": { "mindbase": { "command": "npx", "args": ["-y", "mindbase-mcp"] } } }
Enter fullscreen mode Exit fullscreen mode

Claude Code has a fuller version with slash commands and the
sub-agents:

/plugin marketplace add frankchu91/mindbase
/plugin install mb@mindbase
Enter fullscreen mode Exit fullscreen mode

Day to day I use three commands: /mb:contribute to add something,
/mb:build to regenerate context.md, /mb:ask to query. The data
folder can be opened directly as an Obsidian vault.

Current limitations

The interactive ingest flow (model summarizes the source and waits for approval before writing) only works in Claude Code. Other editors get a simpler version. The web UI is for browsing and editing, not running operations. No mobile, no sync.

It's early. I'm looking for around 30 initial users and will help with setup personally. If you try it and something breaks, open an issue — I'm fixing things daily right now.

https://github.com/frankchu91/mindbase

Top comments (0)