Greener-Dalii35k downloadsKarpathy's LLM Wiki implementation - multi-page knowledge generation with entity/concept pages and conversational query.

An Obsidian plugin that turns your notes into a connected, queryable knowledge base — the Karpathy LLM Wiki idea, built into the editor where you already write.
Obsidian Review Perfect Score • Zero-embedding graph retrieval • 10-language native • Works with every provider Local-first • No backend • GDPR-Friendly
<br>
English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Deutsch | Français | Español | Português | Italiano | Русский
Official Site | Obsidian Marketplace | Blog | Discussions
🤔 Why this plugin? | 🚀 Quick Start | ✨ Features | 🌐 Ecosystem | 🛠️ Headless CLI | 🔍 How Retrieval Works | 🤖 Models | ❓ FAQ
← If this plugin has helped you, feel free to buy me a coffee♥️ or drop a star🌟↗
You write notes. They sit in folders. Finding what relates to what means remembering threads you forgot months ago.
Other open-source reimplementations of Karpathy's LLM Wiki idea exist — but none of them ships as a one-click Obsidian plugin. Most are CLI tools, Claude Code skills, or separate desktop apps. We are the only one with native UI, in-vault storage, and Obsidian's own Graph View built in.
| Karpathy LLM Wiki (this plugin) | nashsu / llm_wiki | SamurAIGPT / llm-wiki-agent | sdyckjq / llm-wiki-skill | atomicstrata / llm-wiki-compiler | |
|---|---|---|---|---|---|
| Delivery & install | ✅ 5 min — One-click Obsidian plugin: Community Plugins → Install → pick provider → Ingest | ❌ 30 min+ — Compile/download Tauri binary, configure CLI | ❌ 15 min — Claude Code subscription + skill install | ❌ 10 min — Claude Code/Codex subscription + skill setup | ❌ 30 min+ — pip install + Python SDK + local server |
| Architecture & dependencies | ✅ Zero dependencies — no vector DB, no embedding model, no external processes (PPR over [[wiki-link]] graph, by design) |
🟡 Embeds Python runtime + sigma.js + sqlite; optional embeddings off by default | 🟡 Uses Claude Code's environment — not self-contained; no embeddings | 🟡 Requires separate platform runtime; no embeddings | ❌ Requires Python + embedding model + vector DB (mandatory) |
| i18n (UI + wiki output) | ✅ 11 languages (independent UI / output) | 🟡 2 (EN / 中文) | ❌ English only | ❌ English only | ❌ English only |
| LLM providers | ✅ 12+ (incl. Codex OAuth, Bedrock, LM Studio, Ollama, Anthropic-compatible, Kimi, GLM, MiniMax, DeepSeek) | 🟡 OpenAI-compatible | 🟡 Subscription via Claude Code | 🟡 Subscription via Claude Code / Codex | 🟡 OpenAI-compatible |
| Retrieval & query pipeline | ✅ 5-stage cascade — Lex → LLM keyword → substring scan → LLM KB fallback → PPR expansion (truncates on first sufficient signal). Personalized PageRank (Haveliwala 2002) + Monte Carlo (Fogaras 2005) | 🟡 2-hop decay only (4-signal heuristic: Adamic-Adar + 2-hop) | ❌ Louvain community detection only | ❌ k-hop previews only (no LLM augment) | ❌ BM25 + semantic over chunks (no graph) |
| Graph visualization | ✅ Obsidian's native Graph View (built in, zero extra size) | ❌ Custom sigma.js + graphology in desktop app | 🟡 vis.js graph.html (separate file) | ❌ Custom sigma.js offline HTML | ❌ Read-only browser viewer |
| Wiki honesty | ✅ "Stage FALLBACK" banner when no wiki source matches your query | ❌ No equivalent | ❌ No equivalent | ❌ No equivalent | ❌ No equivalent |
| Published retrieval benchmark | ✅ PPR @5 = 27.1% vs pure-kNN 24.1% (only published number in this space) | ❌ 58% → 71% only with embeddings enabled, not in our apples-to-apples format | ❌ Not published | ❌ Not published | ❌ Not published |
[[wiki-link]] graph — built in, zero extra bundle size.✅ Yes, if you:
wiki/ within seconds.[[wiki-links]] back into your knowledge graph.[[wiki-links]] — every link you write already enriches retrieval; no separate tagging/embedding/indexing step.❌ No, if you:
Install. Obsidian → Settings → Community plugins → Browse → search "Karpathy LLM Wiki" → Install → Enable. Or visit the Community Plugin page and click Add to Obsidian.
Configure a provider. Open Settings → Karpathy LLM Wiki → pick a provider (OpenAI, Anthropic, Ollama, ChatGPT Plan (Codex OAuth), etc.) → enter API key (not needed for local) → click Test Connection → Save.
Ingest one note. Two ways:
Cmd+P/Ctrl+P → "Ingest single source" → pick any Markdown (or PDF, v1.25.0+) file.Your first wiki pages appear in wiki/sources/, wiki/entities/, wiki/concepts/ within seconds.
Query your wiki. Two ways:
Cmd+P/Ctrl+P → "Query wiki".A right-docked side panel opens (Copilot-style) where you can chat with your wiki. Answers carry [[wiki-links]] back into your knowledge graph.

