Skip to main content

Karpathy's LLM Wiki, brew-install ready. Sync, query, and graph any repo's wiki into your Obsidian Vault.

Project description

pwiki

Karpathy's LLM Wiki, brew-install ready. Turn any folder into a self-maintaining knowledge base your LLM can actually reason over.

PyPI version Python License: MIT Karpathy LLM Wiki

pwiki demo

"Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase." — Andrej Karpathy, LLM Wiki Gist, April 2026


What is pwiki

Karpathy's LLM Wiki pattern — turn raw notes and code wikis into structured markdown an LLM can navigate, query, and grow. pwiki packages that pattern as a CLI you can install in 10 seconds and a Vault layout that just works.

You point it at a wiki/ directory generated by Claude Code (or any LLM that produces markdown). pwiki copies it into your Obsidian Vault, adds frontmatter, builds a JSON Canvas knowledge graph across every repo you've ingested, and gives you a daily morning brief that surfaces what's due for review and what cross-repo concepts collided overnight.

It's the unopinionated middleware between (your code) and (your second brain).

Install

pip install -U pwiki-cli     # PyPI (the `pwiki` name was taken; CLI command is still `pwiki`)
# or, from source:
git clone https://github.com/zxs1633079383/pwiki && cd pwiki && pip install -e .

Requires Python 3.10+ and a folder you want to use as your Obsidian Vault (default: ~/Documents/Obsidian Vault).

Quick Start (one command + one phrase)

cd ~/your-project
pip install -U "pwiki-cli[rag,serve]"
pwiki init                  # 1. detects project + AI tools
                            # 2. writes Karpathy's full LLM Wiki pattern into
                            #    CLAUDE.md / AGENTS.md / .cursor/rules / GEMINI.md / .clinerules
                            # 3. bootstraps docs/wiki/ scaffold

Now open Cursor / Claude Code / Codex / Gemini CLI in your project and say:

"fill the wiki" / "帮我填 wiki" / "scan my code and write the wiki"

Your AI already has the full protocol in its loaded instructions: 6 page types (Entity / Concept / Operation / Comparison / Synthesis / Summary), 8-step bootstrap, citation rules, quality bar. It reads your README + source tree, writes 5-15 pages, runs pwiki sync + pwiki aliases + pwiki canvas, and reports back. You don't type any other pwiki commands.

Real example — Angular 20 + Tauri 2 desktop client, 4205-line ARCHITECTURE.md: 8 wiki pages distilled, 38 cross-page links, full canvas in ~60 seconds, zero hand-typed CLI commands after pwiki init.

Manual mode (60 seconds, if you prefer to drive)

# 1. Ingest a wiki/ directory into your Vault as repos/<name>/
pwiki sync ./my-project/docs/wiki my-project

# 2. Resolve [[english-slug]] wikilinks against Chinese/non-stem filenames
#    (handles the common "wiki uses slug, files use prose-name" pattern)
pwiki aliases my-project

# 3. Render every synced repo as a JSON Canvas graph (open in Obsidian)
pwiki canvas

# 4. Build today's morning brief (Ebbinghaus-due review queue + cross-repo signals)
pwiki brief

# 5. (Sundays) Roll up the week's self-evolution entries
pwiki evolution

# 6. Search the Vault — grep mode (zero deps)
pwiki query "blast radius"

# 7. Search semantically — RAG mode (multilingual, fully local)
pip install 'pwiki-cli[rag]'         # adds fastembed (~120MB ONNX model on first use)
pwiki query --rag --rebuild "warmup"      # build index once
pwiki query --rag "how do I detect cross-repo impact"
pwiki query --rag "怎么判断改一个接口会炸到下游哪些服务"   # mixed-language works

Python 3.14 note: the [rag] extra requires onnxruntime, which currently ships wheels for Python 3.10–3.13 only. If you're on 3.14, run pwiki in a 3.13 venv: python3.13 -m venv ~/.pwiki-venv && ~/.pwiki-venv/bin/pip install 'pwiki-cli[rag]'.

# 8. Browse the Vault in a local web UI (with D3 Canvas viewer)
pip install 'pwiki-cli[serve]'
pwiki serve --port 8080 --open
# → http://127.0.0.1:8080/
#   home  /         repos list + recent dailies + opportunities
#   /repo/<name>/   notes by category
#   /note/<path>    rendered markdown (wikilinks resolve through aliases)
#   /daily/<date>   daily brief
#   /canvas/        D3 force-directed graph of every cross-repo edge
#   ?q=...&rag=1    inline search (header bar, RAG checkbox)

Every command is idempotent. Re-running on the same input updates frontmatter timestamps and refreshes the index, never destroys content.

What you get

  • repos/<name>/ — your wiki, mirrored, with managed YAML frontmatter (source_repo, last_synced, ebbinghaus_stage, last_reviewed, tags).
  • canvas/all-repos.canvas — a JSON Canvas graph: every repo as a labeled group, every note as a file node, edges drawn from resolved wikilinks (cross-repo too).
  • daily/<date>.md — a 4-section morning brief: ① Ebbinghaus-due reviews ② 10 frontier directions (cross-repo concept carom) ③ 1 deep opportunity ④ self-evolution (rotates 4 quadrants by weekday).
  • evolution/<YYYY>-W<WW>.md — weekly digest of §④ entries grouped by quadrant.
  • opportunities/ — your own promotion target when §② surfaces something worth pursuing.

