zosmaai/pi-llm-wiki

Self-maintaining, Obsidian-compatible knowledge base for pi — turn raw sources into an interlinked wiki that compounds. Native Open Knowledge Format (OKF) v0.2.

📚 pi‑llm‑wiki – A self‑maintaining, Obsidian‑compatible LLM‑powered wiki

What it is

  • An open‑source extension (npm package @zosmaai/pi-llm-wiki) that lets you build a durable, inter‑linked knowledge base that lives in plain Markdown files. It is designed for the pi coding‑agent ecosystem (and the compatible oh‑my‑pi host) but also ships a generic MCP (Model‑Client‑Protocol) server so any Claude‑Code, Cursor, Windsurf, Zed, etc. client can talk to it.
  • It follows Andrej Karpathy’s LLM Wiki pattern: raw sources are captured, the LLM ingests them, and the resulting summaries become permanent wiki pages that the model can later query.

Why it matters

  • Most RAG setups treat documents as a one‑shot lookup. pi‑llm‑wiki adds a middle layer that turns sources into immutable packets, generates structured source pages, and then creates canonical concept/entity/synthesis/analysis pages. The wiki therefore compounds – each new source and each answered question becomes part of a growing, searchable knowledge graph.
  • All pages are stored in the Open Knowledge Format (OKF) v0.2, a portable, Obsidian‑friendly markdown schema with stable front‑matter and citation IDs. You can move the vault, version‑control it, or export it without losing provenance.

Key concepts & architecture

Layer Location Role
Personal ~/.llm-wiki/ Always active, carries your private knowledge across projects.
Project <project>/.llm-wiki/ Optional per‑project wiki that can also read from the personal layer.
Company (future) Git‑tracked repo Shared team wiki; pages are promoted via wiki_publish.

The extension resolves the active vault by looking for a .llm-wiki/ folder upward from the current directory, falling back to the personal vault.

Main capabilities

  • Capture (wiki_capture_source) – turn a URL, PDF, markdown, JSON, XML, or pasted text into an immutable source packet (raw/sources/SRC‑…).
  • Ingest (wiki_ingest) – batch‑process captured packets into four layers of wiki pages: source summaries, concepts, entities, syntheses, and analyses.
  • Recall / Query (wiki_recall, /wiki-query) – search both personal and project vaults, get model‑generated answers with proper citations, and optionally file the answer as an analysis page.
  • Search & Index (wiki_search, wiki_reindex) – lexical QMD index (model‑free) plus optional semantic embeddings.
  • Lint & Guardrails (wiki_lint) – deterministic health checks for orphan pages, broken links, duplicate aliases, coverage gaps, etc.
  • Dashboard (wiki_status, /wiki-dashboard) – quick view of page counts, freshness, recent activity, and ingest queue.
  • Auto‑bootstrap – the first time you run the extension in a folder it offers to create a new wiki (/wiki-init).
  • Agent working‑memory (opt‑in) – capture the tool‑call trajectory of a completed task (wiki_capture_trajectory), later distill into reusable skill pages (wiki_distill_skills, /wiki-skills).
  • MCP server – a standalone stdio server (dist/mcp/index.js) exposing all tools, so any MCP‑compatible client can use the wiki without the pi host.

Installation & first use

# With the pi host
pi install npm:@zosmaai/pi-llm-wiki
# With oh‑my‑pi
omp install @zosmaai/pi-llm-wiki
# Or as a regular npm dev dependency for other MCP clients
npm install --save-dev @zosmaai/pi-llm-wiki

Then in a terminal (or via slash commands in pi/omp):

/wiki-init "AI research"
/wiki-capture_source https://example.com/article
/wiki_ingest   # or /wiki-ingest
/wiki-query "What are the trade‑offs between long‑context models and RAG?"

The demo GIF in the README shows the UI flow inside pi.

Configuration

  • Environment variables such as WIKI_ROOT (override vault location) and WIKI_MARKITDOWN_TIMEOUT_MS (PDF → markdown extraction timeout) are respected.
  • Settings are read from the host’s config files (.pi/settings.json, .omp/settings.json, etc.) and can be edited via the /wiki-settings slash command.

Project health

  • CI badge, npm version, download stats, 85 % test coverage, CodeQL, and Biome linting are all shown in the README, indicating an actively maintained TypeScript codebase.
  • Documentation is hosted at https://zosmaai.github.io/pi-llm-wiki/.

Who might use it

  • Researchers or engineers who want a personal knowledge base that stays in sync with their LLM‑assisted work.
  • Teams that plan to share a company‑wide wiki built on the same OKF format.
  • Anyone using the pi or oh‑my‑pi agents, or any MCP‑compatible IDE, who wants a file‑based, version‑controlled alternative to proprietary RAG stores.

TL;DR: pi-llm-wiki is a TypeScript npm package that turns raw documents into a portable, Obsidian‑compatible markdown wiki, automatically maintained by LLMs. It works with the pi/oh‑my‑pi agents and any MCP client, offering capture, ingestion, searchable recall, health‑checking, and optional agent‑trajectory memory—all under an open, version‑controlled format.

Related

  • Project
  • Project
  • Project
  • Project
  • Project