That's it. The plugin modifies nothing in your original notes — only creates new pages under wiki/. Both Ingest and Query wiki are pinned to the left ribbon for one-click access anytime. (Cmd on macOS, Ctrl on Windows/Linux.)
| Command | What it does |
|---|---|
| 📥 Ingest single source | Cmd+P/Ctrl+P → "Ingest single source" — pick a Markdown or PDF (v1.25.0+) file, get entity/concept/wiki pages. Also: 🖱️ ribbon sticker icon on the active note. |
| 📂 Ingest from folder | Cmd+P/Ctrl+P → "Ingest from folder" — batch-ingest every note in a folder, with smart batch skip |
| 📑 Ingest multiple files | Cmd+P/Ctrl+P → "Ingest multiple files" — pick a subset via a two-pane file tree (with live queue + per-file cancel) |
| 🔍 Query wiki | Cmd+P/Ctrl+P → "Query wiki" — chat with your wiki in a right-docked side panel; answers carry [[wiki-links]]. Also: 🖱️ ribbon message-circle icon. |
| 🛠️ Lint wiki | Cmd+P/Ctrl+P → "Lint wiki" — full health scan: duplicates, dead links, empty pages, orphans, missing aliases, contradictions |
| ⚡ Smart Fix All | inside Lint Modal — one-click causal-order repair with per-phase report |
| 📋 Regenerate index | Cmd+P/Ctrl+P → "Regenerate index" — rebuild wiki/index.md with current pages and aliases |
| ⏹ Cancel | Cmd+P/Ctrl+P → "Cancel current ingestion" or click the status bar — stops cleanly at the next batch boundary |
| 📊 Ingestion history | Cmd+P/Ctrl+P → "View Ingestion History" — searchable UI for past ingestions, lint reports, maintenance runs |