The whole thing is plain markdown. Open it in Obsidian, edit by hand, version with git, sync with Self-hosted LiveSync — pwiki never locks you in.

Why not just use the Karpathy gist directly?

Six excellent open implementations have appeared in the 30 days since Karpathy's gist dropped (April 2026):

Project Focus What pwiki adds
Ar9av/obsidian-wiki Skill-based framework, ingest pipeline One-line install, multi-repo Vault, JSON Canvas
AgriciDaniel/claude-obsidian /wiki /save /autoresearch slash commands Cross-repo concept carom + Ebbinghaus review
NicholasSpisak/second-brain Personal vault skills Daily brief + weekly evolution rollup
Karpathy's original gist The pattern itself Brew-install-ready CLI + per-command help

See docs/COMPARISON.md for a full breakdown.

The honest pitch: every existing implementation requires reading a 50-line tutorial, copy-pasting Python, and configuring paths by hand. pwiki is one pip install and five subcommands. That's the entire delta.

How it actually works

pwiki ships as five composable Python modules around one shared assumption: your Vault is your source of truth, and every file's frontmatter is the contract.

wiki/  ──pwiki sync──→  Vault/repos/<name>/
                            │
                            ├─ adds frontmatter (source_repo, ebbinghaus_stage, …)
                            └─ updates _index.md from _templates/

Vault/repos/  ──pwiki canvas──→  Vault/canvas/all-repos.canvas (JSON Canvas)
                                     │
                                     └─ edges from [[wikilinks]] (resolves through aliases)

Vault/repos/  ──pwiki brief──→  Vault/daily/<today>.md
   + git logs                       │
   from ~/workspace                 ├─ ① review queue (frontmatter → Ebbinghaus)
                                    ├─ ② 10 directions (LLM fills from materials block)
                                    ├─ ③ 1 opportunity
                                    └─ ④ self-evolution (rotates 4 axes by weekday)

Vault/daily/   ──pwiki evolution──→  Vault/evolution/<YYYY>-W<WW>.md
   (past 7 days)                        (grouped by quadrant)

Architecture details: docs/ARCHITECTURE.md.

Roadmap

  • 0.1: 5 命令 CLI + JSON Canvas + Ebbinghaus + 周度演进
  • 0.2: alias Pass 4 支持英文文件名 + pwiki query (grep / RAG via fastembed multilingual MiniLM)
  • 0.3.0: pwiki init — embeds Karpathy's full LLM Wiki pattern (3 layers / 3 operations / 6 page types / 8-step bootstrap / 7-step ingest / 5-category lint) into every AI tool's instruction file. AI auto-fills the wiki from your code; you say one phrase.
  • 0.3 (also): pwiki serve — local web UI with D3 Canvas viewer + inline grep/RAG search.
  • 🟡 0.4 (hosted, not started): one-click LiveSync-as-a-service so multi-device sync stops being a CouchDB project. Spec: docs/0.4-hosted-spec.md. Implementation gated on ⭐ ≥ 300 (premature SaaS without traction is a known anti-pattern).

Pricing (Freemium)

Tier Price What you get
OSS (CLI + serve) free forever 0.1 → 0.3 全部 — 5 命令 CLI、Canvas、Ebbinghaus、演进、本地 RAG(自带 OpenAI key)、pwiki serve 本地 web UI
Hosted Pro $9/mo 0.4 hosted LiveSync (no CouchDB to operate) + hosted RAG (cached embeddings) + pwiki.dev/yourname public URL
Team Pro $29/seat/mo shared team vault + permissions + aggregated team brief + SSO

Contributing

Bug reports and PRs welcome. Run tests:

pip install -e ".[dev]"
pytest

If you've built something on top of pwiki — a custom quadrant, a new subcommand, a different Canvas layout — open a PR or link me to it. I'll feature it here.

License

MIT — do whatever you want, including commercial use.

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pwiki_cli-0.3.1.tar.gz (407.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pwiki_cli-0.3.1-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file pwiki_cli-0.3.1.tar.gz.

File metadata

  • Download URL: pwiki_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 407.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pwiki_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b14fdc3a04251bb54a4dfc94e0fd21bc9759fe0fd0830f65bacec38614076f7a
MD5 3e38c62b1d13eaf0caf85675d152f4f6
BLAKE2b-256 383aee788501871557be4d9f2b525d75500ff5f6568b606670fe3f7889f3318d

See more details on using hashes here.

File details

Details for the file pwiki_cli-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pwiki_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pwiki_cli-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59ad9ae3bb9734ac9bfe8f6e12d790565a6ed0d29502b2689329332b4ec83ddd
MD5 5fa39a8bd44826490f8be9cce9b7bfc5
BLAKE2b-256 e2e88eb7a706438394f81eedc944f2a403e0a7fc4fdf4543c4864c65f675f342

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page