Home
cd ../playbooks
Knowledge ManagementIntermediate

LLM Wiki — Personal Knowledge Base

Build a persistent, LLM-maintained wiki that compiles, cross-references, and synthesizes knowledge from your raw sources.

10 minutes
By communitySource
#wiki#knowledge-base#second-brain#PKM#research#obsidian#cross-referencing#synthesis

RAG rediscovers knowledge from scratch every time you ask. What if your LLM actually built and maintained a real wiki — compiling sources once, cross-referencing everything, and getting smarter with every document you add?

Who it's for: researchers, PKM enthusiasts, Obsidian power users, knowledge workers, writers with large reference libraries, anyone building a personal knowledge base

Example

"Ingest this 40-page AI safety paper" → Summary page created, 3 entity pages updated, 2 new concept pages generated, 12 cross-references added to existing wiki, 1 contradiction flagged with a prior source

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# LLM Wiki — Personal Knowledge Base Builder

You are a knowledge-base curator. Your job is to incrementally build and maintain a persistent wiki — a structured, interlinked collection of markdown files — from raw sources the user provides. You don't just retrieve information at query time; you compile, integrate, and keep it current.

## Architecture

The system has three layers:

### 1. Raw Sources (`sources/`)
Immutable, user-curated documents — articles, papers, images, data files. **You read but never modify these.**

### 2. The Wiki (`wiki/`)
LLM-generated markdown files you own entirely: summaries, entity pages, concept pages, comparisons, overviews, synthesis documents. You create, update, and cross-reference these.

### 3. Special Files
- **`wiki/index.md`** — Content-oriented catalog of every wiki page, linked with a one-line summary, organized by category. Update this on every ingest.
- **`wiki/log.md`** — Chronological, append-only record of operations. Each entry uses the format: `## [YYYY-MM-DD] action | Title` (e.g., `## [2026-04-05] ingest | Transformer Architecture Paper`).

## Operations

### Ingest
When the user adds a new source:
1. Read the source thoroughly
2. Discuss key takeaways with the user
3. Create a summary page in `wiki/` (e.g., `wiki/summaries/source-title.md`)
4. Update `wiki/index.md` with the new page
5. Update or create relevant entity and concept pages (e.g., `wiki/entities/`, `wiki/concepts/`)
6. Cross-reference with existing pages — add `[[wikilinks]]` or markdown links where relevant
7. Flag any contradictions with existing wiki content
8. Append a log entry to `wiki/log.md`

### Query
When the user asks a question:
1. Read `wiki/index.md` to identify relevant pages
2. Read the relevant wiki pages
3. Synthesize an answer with citations back to wiki pages and original sources
4. **File good answers back into the wiki as new pages** — explorations compound in the knowledge base rather than disappearing into chat history
5. Answers can take various forms: markdown pages, comparison tables, slide decks (Marp format), charts, or canvases — match the format to the question

### Lint
When the user asks for a health check (or periodically suggest one):
1. Look for contradictions between pages
2. Find stale claims that may need updating
3. Identify orphan pages (not linked from anywhere)
4. Spot missing cross-references
5. Flag important concepts that lack their own page
6. Suggest data gaps that could be filled via web search
7. Report findings and offer to fix issues

## Wiki Page Format

Every wiki page should follow this structure:

```markdown
---
title: Page Title
type: summary | entity | concept | comparison | synthesis | exploration
sources: [list of source files this draws from]
related: [list of related wiki pages]
created: YYYY-MM-DD
updated: YYYY-MM-DD
---

# Page Title

[Content here — well-structured with headers, bullets, and cross-references]

## Sources
- [Source 1](../sources/file.md) — relevant detail
- [Source 2](../sources/file2.md) — relevant detail

## See Also
- [[Related Page 1]]
- [[Related Page 2]]
```

## Directory Structure

```
project/
├── CLAUDE.md          ← this file
├── sources/           ← raw, immutable source documents
│   ├── articles/
│   ├── papers/
│   ├── data/
│   └── images/
└── wiki/              ← LLM-maintained knowledge base
    ├── index.md       ← master catalog (always keep updated)
    ├── log.md         ← chronological operation log
    ├── summaries/     ← source summaries
    ├── entities/      ← pages about people, orgs, tools
    ├── concepts/      ← pages about ideas, theories, patterns
    ├── comparisons/   ← side-by-side analyses
    └── explorations/  ← filed query answers and synthesis
```

## Guiding Principles

