Skip to content
프로젝트

소개

pi를 위한 자체 유지 관리형 Obsidian 호환 지식 베이스입니다. 원시 소스를 서로 연결되고 계속 축적되는 위키로 변환하며, 네이티브 Open Knowledge Format(OKF) v0.2를 사용합니다.

생산성 및 자동화

이 수치를 측정하는 방법

What you can do

  • 🏠 Personal fallback - Always-on ~/.llm-wiki/ vault — knowledge compounds across projects even when no project wiki exists
  • 🔗 Immutable source capture - URLs, local files (PDF/md/txt/html/XML/JSON), or pasted text → structured source packets
  • 🧠 Automated ingestion - wiki_ingest batch-processes sources into concept, entity, synthesis & analysis pages
  • 🔍 Full-text search - Generated registry with keyword lookup across all pages and sources

측정된 스타 증가

in 24h
0
in 7 days
+2
in 15 days
+2
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.ko.md

Original

@zosmaai/pi-llm-wiki

English | 中文 | Español | 日本語 | Deutsch | Français | Português | Русский | 한국어 | हिंदी

CI npm npm downloads Coverage License: MIT Docs CodeQL GitHub Repo Stars


pi를 위한 자체 유지 관리, Obsidian 호환 지식 베이스입니다. Andrej Karpathy의 LLM Wiki 패턴을 따릅니다. Follows Andrej Karpathy's LLM Wiki pattern.

원시 소스(URL, PDF, 마크다운, JSON, XML)를 시간이 지남에 따라 축적되는 내구성 있고 상호 연결된 LLM 유지 관리 Wiki로 변환합니다.

Open Knowledge Format (OKF) v0.2 네이티브 지원

폐쇄적인 앱 전용 내보내기가 아니라 계속 활용할 수 있는 지식 베이스를 구축하세요:

  • 이식 가능한 OKF v0.2 문서 생성 — 표준 frontmatter, 표준 Markdown 링크, 안정적인 소스 인용을 사용합니다.
  • 레거시 및 OKF 페이지를 모두 읽기 — 기존 vault를 자동 migration이나 재작성 없이 계속 사용할 수 있습니다.
  • 권위 있는 페이지에서 결정론적 index와 log 생성 — 탐색과 metadata를 재현 가능하게 유지합니다.
  • Pi 또는 MCP에서 동일한 지식 모델 사용 — Claude Code, Cursor, Windsurf 및 기타 MCP 클라이언트에서 사용할 수 있습니다.
  • Obsidian 호환성 유지 — Open Knowledge Format을 지원하는 도구에서 바로 사용할 수 있는 지식을 구축합니다.

새 OKF vault로 시작하거나, 기존 vault에 pi-llm-wiki를 연결하고 원하는 시점에 형식을 도입하세요. 구현 세부 사항은 OKF Foundation 사양을 참조하세요.


데모

pi-llm-wiki 데모

Quick Start

pi (@mariozechner/pi-coding-agent):

pi install npm:@zosmaai/pi-llm-wiki

oh-my-pi (omp):

omp install @zosmaai/pi-llm-wiki

Both hosts load the same extension, skill, and /wiki-* slash commands — see Dual-host support for what differs.

Other harnesses via MCP

Claude Code, Codex, Cursor, Windsurf, Zed, Cline, and other MCP-capable harnesses use the packaged stdio server. Start with the Claude marketplace:

/plugin marketplace add https://github.com/zosmaai/pi-llm-wiki
/plugin install llm-wiki@zosmaai
/reload-plugins

For every other MCP client, install the package and register dist/mcp/index.js as a local stdio server:

npm install --save-dev @zosmaai/pi-llm-wiki@latest

Use the client-specific JSON/TOML examples in docs/harnesses.md. They cover Codex CLI, Cursor, Windsurf, Zed, Cline, and a generic MCP configuration. Set WIKI_ROOT to pin the vault; use an absolute server path because MCP clients do not expand ~.

The extension will proactively suggest creating a wiki on your first session. Alternatively:

/wiki-init "AI Engineering"
/wiki-ingest
/wiki-query What are the key patterns?

이 패키지를 사용하는 이유

대부분의 파일 기반 LLM 워크플로는 원샷 RAG처럼 동작합니다: 모델이 질문할 때마다 원시 문서를 검색합니다. 합성은 일시적입니다.

pi-llm-wiki는 중간 계층을 만듭니다:

  • 원시 소스 패킷은 원본 입력을 보존
  • 소스 페이지는 각 소스가 말하는 내용을 요약
  • 표준 Wiki 페이지는 Wiki가 현재 믿고 있는 것을 추적
  • 생성된 메타데이터는 모든 것을 검색 가능하고 탐색 가능하게 유지

