Combine Pi Agent's minimal primitives (read/write/edit/bash) with Karpathy's LLM Wiki pattern. Ship it as a Pi Package anyone can install with one command.
A Pi Package called @you/pi-llm-wiki that anyone can install and use. After they run pi install, their Pi instance gains:
/ingest — process a source file into wiki pages/query — search the wiki and synthesize an answer/lint — audit the wiki for contradictions and orphans/skill:ingest-pdf — format-aware PDF ingestion/skill:ingest-web — web clip ingestion via curlAGENTS.md template for defining wiki purposenpm install -g @mariozechner/pi-coding-agentpi install git:Every LLM Wiki operation maps cleanly onto a Pi primitive or extension point. No impedance mismatch.
The nashsu reference implementation includes extensive machinery — LanceDB vectors, Louvain clustering, sigma.js graph, Tauri desktop shell. The base pattern needs none of it. What Pi handles natively:
bash grep -r with good prompting beats vector DB for wikis under ~1000 pages.
Standard markdown [[wikilinks]] or [text](path). Obsidian-compatible.
Any markdown editor (VSCode, Obsidian, Typora) reads the wiki directly. No custom desktop app.
Just files on disk. Version control via git. Sync via Dropbox/iCloud.
/ingest and /query working on a folder of PDFs first. Add vectors, graph, clustering only when the wiki has enough pages that grep stops being enough — that's many months of use for most users.| Decision | Rationale |
|---|---|
| Markdown files, not DB | Portable, versionable, readable by any tool. Plays with Obsidian. |
| grep over vectors | Zero dependencies. Works offline. Good enough up to ~1000 pages. |
| Prompt templates, not extensions | Users can edit .md files to customize. No TypeScript needed. |
| Skills for formats only | PDF, DOCX, web clips need specific parsing. Everything else is text. |
| AGENTS.md as schema | Pi already reads it. One file defines purpose + wiki rules. |
| Git commits per ingest | Wiki history is the audit log. Revert bad ingests trivially. |
Create the Pi Package project structure. Seven files, no build step.
pi field is what makes this a Pi Package. Pi looks for it during pi install and wires the prompts, skills, and templates into the agent's configuration. Without it, it's just an npm package.This is the schema/purpose document users customize for their specific wiki. Ship a template that explains what to edit.
The heaviest operation. One source becomes 10-15 wiki page updates. Two-phase: analyze, then write.
Plain text and markdown sources work with Pi's built-in read tool. Other formats need a skill.
Search the wiki, synthesize with citations, optionally file the answer back as a new page.
The bash grep approach is deliberately simple. For wikis under ~1000 pages, ripgrep across markdown is faster and more precise than vector DBs.
Every claim in the answer should cite its source wiki page:
wiki/queries/ becomes the wiki's most referenced folder — a distilled layer of human-interesting conclusions.Audit the wiki for contradictions, orphans, stale claims, and broken cross-references. Run on a schedule or after large ingest batches.
queries/ → leave alone (query pages are often orphans).
- Orphan in entities/ or concepts/ → suggest linking from index.md.
- Contradictions → never auto-fix. Human must resolve.[[missing-page]] where missing-page.md doesn't exist. Often from renamed pages.
Entity and concept pages nothing links to. Sign of a failed ingest or abandoned topic.
Frontmatter references raw/foo.pdf but the file was deleted. Wiki page is now unmoored.
"Founded 2018" on one page, "Founded 2019" on another. The expensive check — run monthly, not daily.
Pages older than 12 months with specific, time-sensitive claims (prices, release dates, headcounts).
wiki/index.md lists pages that were deleted, or omits pages that exist.
Run lint automatically after each week of ingests:
Bundle for distribution. Three shipping options: git, npm, or GitHub Pages for a landing page.
Fastest for internal use or early iteration. Push to GitHub, others install directly.
Best for broad distribution. Versioned, discoverable, updatable.
--access public. Use @yourname/pi-llm-wiki to avoid collisions with other authors.Ship a static marketing/docs page alongside the package. Same aesthetic as this guide.
The README is what users see first on npm and GitHub. Cover:
| Version | What Changed |
|---|---|
| 0.1.0 | Initial release — ingest/query/lint working on text + PDF |
| 0.2.0 | Added ingest-web skill, web clip support |
| 0.3.0 | Added ingest-docx, ingest-audio (Whisper-based) |
| 1.0.0 | Stable schema.md format, backwards-compat guarantee |
| 1.x.x | New skills, templates, and ancillary commands |
| 2.0.0 | If you ever need to break the AGENTS.md format |
From cold install to a living knowledge base. End-to-end workflow plus optional publishing.
mkdir research-wiki && cd research-wikigit init && git add -A && git commit -m "init"raw/pi "/ingest raw/paper.pdf" — watch the wiki appearpi "/query what are the main findings?"Drop the day's reading into raw/. Run /ingest on each source.
Ask questions with /query. File substantive answers as pages.
Run /lint on Sunday morning. Resolve flagged items over coffee.
Read wiki/log.md. Notice what themes emerged. Adjust AGENTS.md if needed.
The wiki is git. Push nightly. No separate backup needed.
Open the wiki folder in Obsidian or VS Code. Native markdown, no custom app.
Push the wiki/ folder to Cloudflare Pages for a public knowledge base. Wikilinks convert to real HTML links during build.
| Operation | Model | Typical Cost |
|---|---|---|
| /ingest (10-page PDF) | Claude Sonnet 4.6 | ~$0.05-0.15 |
| /ingest (web clip) | Claude Sonnet 4.6 | ~$0.01-0.05 |
| /query (simple) | Claude Sonnet 4.6 | ~$0.01-0.03 |
| /query (deep synthesis) | Claude Opus 4.6 | ~$0.10-0.30 |
| /lint (500-page wiki) | GPT-4o-mini | ~$0.02-0.05 |
/login, Claude Pro and ChatGPT Plus subscribers use their existing quota — no per-call charges for most usage.