| Before | After |
|---|---|
notes/machine-learning.md (a flat file) |
wiki/concepts/supervised-learning.md with [[bidirectional links]], aliases, source attribution, and an entry in wiki/index.md |
💡 Stay updated. New features, fixes, and performance improvements ship frequently. Settings → Community plugins → Check for updates, or enable automatic plugin updates. 📖 Detailed walkthroughs (installation, PDF setup, multi-provider notes, upgrades) are maintained in GitHub Discussions → Guides.
🌟 If this saved you setup time, a star on GitHub helps others find it.
reviewed: true pages are protected from overwrite..obsidian/plugins/karpathywiki/pdf-cache/ stores converted Markdown keyed by content hash + model + converter version. Three-defense-layer housekeeping: 100 MB total / 1000 entries / 10 MB single-entry caps with LRU-by-mtime eviction.<basename>.pdf.md next to the source PDF (off by default — cache-only is the default).[illegible] / [figure: ...] anti-hallucination markers; markdown-fence-wrapping from small local models is auto-cleaned before cache write.Three paths, pick what fits your setup:
.md files, then ingest them as regular Markdown notes via the plugin's standard pipeline. Most reliable for scientific papers, scanned documents, math-heavy PDFs.📖 Full setup walkthroughs for all three paths (cloud providers, oMLX hardware tiers, MinerU installation, cache housekeeping) → docs/PDF-OCR-GUIDE.md
[[wiki-link]] gives graph-aware multi-hop context.wiki/.127.0.0.1:1455; mobile via device-code. Credentials live only in Obsidian SecretStorage; sign-out clears them. Third-party Codex compatibility, not an OpenAI partnership.The plugin composes with the rest of your Obsidian stack — each tool below plugs into the [[wiki-link]] graph without code changes.
.md, drop it in your vault outside the wiki folder, run Ingest single source. Best path for scientific papers, scanned documents, and complex multi-modal PDFs that need accurate formula/table extraction. Privacy-sensitive users can self-host MinerU; future versions may integrate MinerU natively — see #376.[[wiki-link]] becomes a node, every back-link an edge. Built in, zero extra bundle size.Ingest from folder command to batch-extract entities and concepts.LIST FROM "wiki/entities" WHERE contains(tags, "person")) or JS API. The plugin writes standard frontmatter (tags:, type:, aliases:) on every page, so Dataview queries work out of the box.wiki/, so git diff cleanly separates your edits from LLM-generated content.marp: true). Wiki pages are pure Markdown, so they render as slides without extra conversion.[[wiki-links]] without leaving the vault.Same ingest pipeline as the plugin, but running under plain Node. Use it when Obsidian isn't around — CI, batch jobs, scripted runs.
The CLI ships in this repo at tools/llm-wiki-cli/. After pnpm install, it shows up as the llm-wiki bin:
WIKI_API_KEY=... pnpm llm-wiki ingest \
--vault /path/to/your/vault \
--source "notes/foo.md" \
--dry-run
That's it. --dry-run keeps every page in memory so nothing is written; drop it to do the real write.
The CLI doesn't have its own settings — it reads the same <vault>/.obsidian/plugins/karpathywiki/data.json that Obsidian writes. Before using the CLI:
Configure the provider in Obsidian once. Settings → LLM Wiki → pick a provider, paste the API key, click Test Connection, save. The CLI will read whatever you saved there.
Pass the API key via WIKI_API_KEY. v1.25.3 moved keys into Obsidian's SecretStorage (the OS keychain), which Node can't read. So the CLI takes the key from the environment, and a missing key is a hard error — it'll print the right command for your OS:
# macOS — pull from the keychain
WIKI_API_KEY=$(security find-generic-password -s "obsidian-lw-plugin-karpathywiki" -w) \
pnpm llm-wiki ingest --vault /path/to/vault --source "notes/foo.md"
# Linux (libsecret)
WIKI_API_KEY=$(secret-tool lookup service obsidian-lw-plugin-karpathywiki) \
pnpm llm-wiki ingest --vault /path/to/vault --source "notes/foo.md"
# Windows
# Credential Manager → Windows Credentials → "obsidian-lw-plugin-karpathywiki" → Show
$env:WIKI_API_KEY = "sk-..."
pnpm llm-wiki ingest --vault C:\path\to\vault --source "notes\foo.md"
For keyless local endpoints (Ollama, LM Studio) any placeholder works (WIKI_API_KEY=unused). The key is never logged, never written to a file.
Node 24+ required. Matches the plugin's .nvmrc; crypto.subtle and fetch are native. obsidian-llm-wiki/node_modules must be installed.
The flag set is small. The big ones:
| Flag | What it does |
|---|---|
--vault |
Vault root. Required. |
--source |
Source file relative to the vault. Required. One source per run — for batches, loop over it. |
--dry-run |
Run the full pipeline, keep every write in memory. Drop it to write for real. |
--force |
Re-ingest even if the duplicate-content gate says it's a duplicate. |
--extract-only |
Stop after extraction. Implies --dry-run — you can't accidentally write from this flag. |
--model |
Override the model from data.json. Useful for A/B comparisons. |
--temperature / --top-p |
Sampling overrides. Pass them together: a preset is the pair. |
--seed |
Best-effort seed. Honoured by Chat Completions; some local servers accept it and ignore it (LM Studio does this — --temperature 0 is the only true reproducibility knob there). |
--thinking-mode |
data-json / plugin-off / server-default. |
--granularity |
fine / standard / coarse / minimal / custom. Drives batch size + item limit + round ceiling together. |
--batch-size / --round-base |
Lower-level knobs. Under --granularity custom the per-type caps may overwrite them. |
--max-tokens-per-call |
Cap max_tokens per call. 0 removes the cap (extraction's minimum is still 16000). |
--max-rounds |
Deprecated; throws. Use --round-base. |
Full flag table + shim caveats + what isn't reproduced (SecretStorage, streaming, vault events, metadataCache.links/.headings): see tools/llm-wiki-cli/README.md.
Engine console.debug goes to stdout. console.warn/console.error go to stderr. Toasts render as [Notice] …, progress as [progress] …, completed writes as [write] …. The run ends with a summary: extraction rounds, total LLM calls, entities, concepts, pages created and updated, input + output tokens, elapsed time.
The CLI imports the production WikiEngine, SourceAnalyzer, PageFactory, SchemaManager, and LLM clients straight from ../../src/. The only thing replaced is the host (obsidian, the live vault, the metadataCache) — esbuild bundles tools/llm-wiki-cli/src/main.ts for Node and rewrites every from 'obsidian' to tools/llm-wiki-cli/src/obsidian.ts. One shared module means one shared TFile class, which is what makes the engine's instanceof TFile checks work.
The CLI is moving out of this repo into a standalone sibling at green-dalii/obsidian-llm-wiki-cli. Why: the Obsidian marketplace review bot lints the whole repo .ts tree, not just src/, and flags ~60 structural Warnings on any Node CLI living alongside an Obsidian plugin (static node: imports, console.log output, globalThis shim — all unfixable without breaking what the CLI is).
The migration has four phases — Boot → Coexist → Deprecate → Demote — outlined in obsidian-llm-wiki-cli/SPEC.md. The short version:
pnpm llm-wiki here is still the only user-facing CLI.karpathywiki-cli publishes; both CLIs work, but the npm one is the recommended path.tools/llm-wiki-cli/ becomes a dev-only test harness referencing ../../src/, not a user install target.The sibling repo is at v0.1.0-dev, not yet on npm as of 2026-08-13. Until v1.27.0's Coexist phase, pnpm llm-wiki here is the canonical CLI — please use it for now. If you only ever clicked the ribbon icon in Obsidian, none of this matters to you; the plugin still ships and updates through Community Plugins as before.
tools/llm-wiki-cli/README.md — flag reference, environment, shim caveatsobsidian-llm-wiki-cli/SPEC.md — why the split, 4-phase rolloutobsidian-llm-wiki-cli/ROADMAP.md — phase tracking💡 Until v1.27.0 ships, use
pnpm llm-wikifrom this repo. The sibling repo is parallel development, not a published install.
Most "AI search" plugins fragment your notes into chunks and embed them in a vector DB. We don't. Karpathy's argument against RAG is that chunking breaks the LLM's ability to reason across your whole knowledge graph — and that argument holds up in practice. Instead, we walk the graph you already maintain by writing [[wiki-links]].
When you ask "Who founded Microsoft?", Query Wiki runs five stages before any answer generation:
[[wiki-link]] graph starting from the candidate seed set. This is what gives graph-aware multi-hop context: "Bill Gates" → "Microsoft" → "competitors", not just literal title overlap.The cascade truncates at whichever step returned enough signal — no fixed 5-step cost, no LLM calls when lex is sufficient, no lost precision when LLM augmentation is needed.
We use Monte Carlo PPR (Fogaras 2005) — 3,000 random walks × 50 steps each — with the dead-end rule from Haveliwala 2002. Cost is O(K × L) independent of the number of pages, so a 2,000-page vault sees the same expansion latency as a 200-page one.
PPR @5 = 27.1% vs pure-kNN baseline 24.1% on the project's own benchmark corpus (the only published retrieval benchmark in this open-source LLM-Wiki space).
We deliberately rejected the embedding path in Issue #175. The graph signal is already there — every [[wiki-link]] is a hand-curated "these are related" edge, and most providers we support (Ollama, LM Studio, Anthropic, Bedrock, Kimi, GLM, MiniMax) don't ship a /v1/embeddings endpoint at all. Adding an embedding model would mean a per-page download, a per-provider adapter, and zero benefit on retrieval quality.
Supported providers (12+, all from models.dev cross-check 2026-07):
| Provider | Series | Notes |
|---|---|---|
| Anthropic | Claude 5 series | Native PDF; /v1/messages protocol |
| OpenAI | GPT-5.6 series (Sol / Terra / Luna) | Native PDF; Platform API key |
| Google Gemini | Gemini 3.6 series | Native PDF (file parts since 1.5); OpenAI-compatible endpoint |
| DeepSeek | DeepSeek V4 series | OpenAI-compatible; lowest cost tier |
| Alibaba Qwen | Qwen3.7/3.8 series | OpenAI-compatible (DashScope) |
| xAI Grok | Grok 4 series | OpenAI-compatible; long context |
| Moonshot Kimi | Kimi K3 series | OpenAI-compatible; 2.8T MoE frontier |
| Zhipu GLM | GLM-5 series | OpenAI-compatible; strong bilingual |
| MiniMax | MiniMax M3 series | OpenAI-compatible; 1M context |
| Step (阶跃星辰) | Step 3 series (Flash) | OpenAI-compatible; fast inference |
| Tencent Hunyuan | Hy3 series | OpenAI-compatible; open-weight MoE |
| Xiaomi MiMo | MiMo V2.5 series | MIT open-source; flat pricing |
| Google Gemma | Gemma 4 series | Open-weight; 262K context |
| AWS Bedrock | Anthropic + OpenAI variants | VPC / compliance path |
| ChatGPT Plan (Codex OAuth) | Codex Responses API | Browser/device-code sign-in; SecretStorage |
| Local: Ollama, LM Studio, OpenRouter, Anthropic-Compatible | Any OpenAI-/Anthropic-protocol model | Custom OpenAI-Compatible + Anthropic-Compatible (Token Plan / Coding Plan) |
This plugin feeds the LLM your full Wiki context per query — so long-context models win. The full tiered table (cloud + local) lives in docs/MODEL-GUIDE.md, cross-checked against models.dev so the picks stay current.
/v1/embeddings is fine (most of our 12+ providers do).📖 Full pick table (cloud + local + PDF OCR + Codex OAuth + quantization + hardware tiers) → docs/MODEL-GUIDE.md
Pick any note, folder, or selection; the LLM extracts entities and concepts and generates an interlinked wiki with [[bidirectional links]]. Ask questions and get conversational answers grounded in your notes, not the internet. Your original vault notes are never modified.
Install from Obsidian Community Plugins → pick a provider → Test Connection → run Ingest single source on any note. First wiki pages appear within seconds. See Quick Start.
✅ Backward compatible since v1.0.0. Set reviewed: true on any page to protect it from overwrite. Upgrading from v1.24.x doesn't rewrite your vault; v1.25.0's PDF ingest is cache-only by default.
🚫 No backend, no analytics — the plugin runs entirely inside Obsidian. Only text you explicitly send for ingest/query leaves your device, and only to the LLM provider you configure. For complete data locality, use Ollama or LM Studio.
🌍 11 languages for both UI and wiki output. UI and wiki language are independent. Adding a 12th language is contributor-driven (PR #159 pattern).
🚫 No chunking. 🚫 No embeddings. 🚫 No vector DB. ✅ Personalized PageRank over your existing [[wiki-link]] graph — graph-aware multi-hop context, zero embedding cost, full local-model support.
Long-context models (≥200K tokens) work best. The Models section covers the principles; the full tiered table is in docs/MODEL-GUIDE.md.
Yes — PPR @5 = 27.1% vs pure-kNN baseline 24.1% on the project's own corpus. The full pipeline and benchmark script are described in How retrieval works.
Use Coarse or Minimal extraction granularity for batch ingest. Smart Batch Skip auto-detects already-ingested files. Auto-Maintenance is OFF by default. Lint shows counts before running fixes — nothing is charged without your approval.
Click the status bar (shows "Ingesting… click to cancel") or Cmd+P/Ctrl+P → "Cancel current ingestion". Stops cleanly at the next batch boundary.
GitHub Issues for bug reports · GitHub Discussions for questions and feature requests · Developer Console (Ctrl+Shift+I / Cmd+Option+I) for plugin logs.
This plugin is listed on the Obsidian Community Plugin Market and undergoes automated review for security and permissions.
For complete data locality, use Ollama or LM Studio. With a local provider, your data never leaves your machine.
If LLM-Wiki has become a meaningful part of your knowledge workflow:
Sponsorship is entirely optional. The plugin stays Apache-2.0-licensed and feature-complete regardless.
Thanks to the following for supporting the project:
@jameses-cyber, @issaqua, Dikson Choi
Other things I build and maintain:
WikiEngine against a vault on disk, no renderer. Still v0.1 in development and not on npm; use pnpm llm-wiki from this repo until v1.27.0.Apache License, Version 2.0 — see LICENSE and NOTICE.
Built on:
@ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/openai-compatible) via Obsidian requestUrlMaintainer: @green-dalii