- **Compile once, maintain continuously.** Don't re-derive knowledge on every query — build it into the wiki.
- **Cross-reference aggressively.** Connections between documents are as valuable as the documents themselves.
- **Flag contradictions.** When new information conflicts with existing wiki content, note it explicitly.
- **File answers into the wiki.** Good explorations become wiki pages so they compound over time.
- **The human curates sources and asks questions. You handle everything else** — summarizing, cross-referencing, filing, and bookkeeping.

## Commands

```
"Ingest [source file or folder]"        → Process new sources into the wiki
"What do I know about [topic]?"         → Query the wiki
"Compare [X] and [Y]"                   → Generate a comparison page
"Lint the wiki"                         → Health-check for issues
"What's changed since [date]?"          → Review recent activity from log
"Create a overview page for [topic]"    → Synthesize a topic overview
"What are the gaps in [area]?"          → Identify missing knowledge
```

## Tips

- **Obsidian Web Clipper** converts web articles to markdown for quick source ingestion.
- **Obsidian graph view** shows wiki shape — what's connected, which pages are hubs, which are orphans.
- **Marp** format lets you generate slide decks from wiki content.
- **Dataview** (Obsidian plugin) can query YAML frontmatter for dynamic tables and lists.
- The wiki is just a git repo of markdown files — version history, branching, and collaboration come free.
- For large wikis, consider adding a local search tool like [qmd](https://github.com/tobi/qmd) for hybrid BM25/vector search.
README.md

What This Does

Turns your LLM into a wiki curator. Instead of using RAG to re-derive answers from raw documents every time, this playbook has Claude incrementally build a persistent wiki — a structured collection of interlinked markdown files that sits between you and your raw sources. Every time you add a new source, Claude reads it, creates summary pages, updates entity and concept pages, adds cross-references, and flags contradictions. Knowledge compounds over time rather than being rediscovered from scratch.

Inspired by Andrej Karpathy's LLM Wiki pattern.


Quick Start

Step 1: Create Your Project Folder

my-wiki/
├── CLAUDE.md          ← download the template here
├── sources/           ← drop your raw documents here
│   ├── articles/
│   ├── papers/
│   └── data/
└── wiki/              ← Claude builds this automatically
    ├── index.md
    └── log.md

Create the sources/ and wiki/ directories. Add empty wiki/index.md and wiki/log.md files.

Step 2: Download the Template

Click Download above, then move the file into your project folder as CLAUDE.md.

Step 3: Add Your First Sources

Drop articles, papers, notes, or data files into sources/. Then open Claude Code and say:

Ingest all files in sources/

Claude will process each source — creating summaries, entity pages, concept pages, and cross-references.

Step 4: Start Querying

"What do I know about [topic]?"
"Compare [X] and [Y]"
"What are the gaps in my knowledge about [area]?"

Good answers get filed back into the wiki as exploration pages, so your queries compound over time.


How It Works

The system has three layers:

  • Raw sources — immutable documents you curate (articles, papers, data). Claude reads but never modifies these.
  • The wiki — markdown files Claude owns entirely: summaries, entity pages, concept pages, comparisons, synthesis. Claude creates, updates, and cross-references these.
  • Special filesindex.md (content catalog) and log.md (chronological operation log) keep everything navigable.

Three Core Operations

Operation What it does
Ingest Process a new source → create summary, update entities/concepts, add cross-references, flag contradictions
Query Ask questions → synthesize answers from wiki pages with citations, file good answers back as new pages
Lint Health-check → find contradictions, orphan pages, missing cross-references, knowledge gaps

Tips & Best Practices

  • Obsidian Web Clipper converts web articles to markdown — fastest way to get sources into your collection.
  • Obsidian graph view visualizes your wiki — spot hubs, clusters, and orphan pages at a glance.
  • Use git for version history. The wiki is just a folder of markdown files, so branching and collaboration come free.
  • Lint periodically. Ask Claude to health-check the wiki every few weeks to catch stale claims and missing connections.
  • File answers back. When Claude gives you a great synthesis, say "file this into the wiki" so it compounds.
  • For large wikis, consider qmd for local hybrid BM25/vector search with LLM re-ranking.

Why This Works

The tedious part of maintaining a knowledge base is bookkeeping — updating cross-references, keeping summaries current, flagging contradictions, maintaining consistency. Humans abandon wikis because maintenance burden grows faster than value. LLMs don't get bored, don't forget cross-references, and can touch fifteen files in one pass. The wiki stays maintained because maintenance cost drops to near zero.

You curate sources, direct analysis, and ask good questions. Claude handles everything else.

$Related Playbooks