결과는 소스를 캡처하고, 질문하고, 내구성 있는 분석을 보관할수록 축적되는 Wiki입니다.


기능

Capability Description
🏠 Personal fallback Always-on ~/.llm-wiki/ vault — knowledge compounds across projects even when no project wiki exists
🔗 Immutable source capture URLs, local files (PDF/md/txt/html/XML/JSON), or pasted text → structured source packets
🧠 Automated ingestion wiki_ingest batch-processes sources into concept, entity, synthesis & analysis pages
🔍 Full-text search Generated registry with keyword lookup across all pages and sources
🩺 Mechanical linting Orphans, broken links, duplicate aliases, coverage gaps, stale captures
📊 Dashboard wiki_status — counts, source states, recent activity
🤖 Auto-update watch wiki_watch — print a crontab line that runs the full cycle on a schedule
🧠 Layered recall Searches both personal (~/.llm-wiki/) and project (.llm-wiki/) vaults — personal knowledge follows you everywhere
📝 Auto-bootstrap Extension suggests creating a wiki when none exists in the current directory
💾 Lightweight capture wiki_retro — save atomic insights as a single markdown file; full 4-layer pipeline also available via wiki_capture_source
🧭 Agent working-memory (opt-in) wiki_capture_trajectory records how a task was solved (tool-call trajectory) → distill into reusable skill/case pages → wiki_recall_skill surfaces them next time. Off by default; enable with /wiki-trajectories on
🌐 OKF v0.2 네이티브 이식 가능한 Open Knowledge Format 문서, 레거시 vault dual-read 호환성, 결정론적 projection
🌐 MCP 서버 Claude Code, Cursor, Windsurf에서 stdio MCP transport를 통해 동일한 OKF 지원 Wiki 사용
📝 Obsidian-friendly Folder-qualified wikilinks, stable source-ID citations, compatible vault
🛡️ Guardrails Blocks direct edits to raw sources and generated metadata
🔧 Configurable PDF extraction MarkItDown timeout via WIKI_MARKITDOWN_TIMEOUT_MS env var
🧪 Quality checks TypeScript, Vitest, Biome, Codecov, CodeQL

도구

Tool Description
wiki_bootstrap Initialize a new wiki vault with config, templates, schema, and metadata
wiki_capture_source Capture a URL, local file, or pasted text into an immutable source packet
wiki_recall Search wiki for task-relevant pages — searches both personal (~/.llm-wiki/) and project (.llm-wiki/) vaults, deduplicated
wiki_retro Save atomic insights from completed tasks into the wiki
wiki_ingest Process uningested source packets into wiki pages (batch)
wiki_ensure_page Resolve or safely create entity / concept / synthesis / analysis pages
wiki_search Search the generated wiki registry
wiki_lint Deterministic health checks (orphans, gaps, contradictions, auto-fix)
wiki_status Show counts, source states, and recent activity
wiki_observe 현재 세션의 시각이 기록된 검색 가능한 관찰을 wiki에 기록
wiki_rebuild_meta Force a full metadata rebuild (registry, backlinks, index, log)
wiki_reindex_embeddings 신규/변경된 페이지의 시맨틱 임베딩을 재인덱싱 (임베딩 제공자 미설정 시 no-op)
wiki_log_event Append a structured event to the wiki activity log
wiki_watch Print a crontab line for automatic wiki updates (daily / weekly / hourly) — does not install it
wiki_capture_trajectory (opt-in) Capture the completed task's tool-call trajectory (agent working-memory)
wiki_distill_skills (opt-in) Batch undistilled trajectories for synthesis into reusable skill pages
wiki_recall_skill (opt-in) Recall distilled skills + similar past cases — "have I done this before?"

