LLM Wiki Pattern
Summary
An LLM-maintained wiki is a persistent knowledge base that compounds over time. Instead of retrieving raw documents from scratch for every question, the agent converts sources into structured Markdown pages, keeps cross-references current, records contradictions, and files useful answers back into the repository.
Local Implementation
This repository uses three layers:
| Layer | Path | Rule |
|---|---|---|
| Raw sources | raw/ |
Original material. Treat as source of truth and avoid rewriting. |
| Published wiki synthesis | docs/ |
Agent-maintained summaries, concept pages, comparisons, analyses, and navigation files. |
| Generated site | site/ |
MkDocs build output. Publish this directory with nginx. |
| Schema and private navigation | AGENTS.md, raw/ |
Operating rules and source material that should not be exposed by nginx. |
Workflows
Ingest
- Save the original source in
raw/. - Read it and identify durable concepts, entities, claims, and open questions.
- Create or update relevant pages in
docs/. - Add or revise entries in
docs/index.md. - Append an entry to
docs/log.md.
Query
- Start with
docs/index.md. - Read relevant synthesized pages in
docs/. - Consult
raw/only when verification or direct source context is needed. - If the answer produces reusable analysis, file it as a new or updated wiki page.
Lint
Periodically check for stale claims, contradictions, orphan pages, duplicate topics, weak citations, and missing cross-links. Record meaningful lint passes in docs/log.md.
Design Principles
- Prefer synthesis over transient chat answers.
- Keep raw sources immutable and wiki pages editable.
- Make navigation cheap through
docs/index.md. - Make history inspectable through
docs/log.md. - Preserve source links so future agents can verify claims.
Source
- Local raw source:
raw/llm-wiki.md - Original gist URL: https://gist.githubusercontent.com/karpathy/442a6bf555914893e9891c11519de94f/raw/ac46de1ad27f92b28ac95459c782c07f6b8c964a/llm-wiki.md