Install
openclaw skills install 041-llm-wikiKarpathy's llm-wiki pattern implementation — cumulative knowledge management for AI agents
openclaw skills install 041-llm-wikiAgents should distinguish wiki maintenance dates from source/work dates:
created / updated: when the wiki page was created or edited.sources_meta[].published: when the paper, post, release, documentation, or work appeared.sources_meta[].collected: when the user saved, collected, or imported it.sources_meta[].ingested: when llm-wiki processed it.sources_meta[].date_precision: day, month, year, or unknown.When multiple works are discussed, preserve historical order in the prose or in a ## 时间线 / ## Timeline section. Do not infer missing months or days.
Use native Markdown to make time visible without relying on HTML, colors, or wide tables:
### 时间定位 / ### Temporal Position with a blockquote summary:
> **时间范围**:YYYY.MM-YYYY.MM> **阶段判断**:one concise sentence about the historical stage- **[2025.09] Work or event name**: why it matters.- **[2026.01] Follow-up work**: what changed.**[YYYY.MM-YYYY.MM]** for ranges and **[YYYY]** when only year precision is reliable.### 时间定位, ## 时间线, ### 与已有知识的关系, ## Related Pages, and source-note summaries.Use scripts/agent-bridge.py as the single entry point for all tool-assisted operations:
# Environment check
python scripts/agent-bridge.py check
# Discover relations for a new page
python scripts/agent-bridge.py link --source "NewPage" --mode light
# Execute merge with diff review
python scripts/agent-bridge.py link --source "NewPage" --target "OldPage" --strategy append_related
# Batch global linking for recent pages
python scripts/agent-bridge.py relink --since 2026-04-20 --mode deep
# Health check
python scripts/agent-bridge.py lint
# Status overview
python scripts/agent-bridge.py status
Why Agent Bridge?
For tasks requiring LLM judgment (content extraction, synthesis, strategy selection):
"Please ingest sources/paper.pdf into wiki"
"Query wiki: What is the difference between Transformer and RNN?"
"Check wiki health"
Direct library access for scripting or debugging:
# Show wiki status overview
python -m src.llm_wiki status
# Run health check
python -m src.llm_wiki lint
# Show help
python -m src.llm_wiki --help
Note: ingest and query commands in legacy CLI only provide auxiliary functions (like listing pages). Actual content processing requires natural language interaction with the agent.
Karpathy's llm-wiki pattern implementation — cumulative knowledge management for AI agents.
Core Philosophy: LLM as programmer, Wiki as codebase, User as product manager.
We chose the SKILL form because it brings these advantages:
[[PageName]] format with canonical page files; avoid duplicate shell pages# 1. Clone
git clone https://github.com/Nemo4110/llm-wiki.git
cd llm-wiki
# 2. Add source material
cp ~/Downloads/paper.pdf sources/
# 3. Tell your agent
"Please ingest sources/paper.pdf into wiki"
No installation needed. Agent reads CLAUDE.md and operates directly.
# Create virtual environment and install dependencies
uv venv
uv pip install -r src/requirements.txt --python .venv/Scripts/python.exe
# Activate environment (Windows)
.venv\Scripts\activate
# Or Linux/macOS
source .venv/bin/activate
# Create environment
conda create -n llm-wiki python=3.11
# Activate environment
conda activate llm-wiki
# Install dependencies
pip install -r src/requirements.txt
# Create virtual environment
python -m venv .venv
# Activate environment
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
# Install dependencies
pip install -r src/requirements.txt
python -c "from src.llm_wiki.core import WikiManager; print('✓ Installation successful')"
Important Dependency Notes:
| Dependency | Version | Purpose | Notes |
|---|---|---|---|
click | >=8.0.0 | CLI framework | - |
pyyaml | >=6.0 | YAML parsing | - |
pymupdf | >=1.25.0 | PDF processing | Primary PDF engine, best for CJK |
Optional dependencies (for enhanced features):
numpy >=1.24.0 — Vector operations for embedding retrievalhttpx >=0.27.0 — HTTP client for Ollama/local servicesopenai >=1.0.0 — OpenAI embedding APImcp >=1.0.0 — MCP SDK for remote embedding providersFallback PDF dependency:
pdfplumber >=0.11.8 — Table extraction fallback (security version required for CVE-2025-64512)pdfminer.six >=20251107 — PDF underlying library fallbackllm-wiki/
├── CLAUDE.md # ⭐ Core protocol: Agent behavior guidelines
├── AGENTS.md # Agent implementation guide (CLI usage)
├── SKILL.md # This file, machine-readable specification
├── log.md # Timeline log (append-only)
├── sources/ # Raw materials (user-managed + tool-fetched; Agent forbidden from writing LLM-generated content)
│ └── README.md
├── wiki/ # Generated knowledge pages (Agent-managed)
│ ├── index.md # Entry index
│ └── *.md # Topic pages
├── assets/ # Templates and configuration
│ ├── page_template.md
│ └── ingest_rules.md
├── src/ # SKILL implementation (optional, for CLI)
│ ├── llm_wiki/
│ └── requirements.txt
├── scripts/ # Auxiliary scripts
├── hooks/ # Platform hooks (optional)
└── examples/ # Example wiki
About sources/: Excluded from git by default to avoid repository bloat. Wiki only retains extracted knowledge; original files are managed separately (cloud storage, Zotero, etc.). See sources/README.md for tracking specific files.
+----------+ +--------------------+ +--------------+
| sources/ |---->| LLM Processing |---->| wiki/ |
| (Raw) | | (Extract + Link) | | (Structured) |
+----------+ +--------------------+ +--------------+
|
v
+----------+
| log.md |
| (Record) |
+----------+
[[PageName]] format, compatible with Obsidian when the link target matches the canonical page fileBy default, this SKILL does not require Embedding/vector retrieval. Queries are completed through:
User asks question
|
v
+-------------------------------+
| 1. Read index.md | <-- Human/Agent-maintained category index
| Locate relevant topics |
+-------------------------------+
|
v
+-------------------------------+
| 2. Read relevant pages | <-- Discover associations through [[links]]
| and their link neighbors |
+-------------------------------+
|
v
+-------------------------------+
| 3. LLM Synthesis | <-- Generate answers based on read content
| Generate with citations | Citation format: [[PageName]]
+-------------------------------+
Optional Enhancement: After enabling config.yaml embedding settings, CLI query --semantic adds hybrid search (Keyword Match + Vector Search + Link Traversal) for faster, more accurate retrieval.
Example Flow:
User asks: "What is LoRA?"
wiki/index.md, finds [[LoRA]] under "AI/ML" topicwiki/LoRA.md, discovers links to [[Fine-tuning]], [[Adapter]]LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning method — see [[LoRA]]. Compared to traditional [[Fine-tuning]], it only trains low-rank matrices...
| Consideration | Current Solution | Embedding Solution |
|---|---|---|
| Dependencies | Zero external dependencies | Requires Embedding API or local model |
| Cost | No additional fees | Charged per token/request |
| Privacy | Data not uploaded | Must send content to external service |
| Accuracy | Precise links, explainable | Approximate similarity, may retrieve irrelevant content |
| Scale | Suitable for 0-500 pages | Essential for large scale (1000+ pages) |
Conclusion: For personal/small team knowledge bases, maintaining index.md and page links is simpler and more effective than introducing Embedding. Embedding is available as an opt-in CLI enhancement when scale demands it.
Consider enabling config.yaml embedding settings when your wiki shows:
See ROADMAP.md for details.
# Day 1: Add materials
sources/
├── 2026-04-10-transformer-paper.pdf
└── 2026-04-10-lora-blog.md
User: Please ingest new materials
Claude: Processed 2 materials
- Created [[Transformer]] — Attention mechanism architecture
- Created [[LoRA]] — Low-rank adaptation
- Created [[Self-Attention]] — Self-attention details
- Updated wiki/index.md
User: What's the difference between LoRA and full fine-tuning?
Claude (reads wiki/index.md → finds [[LoRA]] → synthesizes answer):
Based on our wiki:
**LoRA** — [[LoRA]]
- Freezes pre-trained weights, only trains low-rank matrices
- Parameter count reduced ~10,000x
**Full Fine-tuning**
- Updates all parameters
- High computational cost
Key differences:
1. Parameters: LoRA only trains 0.1%~1% of parameters [[Parameter Efficiency]]
2. Storage: LoRA only saves adapters, not full model
3. Composition: Multiple LoRAs can be stacked [[LoRA Composition]]
Was this helpful? Should I archive this answer to wiki?
User: Yes, archive this answer
Claude: Created [[LoRA vs Full Fine-tuning]]
- Extracted comparison points from conversation
- Linked to [[LoRA]] and [[Fine-tuning]]
- Added to FAQ section in wiki/index.md
wiki/ directory in Obsidian| Solution | Characteristics | Best For |
|---|---|---|
| This SKILL | Zero dependencies, pure text, Claude Code native | Personal knowledge management, research notes |
| Sage-Wiki | Full-featured, multimodal, standalone app | Team knowledge base, enterprise deployment |
| Obsidian + Plugins | Strong visualization, rich community | Existing Obsidian workflow |
| Notion/Logseq | Collaborative, real-time sync | Multi-user collaboration, mobile access |
Issues and PRs welcome!
MIT — free to use, modify, and distribute.
Inspired by Karpathy's llm-wiki