# LLM Wiki > LLM-compiled knowledge bases for any AI agent. Token-efficient read-only queries, parallel multi-agent research, collector catalogs, automated session capture, feedback curation, source ingestion, wiki compilation, topic archiving, inventory tracking, dataset manifests, truth-seeking audits, human-owned topic guides, and artifact generation. Ships as a Claude Code plugin, an OpenAI Codex plugin, OpenCode/Pi instruction profiles, or portable agent instructions. Obsidian-compatible. MIT-licensed. Author: nvk · Source: https://github.com/nvk/llm-wiki · License: MIT ## What it is LLM Wiki is a set of slash commands and a knowledge model that turns any LLM coding agent into a research engine and an append-only, Markdown-native wiki. It runs parallel multi-agent research (5-10 agents from different angles), collects provenance-rich catalogs of discoverable artifacts and examples, captures redacted session context and user-feedback candidates under `.sessions/`, rehydrates compact context for future turns, ingests URLs and files, archives whole topic wikis that should stay preserved but quiet, tracks durable inventory state, indexes large or external datasets with manifests, maintains human-owned `schema.md` topic guides for local vocabulary and conventions, compiles raw sources into synthesized articles with cross-references and confidence scores, answers questions against the compiled knowledge, and generates artifacts like reports, slides, study guides, and implementation plans. It is inspired by Andrej Karpathy's "LLM wiki" concept (https://x.com/karpathy/status/2039805659525644595). ## Install - Claude Code (native plugin): `claude plugin install wiki@llm-wiki` — best for full agentic research with 200K context. - OpenAI Codex (marketplace plugin): run `codex plugin marketplace add nvk/llm-wiki`, then `codex plugin add wiki@llm-wiki`. Use `@wiki` for full workflows; in CLI/IDE type `$` or open `/skills` and select `wiki-query` for compact read-only lookups. For a local checkout: `./scripts/bootstrap-codex-plugin.sh --scope user --verify`. - OpenCode (instruction file): load `plugins/llm-wiki-opencode/skills/wiki-manager/SKILL.md` for full workflows or `plugins/llm-wiki-opencode/skills/wiki-query/SKILL.md` for best-effort read-only queries. Web search requires `OPENCODE_ENABLE_EXA=1`. - Pi (read-only query): `./scripts/pi-wiki-query`; use `./scripts/pi-ds4-wiki-query` for isolated local DS4. Both expose only `read,grep,find,ls` and disable unrelated discovery. - Pi (full workflow): `pi --skill path/to/llm-wiki/plugins/llm-wiki-opencode/skills/wiki-manager/SKILL.md`. - Any LLM agent (portable query): copy `profiles/query-lite/SKILL.md` into the agent context or project as `AGENTS.md`. Use the root `AGENTS.md` only for complete write-capable research and maintenance. ## Core commands - `/wiki ` — fuzzy intent router (URLs → ingest, questions → query, etc.) - `/wiki init ` — create a topic wiki at `~/wiki/topics//` - `/wiki:research ` — 5 parallel agents; `--plan` (multi-path), `--deep` (8), `--retardmax` (10), `--new-topic`, `--min-time 1h` - `/wiki:research --mode thesis ""` — thesis-driven: evidence for + against → verdict - `/wiki:ingest ` — add sources; `--inbox` processes the inbox - `/wiki:ingest-collection ` — bulk-ingest Git doc repos, BIP proposal sets, MediaWiki dumps/API sites, message archives, or Wayback CDX snapshots - `/wiki:collect ""` — find, deduplicate, and catalog artifacts, examples, resources, media, memes, tools, entities, or source candidates - `/wiki:collect "" --scale tiny|small|medium|large|huge` — control write behavior by operational scale, not just row count - `/wiki:collect "" --media archive|thumbnail|reference` — download bounded originals by default for media-bearing collections; use thumbnails for previews or reference to opt out - `/wiki:collect "" --inventory corpus|records` — create one corpus record for large/media-heavy sets or per-item records for small durable sets - `/wiki:inventory list|add|show|save-view|scan-outputs|migrate-output` — track durable items, source candidates, corpora, entities, watch items, and next actions - `/wiki:dataset list|add|show|profile|sample|scan-outputs|migrate-output` — index large or external data with manifests, samples, profiles, and query recipes without copying the data - `/wiki:archive list|topic|restore|peek` — archive whole topic wikis under `topics/.archive/`, restore them later, or search archived indexes without loading archived articles - `/wiki:session status|disable|enable|capture|list|show|rehydrate|promote` — manage default-on redacted session capture, opt out, rehydrate context, or promote digests into topic raw notes - `/wiki:feedback list|show|capture|promote` — review redacted user-feedback candidates, manually capture feedback, or promote durable lessons into topic raw notes - `/wiki:compile` — raw sources → synthesized articles with cross-refs - `/wiki:query ` — compact read-only, index-first Q&A with exact file citations; `--quick`, `--deep`, `--list`, `--resume`, `--include-archived` - `/wiki:audit` — umbrella trust audit across wiki, outputs, provenance, and fresh research - `/wiki:librarian` — focused wiki maintenance: score articles for staleness/quality and optionally propose topic-guide conventions - `/wiki:ll` — extract lessons learned from current session into wiki; `--dry-run`, `--rules` - `/wiki:plan ` — wiki-grounded implementation plan; `--format rfc|adr|spec` - `/wiki:output ` — summary, report, study-guide, slides, timeline, glossary, comparison - `/wiki:assess ` — repo vs wiki vs market gap analysis - `/wiki:librarian` — score articles for staleness and quality; `--passes conventions` writes proposal outputs without changing `schema.md` - `/wiki:lint [--fix|--deep]` — structural and factual health checks; `--fix` can add a missing advisory topic guide - `llm-wiki schema status|adopt ` — local helper to inspect or add the human-owned `schema.md` topic guide - `/wiki:retract` — remove a source and clean up downstream references - `/wiki:project` — group outputs into projects with goals and manifests ## Sessions and feedback - Default-on, redacted operational memory lives under `HUB/.sessions/` or `.wiki/.sessions/` for local project wikis. - Trusted hooks store harness metadata, current directory, git context, small redacted hook events, per-session state JSON, Markdown digests, and feedback candidates; full transcripts are not stored by default. - A session ID such as `codex:abc123` is `:`, a local lookup key that joins events, state, and a digest; it is not a secret, transcript, wiki, or topic ID. - `session status|list|show|capture` inspects and creates digests; `session disable` opts out by writing `enabled: false`; `session enable` turns capture back on. - `session rehydrate --cwd "$PWD"`, `--session-id`, or `--topic` returns compact context for the next agent turn without bulk-pasting a transcript. - `session promote` and `feedback promote` are the boundary between operational memory and topic knowledge: selected digests or feedback candidates become distilled notes under topic `raw/notes/`. - `feedback list|show|capture|promote` handles corrections, preferences, approvals, and plan acceptance; generic acknowledgements such as `ok`, `thanks`, and `cool` are ignored. - Harness-session capture is separate from topic-level research crash state (`.research-session.json`, `.thesis-session.json`) and durable workflow provenance (`.session-events.jsonl`, `.session-checkpoint.json`). ## Trust model `/wiki:librarian` keeps the `wiki/` layer in check. `/wiki:audit` is broader: it can trace outputs through `wiki/` and `raw/`, detect drift, inspect provenance, and do new research when the stored corpus is not enough to decide whether something is trustworthy. ## Architecture (one-liner) Hub at `~/wiki/` is a lightweight registry (`wikis.json`, `_index.md`, `log.md`, optional `.sessions/` including `feedback/`). All active content lives in isolated topic sub-wikis at `~/wiki/topics//`, each with `inbox/`, `inventory/`, `datasets/`, `raw/`, `wiki/{concepts,topics,references}/`, `output/`, plus `schema.md` as a human-owned topic guide and its own `.obsidian/` vault config. Archived topic wikis live under `~/wiki/topics/.archive//` and are hidden by default. ## Key design properties - Zero runtime dependencies — uses only the host agent's built-in tools. - Query Lite is a shared 2.8 KB read-only protocol — Claude `/wiki:query`, explicit Codex `$wiki-query`, Pi/DS4 launchers, OpenCode, and portable agents share bounded index-first retrieval and exact citations. Full workflows remain available for writes. - v0.16.0 token-efficiency benchmarks — Claude query instructions are 72.54% smaller; query-only contexts are roughly 76-95% smaller than full workflows; controlled DS4 serialized provider payload fell 64.30%. Static budgets, AB/BA runners, and case/fixture SHA-256 gates reject regressions. OpenCode live behavior remains best effort. - Dual-linking: `[[wikilink]] + [standard markdown link](path.md)` on every cross-reference — works in Obsidian, Claude Code, GitHub, and plain text editors. - Raw is immutable — sources are never modified once ingested. - Inventory is operational state, not factual evidence — it tracks items, candidates, corpora, watch records, and next actions. - Collect outputs are discovery maps, not evidence — they preserve aliases, found-in-context provenance, media URLs, cached asset paths, hashes, source context, dedupe notes, and inventory recommendations before selected sources are promoted into raw/wiki/inventory/datasets. - Dataset manifests index large/external data — samples, profiles, and query recipes live in the wiki; the underlying data stays where it belongs. - Archive is quiet preservation — old topic wikis move to `topics/.archive/`, remain structurally maintainable, and stay out of default query/compile/research/collect/output context unless explicitly included. - Topic guides are human-owned — `schema.md` records local vocabulary, relationship verbs, article subtypes, source boundaries, and adoption notes; `schema_state: advisory` means suggestions only. - Session capture is operational memory — trusted hooks write redacted JSONL/state and Markdown digests under `.sessions/` by default; `session disable` opts out, `session rehydrate` restores compact context, and promotion into topic wikis is explicit. - Feedback is candidate memory — high-signal corrections, preferences, approvals, and plan acceptance become redacted candidates under `.sessions/feedback/`; generic acknowledgements are ignored and promotion is explicit. - Topic-isolated indexes — no cross-topic noise, but queries peek sibling wikis for overlap. - Configurable hub — store on iCloud, Dropbox, or any custom path via `/wiki config hub-path`; shared hubs prefer portable `hub_path` config and relative `wikis.json` topic paths so they work across machines with different home directories. - iCloud permission diagnostics — if macOS lets Codex stat the configured hub but denies reads or `topics/` listings, the CLI and skill guidance treat it as a launcher privacy-permission issue, not an invalid registry or reason to use a machine-local fallback path. - v0.15.1 Codex 0.144 compatibility — non-interactive cached plugin installation, cache-aware verification, clean-home install regression tests, and corrected lessons-learned raw-note frontmatter. - v0.15.0 topic guides — reframes `schema.md` as a human-owned topic guide, adds `llm-wiki schema adopt`, and updates librarian language to convention proposals instead of database migrations. - v0.14.0 default topic guides — new wikis get advisory `schema.md` by default; older wikis remain valid and can adopt a starter safely. - v0.12.0 feedback curator — redacted feedback candidates under `HUB/.sessions/feedback/`, generic acknowledgement filtering, review/list/show, manual capture, and explicit topic promotion. - v0.11.1 session helper compatibility — automated session capture works on Python 3.9/macOS system Python as well as newer Python runtimes. - v0.11.0 automated session capture — default-on redacted hook checkpoints under `HUB/.sessions/`, `session disable` opt-out, compact rehydration, and explicit topic promotion. - v0.10.1 collector media downloads — `/wiki:collect` downloads bounded public binary media into `output/assets/collect-/` by default, records local paths and hashes in the catalog, and keeps `--media reference` as the no-download opt-out. - v0.10.0 collector catalogs — `/wiki:collect` finds, deduplicates, and catalogs examples, artifacts, media, memes, tools, entities, and source candidates with aliases, found-in-context provenance, scale handling, and media-safe defaults. - v0.9.0 topic archive lifecycle — archive, restore, and peek archived topic wikis while preserving raw sources, compiled articles, outputs, logs, and registry history. - Append-only activity log at `log.md` in every wiki. ## iCloud shared hub notes - Set the hub with `/wiki config hub-path "~/Library/Mobile Documents/com~apple~CloudDocs/wiki"` so each Mac expands `~` locally. - Keep shared `wikis.json` topic paths relative, for example `topics/bitcoin`, rather than absolute `/Users//...` paths. - macOS privacy permissions are per-machine and per-launcher. Grant Full Disk Access or iCloud Drive access to the exact app launching the agent, then restart it. - If Codex is launched over SSH, Terminal.app permissions do not apply; grant access to `/usr/libexec/sshd-session`, `/usr/libexec/sshd-keygen-wrapper`, and optionally `/usr/sbin/sshd`. - Diagnostic pattern: `stat` succeeds for the hub, `wikis.json`, and `topics/`, but reading/listing fails with `Operation not permitted`. That means the path is correct and access is blocked by macOS privacy controls. ## Docs - Home: https://llm-wiki.net/ - Install: https://llm-wiki.net/#install - Quick start: https://llm-wiki.net/#quickstart - Sessions: https://llm-wiki.net/#sessions - Commands reference: https://llm-wiki.net/#commands - Guides: https://llm-wiki.net/#guides - FAQ: https://llm-wiki.net/#faq - README (canonical): https://github.com/nvk/llm-wiki#readme - Releases: https://github.com/nvk/llm-wiki/releases - AGENTS.md (portable): https://raw.githubusercontent.com/nvk/llm-wiki/master/AGENTS.md ## Related - learntoprompt.org (https://learntoprompt.org) — sister site by the same author. Practical guides for AI coding agent setup (Claude Code, Codex, OpenCode, Pi, llama.cpp, ollama, ds4), sandboxing with bondage + nono, secret management with envchain-xtra, and prompting workflows. Includes a dedicated llm-wiki guide at https://learntoprompt.org/guides/llm-wiki.html and a portable DS4 wiki profile guide at https://learntoprompt.org/guides/ds4-wiki-profile.html.