| name | llm-wiki |
| version | 2.1.0 |
| description | Karpathy's LLM Wiki — build and maintain a persistent, compounding markdown knowledge base across sessions. Use proactively whenever valuable knowledge could be saved for later — do NOT let insights disappear between sessions. Use whenever the user wants to create a wiki, ingest sources, query compiled knowledge, build a knowledge base, or maintain project memory that persists between sessions. Activate on: wiki, create a wiki, ingest into wiki, query wiki, wiki lint, build a knowledge base, remember this, save this to my wiki, I learned something about X, this should be in my wiki. |
| tags | ["knowledge-management","wiki","markdown","project-memory","note-taking"] |
| category | productivity |
| compatibility | {"tools":["Read","Write","Grep","Glob","Bash"],"dependencies":[]} |
Karpathy's LLM Wiki
Build and maintain a persistent, compounding knowledge base as interlinked markdown files. Based on Karpathy's LLM Wiki pattern.
Unlike traditional RAG, the wiki compiles knowledge once and keeps it current. Cross-references are already there. Contradictions are flagged. The wiki is the single source of truth.
Division of labor: The human curates sources and directs analysis. The agent summarizes, cross-references, files, and maintains consistency.
Wiki Location
Default: wiki/ (relative to project root, e.g. ./wiki/). Set via wiki.path in .omc-config.json or environment variable WIKI_PATH.
The wiki is a directory of markdown files — open it in Obsidian, VS Code, or any editor.
Architecture: Three Layers
wiki/
├── SCHEMA.md # Conventions, structure rules, domain config
├── index.md # Sectioned content catalog with one-line summaries
├── log.md # Append-only operation chronicle
├── raw/ # Layer 1: Immutable source material
│ ├── articles/ # Web articles, clippings — `{date}-{slug}.md`
│ ├── papers/ # PDFs, arxiv papers — `{date}-{slug}.pdf`
│ ├── transcripts/ # Meeting notes, interviews — `{date}-{slug}.md`
│ └── assets/ # Images, diagrams — `{date}-{slug}.{ext}`
├── entities/ # Layer 2: Entity pages (people, orgs, products, models)
├── concepts/ # Layer 2: Concept/topic pages
├── comparisons/ # Layer 2: Side-by-side analyses
└── queries/ # Layer 2: Filed query results worth keeping
Layer 1 — Raw Sources: Immutable. The agent reads but never modifies these.
Layer 2 — The Wiki: Agent-owned markdown files. Created, updated, and cross-referenced by the agent.
Layer 3 — The Schema: SCHEMA.md defines structure, conventions, and tag taxonomy.
Resuming an Existing Wiki (CRITICAL — do this first)
When the user has an existing wiki, orient yourself before doing anything:
- Read
SCHEMA.md — understand the domain, conventions, and tag taxonomy
- Read
index.md — learn what pages exist and their summaries
- Scan recent
log.md — read the last 20-30 entries to understand recent activity
Only after orientation should you ingest, query, or lint. This prevents duplicates, missing cross-references, and schema violations.
Core Operations
1. Ingest
When the user provides a source (URL, file, paste, or direct knowledge), integrate it into the wiki:
- Capture the raw source — save to appropriate
raw/ subdirectory
- Discuss takeaways with the user
- Check what already exists — read
index.md and search existing pages with Grep
- Write or update wiki pages — create only if Page Thresholds are met
- Update navigation — add to
index.md, append to log.md
- Report what changed — list every file created or updated
2. Query
When the user asks a question about the wiki's domain:
- Read
index.md to identify relevant pages
- For wikis with 100+ pages, also
Grep for key terms
- Read the relevant pages
- Synthesize an answer from compiled knowledge with citations
- File valuable answers back — create pages for substantial answers
- Update
log.md with the query and whether it was filed
3. Lint
When the user asks to lint, health-check, or audit the wiki:
- Orphan pages — Find pages with no inbound
[[wikilinks]]
- Broken wikilinks — Find links pointing to pages that don't exist
- Index completeness — Every wiki page should appear in
index.md
- Frontmatter validation — Check required fields and tags
- Stale content — Pages not updated in 30+ days
- Contradictions — Pages on the same topic with conflicting claims
- Page size — Flag pages over 200 lines
- Tag audit — List all tags, flag any not in taxonomy
- Log rotation — Rotate if exceeds 500 entries
- Report findings grouped by severity
- Append to
log.md
Wiki Page Structure
Every wiki page MUST have YAML frontmatter. The format is compatible with Obsidian Properties.
Standard YAML Format
---
title: "Page Title"
tags: ["tag1", "tag2"]
created: "YYYY-MM-DDTHH:MM:SS.000Z"
updated: "YYYY-MM-DDTHH:MM:SS.000Z"
sources: ["session-id-abc123"]
links: ["other-page-slug.md"]
category: reference
confidence: medium
---
Obsidian Properties Format
When the wiki is opened as an Obsidian vault, the same frontmatter is valid Obsidian Properties:
---
title: "Page Title"
tags:
- tag1
- tag2
created: "YYYY-MM-DDTHH:MM:SS.000Z"
updated: "YYYY-MM-DDTHH:MM:SS.000Z"
sources:
- session-id-abc123
links:
- other-page-slug.md
category: reference
confidence: medium
---
Both formats are valid. Obsidian reads tags as its tag system and created/updated as date properties natively.
Frontmatter Fields
| Field | Type | Required | Description |
|---|
title | string | Yes | Human-readable title |
tags | string[] | Yes | From approved taxonomy |
created | ISO 8601 | Yes | UTC creation timestamp |
updated | ISO 8601 | Yes | UTC last-modified timestamp |
sources | string[] | No | Session IDs, URLs, file paths |
links | string[] | No | Slugs of [[wikilinks]] in content |
category | enum | Yes | See Categories below |
confidence | enum | Yes | high, medium, low |
Categories
Pages are organized by category:
| Category | Use for |
|---|
architecture | System design, component relationships, data flows |
decision | Architectural decisions, trade-off reasoning, "why we chose X" |
pattern | Reusable code patterns, design patterns, conventions |
debugging | Bug investigations, root causes, troubleshooting guides |
environment | Project setup, tooling, environment-specific config |
session-log | Auto-captured session metadata (not human-authored) |
reference | API docs, CLI commands, configuration reference |
convention | Team conventions, coding standards, style guidelines |
Confidence Levels
high — Confirmed by code, docs, or trusted source
medium — Likely correct, minor uncertainty
low — Unverified; user should double-check
Cross-References
Use [[wikilink]] syntax to link between pages. Every page must link to at least 2 other wiki pages.
Link text format: [[page-slug]] or [[page-slug|Display Text]].
Merge Strategy
Append only — never replace existing content. If a page with the same title exists, read it first and merge.
When updating an existing page, append new content as a timestamped section:
## Update (YYYY-MM-DD)
New content here...
Tags and sources are merged (union). Confidence is kept at the higher level.
After writing content, scan for [[wikilinks]] and update the links: field in frontmatter accordingly.
Auto-Capture
At session end, capture significant discoveries as session-log pages. Configure via wiki.autoCapture in .omc-config.json (default: enabled).
Hard Constraints
- Merge, never replace — if a page exists, always read it first and append; never delete and recreate
- NO vector embeddings — query uses keyword + tag matching only
- Wiki pages are git-ignored — wiki directory is project-local
- Never modify
raw/ — sources are immutable
- Every page needs 2+ cross-references — no orphan pages
- Follow page thresholds — don't create pages for passing mentions
- Frontmatter is required — all 7 fields must be present
- Tags must come from taxonomy — don't invent tags
- Keep pages scannable — split pages over 200 lines
- Rotate the log — rename to
log-YYYY.md when it exceeds 500 entries
- Handle contradictions explicitly — note both claims, flag for review
Searching the Wiki
Grep pattern="transformer" path="$WIKI" glob="*.md"
Glob pattern="*.md" path="$WIKI/concepts"
Read path="$WIKI/log.md" offset=<last 20 lines>
Templates
Reference templates are in the references/ directory:
| File | Purpose |
|---|
references/SCHEMA-template.md | Domain schema with category/tag taxonomy and policies |
references/page-template.md | Individual wiki page template with frontmatter |
references/index-template.md | Auto-generated index format |
references/log-template.md | Append-only log entry format |
Read the relevant template before creating or updating wiki files.
Initializing a New Wiki
When the user asks to create or start a wiki:
- Determine the wiki path (default:
wiki/ relative to project root, e.g. ./wiki/)
- Create the directory structure
- Ask the user what domain the wiki covers
- Copy
references/SCHEMA-template.md → wiki/SCHEMA.md and customize
- Copy
references/index-template.md → wiki/index.md with page count = 0
- Create initial
wiki/log.md with creation entry
- Confirm the wiki is ready and suggest first sources to ingest