The three agent-trajectory tools are off by default (issue #80). Enable them with /wiki-trajectories on (sets llm-wiki.trajectories); when off they are not registered at all.

슬래시 명령

Command Description
/wiki-init <topic> Initialize a new LLM Wiki vault
/wiki-ingest [path] Process new source files and update the wiki
/wiki-query <question> Ask questions against the wiki with citations
/wiki-discover [--topic <topic>] Auto-discover new sources from the web
/wiki-run [--schedule daily|weekly] Full cycle: discover → ingest → lint
/wiki-lint [--fix] Health check (orphans, contradictions, gaps)
/wiki-status Show a concise operational summary
/wiki-digest [--period daily|weekly] Generate a digest of recent activity
/wiki-retro Save atomic insights from completed tasks
`/wiki-model [provider/id session]`
/wiki-req <concept> Decompose a concept into atomic, traceable requirement pages
/wiki-trajectories <on|off> Enable/disable agent working-memory (opt-in, off by default)
/wiki-record <title> Capture the completed task's trajectory (requires trajectories enabled)
/wiki-skills [query] Search distilled skills + past cases (requires trajectories enabled)
/wiki-settings 대화형 설정 화면 — llm-wiki 설정을 project/global 스코프로 보기/변경
/wiki-dashboard 읽기 전용 볼트 대시보드 — 페이지 수/유형, 신선도, 7일 활동, ingest 대기열, 백링크 0 페이지, 임베딩 커버리지
wiki-dashboard: 볼트 대시보드

Layered Vault Architecture

Knowledge follows you everywhere. pi-llm-wiki uses a layered vault system:

Layer Location Purpose
🏠 Personal ~/.llm-wiki/ Always active. Zero setup. Knowledge compounds across all your sessions — regardless of which project you're in.
📁 Project {project}/.llm-wiki/ Explicit opt-in. Dedicated wiki per project, sharing personal knowledge when relevant.
🏢 Company (future) git-tracked Shared wiki across a team. wiki_publish promotes personal/project pages to the company wiki.

How it works:

  1. resolveVaultRoot() checks: cwd → walk up for .llm-wiki/ → ~/.llm-wiki/
  2. wiki_recall (layered) searches both personal and project vaults, merging results with vault labels
  3. Personal results are shown first in recall output, tagged as "📓 personal"
  4. wiki_retro writes to whichever vault is active (project takes priority)
  5. Set WIKI_HOME env var to override the personal wiki location

This means: you can have a project wiki for team documentation and a personal wiki for your own notes, and recall searches both simultaneously.


Quick Start (Detailed)

1) Create a new wiki

mkdir my-wiki
cd my-wiki
pi

Ask pi:

Initialize an llm wiki here for AI research.

This calls wiki_bootstrap and creates:

.llm-wiki/
├── config.json
├── templates/
├── raw/
├── wiki/
├── meta/
└── WIKI_SCHEMA.md

2) Capture a source

Capture this article into the wiki: https://example.com/some-article
Capture this PDF into the wiki: ./papers/context-windows.pdf
Capture these notes into the wiki: ...pasted text...

3) Integrate the source

  1. Capture the source
  2. Read .llm-wiki/wiki/sources/SRC-*.md
  3. Update that source page
  4. Search for impacted canonical pages with wiki_search
  5. Create missing pages with wiki_ensure_page
  6. Update concept / entity / synthesis pages with citations
  7. Mark the integration with wiki_log_event kind=integrate

4) Query the wiki

Based on the wiki, what are the main tradeoffs between long-context models and RAG?

By default, query mode is read-only. To file a durable answer:

Answer the question and file the result as an analysis page.

Vault Layout

my-wiki/
└─ .llm-wiki/
   ├─ config.json               # Vault config
   ├─ templates/                 # Page templates
   ├─ raw/
   │  └─ sources/
   │     └─ SRC-2026-05-11-001/
   │        ├─ manifest.json
   │        ├─ original/           # Original artifact
   │        ├─ extracted.md        # Normalized text
   │        └─ attachments/
   ├─ wiki/
   │  ├─ sources/                  # Source pages (what each source says)
   │  ├─ concepts/                 # Concepts and recurring ideas
   │  ├─ entities/                 # People, orgs, products, papers, systems
   │  ├─ syntheses/                # Cross-source theses and tensions
   │  └─ analyses/                 # Durable filed answers from queries
   ├─ meta/
   │  ├─ registry.json             # Auto-generated search index
   │  ├─ backlinks.json
   │  ├─ index.md
   │  ├─ events.jsonl              # Append-only event log
   │  ├─ log.md
   │  └─ lint-report.md
   └─ WIKI_SCHEMA.md               # Operating manual

Ownership Model

