1. 🎯 Core Principle
The LLM Wiki is a persistent, compounding personal knowledge base compiled once and kept current by an LLM-in-the-loop. Unlike traditional Retrieval-Augmented Generation (RAG) which rediscovers knowledge per query, the LLM Wiki synthesizes information, tracks contradictions, establishes cross-references, and integrates new context directly into structured, interlinked markdown pages.
The human curates sources and directs the domain constraints; the agent summarizes, cross-references, directories, and audits consistency.
2. 🗂️ Layout
A standard LLM Wiki resides at a designated directory (defaulting to ~/wiki) with the following hierarchy:
wiki/
├── SCHEMA.md # Domain conventions, taxonomy, tag constraints, page thresholds
├── index.md # Alphabetical content catalog grouped by type with one-line summaries
├── log.md # Chronological record of all updates, rotated at 500 entries
├── raw/ # Layer 1: Immutable source material
│ ├── articles/ # Web articles, text scrapes
│ ├── papers/ # PDFs, ArXiv documents
│ └── transcripts/ # Meeting transcripts, interviews
├── entities/ # Layer 2: Subject profiles (people, organizations, models)
├── concepts/ # Layer 2: Subject topics (techniques, mathematical formulations)
├── comparisons/ # Layer 2: Side-by-side matrices and evaluations
└── queries/ # Layer 2: Filed syntheses of complex user questions
📥 Layer 1: Raw Sources
Raw source documents are immutable. The agent reads from but never writes to this directory. Each source receives frontmatter mapping its origins:
---
source_url: https://0rk.de/article
ingested: YYYY-MM-DD
sha256: <body-hash>
---The SHA256 digest is calculated over the raw markdown/text body (excluding the frontmatter) to detect content drift or duplicate ingestion.
📄 Layer 2: Wiki Pages
Wiki pages contain synthesized knowledge written in markdown with standard YAML frontmatter:
---
title: Page Title
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: entity | concept | comparison | query
tags: [tag1, tag2]
sources: [raw/articles/source-file.md]
confidence: high | medium | low
contested: false
contradictions: []
---📐 Layer 3: Schema
Contains the domain definition, tag taxonomy, and page-creation thresholds. It governs what tags are allowed and what topics warrant page creation.
3. ⚙️ Core Operations
📥 Ingest Pipeline
When ingesting new material:
- Source Capture: Save the raw document into
raw/under a lowercase, hyphenated slug. Prepend the origin URL and compute its body SHA-256. If a document with the same URL already exists, verify the hash. Skip if identical; flag drift and overwrite if changed. - Entity & Concept Extraction: Identify key subjects that meet the Page Thresholds (appearing in 2+ sources or central to one).
- Index Scan: Search
index.mdand check the filesystem to locate existing pages for the extracted subjects. - Write/Update Pages:
- For new subjects, create files in their respective directories. Ensure at least two outbound
[[wikilinks]]link them to existing pages. - For existing subjects, integrate the new facts. Bump the
updateddate. - If claims conflict, follow the Conflict Policy: do not silently overwrite. Detail both perspectives with dates and sources, mark
contested: true, add the conflicting page to thecontradictionslist, and log the conflict.
- For new subjects, create files in their respective directories. Ensure at least two outbound
- Navigation Update: Append new pages to
index.mdand document the action insidelog.md.
🔎 Query Flow
When resolving user questions:
- Orientation: Read
SCHEMA.md,index.md, and the last 30 lines oflog.md. - Search: Execute regex search for keywords across the wiki directory.
- Synthesis: Synthesize a comprehensive answer, citing relevant pages using wikilinks (e.g.,
[[transformer-architecture]]). - Filing: For highly complex or side-by-side syntheses, create a page under
queries/orcomparisons/to save the work.
4. 🧭 Navigation
index.md: Tracks every page sorted alphabetically within sections corresponding to theirtype(Entities, Concepts, Comparisons, Queries).- Scale Rules:
- Split a section when it exceeds 50 entries.
- Generate a
_meta/topic-map.mdgrouping pages by theme when total entries exceed 200.
5. 🔍 Lint & Audit
The agent must programmatically audit the vault using a script or command to report on:
- Orphans: Pages with zero inbound wikilinks.
- Broken Links: Wikilinks pointing to non-existent target files.
- Index Gaps: Wiki pages present in the filesystem but missing from
index.md. - Schema Compliance: Frontmatter validation and tags not declared in
SCHEMA.md’s taxonomy. - Staleness: Pages updated >90 days ago that reference active subjects.
- Contradictions: Pages with
contested: trueor unresolved conflicts. - Size Limits: Pages exceeding 200 lines (candidates for splitting).