Path Owner Rule
Path Owner Rule
------ ------- ------
.llm-wiki/raw/** Extension tools Immutable after capture
.llm-wiki/wiki/** Model + user Editable knowledge pages
.llm-wiki/meta/registry.json Extension Generated
.llm-wiki/meta/backlinks.json Extension Generated
.llm-wiki/meta/index.md Extension Generated
.llm-wiki/meta/events.jsonl Extension / tool Authoritative append-only state; back up for activity continuity
.llm-wiki/meta/log.md Extension Generated from events
.llm-wiki/meta/lint-report.md Extension Generated
.llm-wiki/WIKI_SCHEMA.md Human + explicit request Operating manual

Activity history, backup, and portability

meta/events.jsonl is the authoritative source for recorded extension activity. Unlike registry, backlinks, indexes, logs, and embeddings, it cannot be rebuilt from wiki pages or raw packets. Preserve it when backing up or Git-synchronizing a complete pi-llm-wiki vault.

meta/log.md and OKF-mode wiki/log.md are generated views. wiki/log.md can travel with the OKF bundle as a readable snapshot, but it cannot reconstruct or resume the originating JSONL stream. Manual page edits are intentionally absent, so this is selected extension activity rather than a complete revision audit.

File-capture events omit machine-local paths from the public log projection. Callers of wiki_log_event still control arbitrary detail fields and must not record secrets or private host paths.


Linking & Citation Style

Internal Navigation

[[concepts/retrieval-augmented-generation]]
[[entities/openai|OpenAI]]
[[syntheses/long-context-vs-rag]]

Factual Citations

[[sources/SRC-2026-04-04-001|SRC-2026-04-04-001]]

Stable source-page IDs keep provenance stable even if titles change.


Guardrails

The extension blocks direct tool-call edits to:

  • .llm-wiki/raw/** — immutable source artifacts
  • .llm-wiki/meta/registry.json
  • .llm-wiki/meta/backlinks.json
  • .llm-wiki/meta/events.jsonl
  • .llm-wiki/meta/index.md
  • .llm-wiki/meta/log.md
  • .llm-wiki/meta/lint-report.md

If the model directly edits .llm-wiki/wiki/** using Pi's built-in write or edit tools, the extension automatically rebuilds generated metadata at the end of the agent turn.


Source Packet Format

Each captured source is stored as a structured packet:

.llm-wiki/raw/sources/SRC-YYYY-MM-DD-NNN/
├─ manifest.json     # Capture metadata (title, URL, format, timestamp)
├─ original/         # Original artifact (preserved as-is)
├─ extracted.md      # Normalized text (PDF→md, XML→md, JSON→md, etc.)
└─ attachments/      # Future attachment downloads

This preserves both the original artifact and a normalized extracted view for reading.


MCP Server

Use the wiki from any MCP-compatible tool — Claude Code, Cursor, Windsurf, and others.

The package ships a standalone MCP server exposing 15 wiki tools over stdio:

Tool Description
wiki_bootstrap Initialize a vault
wiki_recall Search relevant wiki pages
wiki_search Search the registry
wiki_status Show wiki health and counts
wiki_retro Save an atomic insight
wiki_capture_source Capture a source packet
wiki_ingest Synthesize captured sources synchronously over the configured task model
wiki_reindex Rebuild/repair QMD indexes
wiki_ensure_page Safely create a canonical page
wiki_lint Run deterministic health checks
wiki_log_event Append an activity event
wiki_observe Save a timestamped observation
wiki_rebuild_meta Rebuild metadata projections
wiki_reindex_embeddings Refresh semantic embeddings
wiki_watch Print an update cron line

Usage

# Auto-discovered by pi:
pi install npm:@zosmaai/pi-llm-wiki

# Standalone with any MCP client:
WIKI_ROOT=~/my-wiki node node_modules/@zosmaai/pi-llm-wiki/dist/mcp/index.js

Set WIKI_ROOT to your wiki vault directory. If unset, the server auto-detects from the current working directory.

Claude marketplace installation

/plugin marketplace add https://github.com/zosmaai/pi-llm-wiki
/plugin install llm-wiki@zosmaai
/reload-plugins

Client configuration

The same server as an entry in .mcp.json (Claude Code) or claude_desktop_config.json:

{
  "mcpServers": {
    "llm-wiki": {
      "command": "node",
      "args": ["/absolute/path/to/node_modules/@zosmaai/pi-llm-wiki/dist/mcp/index.js"],
      "env": { "WIKI_ROOT": "/absolute/path/to/my-wiki" }
    }
  }
}

MCP clients spawn the command without a shell, so ~ is never expanded. A ~/my-wiki in args or env is passed through literally and the server fails to start, which the client reports only as a generic connection error — use absolute paths here. The shell snippet above is fine: your shell expands ~ before node sees it.


Dual-host support (pi + oh-my-pi)

The package targets two hosts from a single codebase:

pi (@mariozechner/pi-coding-agent) oh-my-pi (omp)
Extension entry package.json#pi.extensions package.json#omp.extensions (falls back to #pi)
Skill skills/llm-wiki/SKILL.md via pi.skills same file, found by directory convention
Slash commands prompts/*.md via pi.prompts commands/*.md (generated mirror of prompts/)
Project config <cwd>/.pi/settings.json <cwd>/.omp/settings.json, then .omp/config.yml
User config ~/.pi/agent/settings.json ~/.omp/agent/settings.json, then config.yml
MCP server auto-registered via pi.mcpservers register manually (see below)
Ambient surfaces without a project wiki on (personal vault) off — see below

No source changes are needed for the imports: oh-my-pi rewrites @mariozechner/pi-* and bare typebox specifiers onto its own bundled packages when it loads a legacy extension.

Settings are read from both layouts. llm-wiki config is merged from every file above, host-native directory last. A vault configured under pi keeps working after omp takes over the same repository, and writes land in whichever config directory already exists (so a .pi-only repo does not sprout a second settings file). Writes are always JSON — a hand-authored config.yml is read but never rewritten.

Set LLM_WIKI_HOST=pi|omp to override host detection; by default it is derived from the resolved agent directory.

Ambient surfaces are gated under oh-my-pi. The session notice, the periodic observe/retro reminder, and before_agent_start recall all fire unprompted, and vault resolution falls back to the personal vault — so once ~/.llm-wiki/ exists they would speak up in every directory. Under pi that is the historical behaviour and it is kept; under omp the plugin is installed once and loads in every project, so a repository that never ran /wiki-init stays quiet. Override either default with llm-wiki.ambientPersonalVault. The wiki tools and slash commands are registered regardless, so /wiki-init always works — and a project with its own .llm-wiki/ gets every surface back.

MCP under oh-my-pi. pi.mcpservers is a pi-only manifest key, and the server's vault auto-detection depends on the client's working directory, so it cannot be declared with a relative path. Register it explicitly instead:

// <cwd>/.omp/.mcp.json
{
  "mcpServers": {
    "llm-wiki": {
      "command": "node",
      "args": ["/abs/path/to/node_modules/@zosmaai/pi-llm-wiki/dist/mcp/index.js"],
      "env": { "WIKI_ROOT": "/abs/path/to/your/wiki" }
    }
  }
}

You rarely need it: under either host the extension already registers the same capabilities as native tools.


Skill Behavior

The bundled llm-wiki skill teaches the model to:

  • ❌ Never edit raw sources directly
  • ❌ Never edit generated metadata files
  • ✅ Capture first, integrate second
  • ✅ Search before creating new canonical pages
  • ✅ Cite facts using source-page IDs
  • ✅ Keep query mode read-only by default
  • ✅ Use "Tensions / caveats" and "Open questions" when evidence is mixed

Architecture

Vault Layers

See the Layered Vault Architecture section above for the personal/project/company layering.

Four-Layer Page Model

Each wiki vault has four layers with clear ownership:

.llm-wiki/raw/sources/SRC-*/     # Immutable source packets (extension-owned)
.llm-wiki/wiki/                   # Editable knowledge pages (you + LLM)
.llm-wiki/meta/                   # Durable event source + generated internal projections
.llm-wiki/                        # Config and templates

Read docs/architecture.md for the full design document.


Documentation

Document What it covers
Architecture How the four layers work, ownership model
Commands All slash commands and tool reference
Obsidian Integration Vault setup and recommended plugins
Configuration Wiki modes, topics, environment variables
API Extension tool parameter reference

Contributing

See CONTRIBUTING.md for development setup, test patterns, and PR workflow.


Thank you for starring pi-llm-wiki!
If you find pi-llm-wiki useful, ⭐ star the repo — it lets us know we're building something that matters.

Contributors

Thanks to everyone who has contributed! This list is regenerated automatically by .github/workflows/contributors.yml — see #60 for the rationale.

arjun-zosma
Arjun Nayak
Shanvit7
Shanvit S Shetty
jfraser
James Fraser
mkuhl
Mike P. Kuhl
CelestialCreator
Akshay
prestalab
PrestaLab
wooksong
wooksong
xcsf
xcsf
danielnaab
Daniel Naab
mdmayfield
Matt Mayfield
deestax
Superdao
mystery4f
标准萌新

Full history: contributors graph.


Built with ❤️ by zosmaai · pi.dev · Issues

License

MIT

Harness support

Runs natively in pi, and as an MCP server in Claude Code (plugin), Codex, Cursor, Windsurf, Zed and opencode. See docs/harnesses.md.

관련 프로젝트 살펴보기

불러오는 중…