Overview
The Concept
Architecture
Operations
Implementation
Tech Stack
Workflow
Deploy
Gist GitHub
Karpathy Pattern · nashsu Implementation

LLM Wiki

A personal knowledge base that builds itself. Instead of stateless RAG, the LLM incrementally maintains a persistent, interlinked markdown wiki — compounding over time.

The shift: Stop asking the LLM to rediscover knowledge from scratch on every query. Have it build and maintain a wiki you can browse. The bookkeeping humans abandon, LLMs handle cheerfully.
Andrej Karpathy's pattern
Reference impl: nashsu/llm_wiki
Tauri v2 desktop app
GPL-3.0
Louvain clustering
LanceDB vectors

Explore the Guide

The Concept
Karpathy's original pattern: three layers, Memex revisited, why it works.
patternmemex
Architecture
Raw sources → Wiki → Schema. The three-layer foundation.
three-layermarkdown
Operations
The three verbs: Ingest, Query, Lint. Full workflow details.
ingestquerylint
Implementation
nashsu/llm_wiki: features that extend Karpathy's pattern.
tauridesktop
Tech Stack
Tauri, React, shadcn, LanceDB, sigma.js, and LLM providers.
rusttypescript
Workflow
Quick-start: create project, import, watch wiki build itself.
usagequickstart
Install & Deploy
Pre-built binaries, build from source, Chrome Web Clipper setup.
installchrome

Quick Links

Karpathy's Gist
llm-wiki.md (the original spec)
nashsu/llm_wiki
Reference implementation
Releases
macOS, Windows, Linux binaries
Memex
Vannevar Bush, 1945
Karpathy's Original Pattern

The Concept

A pattern for using LLMs to build personal knowledge bases that accumulate and self-reference over time, rather than recomputing from raw sources on every query.

The Shift from RAG

Traditional retrieval-augmented generation (RAG) is stateless — the model rediscovers relevant context on every question by searching a corpus of raw documents. This works but it's wasteful: cross-references are recomputed, synthesis is redone, and the model never builds on its prior reasoning.

The LLM Wiki pattern inverts this. The LLM incrementally builds and maintains a persistent, structured, interlinked collection of markdown files. Over time, the wiki becomes a compounding artifact:

  • Cross-references are already there
  • Synthesis already reflects everything you've read
  • The LLM queries the wiki, not the raw sources
  • Answers get filed back as new pages — the wiki grows with use
The Memex connection: Vannevar Bush's 1945 Memex concept described a personal, interlinked knowledge store. The idea was visionary but the maintenance burden was impossible for humans. LLMs solve that burden. The LLM Wiki is Memex, finally feasible.

Why Humans Need This

Karpathy's observation:

The tedious part of maintaining a knowledge base is not the reading or the thinking — it's the bookkeeping.

Humans are good at reading and insight. They're bad at:

  • Updating 15 related pages when one new source lands
  • Noticing contradictions between notes written six months apart
  • Catching orphan pages that never got linked
  • Keeping catalogs and indexes current

LLMs excel at exactly this consistency-maintenance work. The human curates and analyzes; the LLM keeps the knowledge graph coherent.

Practical Applications

Personal Tracking

Medical records, fitness data, life decisions. A wiki per life domain.

Research

Papers, notes, experiments. The wiki becomes your second brain for a thesis or research thread.

Reading Companion

Book notes that compound. Re-read becomes re-synthesize.

Business Teams

Shared knowledge base where every Slack thread, doc, and meeting gets ingested.

Competitive Analysis

Track competitors over time — feature launches, blog posts, hires accumulate into intelligence.

Course Notes

Each lecture ingested builds interconnected mastery of the subject.

Three-Layer Design

Architecture

Three persistent layers work together: immutable sources on the bottom, LLM-generated wiki in the middle, and a schema/config document governing both.

The Three Layers

LAYER 3 — SCHEMA ┌──────────────────────────────────────────┐ │ purpose.md · schema.md · CLAUDE.md │ │ Rules, workflows, goals, LLM behavior │ └────────────────────┬─────────────────────┘ │ governs LAYER 2 — WIKI (LLM-GENERATED) ┌──────────────────────────────────────────┐ │ index.md log.md overview.md │ │ entities/ concepts/ sources/ │ │ queries/ synthesis/ comparisons/ │ └────────────────────┬─────────────────────┘ │ summarizes LAYER 1 — RAW SOURCES (IMMUTABLE) ┌──────────────────────────────────────────┐ │ PDFs, articles, images, web clips, │ │ notes, docs, transcripts, videos │ │ The LLM reads but never modifies │ └──────────────────────────────────────────┘

Layer Breakdown

Layer 1 — Raw Sources

The ground truth. Immutable. The LLM reads from here but never writes. Provenance is preserved — every claim in the wiki traces back to a specific source file and location.

Layer 2 — The Wiki

LLM-generated, structured markdown. Organized into conventional folders:

Folder / FilePurpose
index.mdContent-oriented catalog, organized by category with one-line summaries
log.mdAppend-only chronological record with parseable timestamps
overview.mdAuto-updated summary of the entire wiki's state
entities/Pages for named things: people, projects, organizations
concepts/Pages for ideas, theories, patterns
sources/One page per ingested source with metadata and summary
queries/Resolved question pages — past queries filed as reference
synthesis/Cross-cutting analysis pages stitching multiple entities
comparisons/Side-by-side analyses of related entities or concepts

Layer 3 — The Schema

A configuration document — often named CLAUDE.md or AGENTS.md in Karpathy's original, or split into purpose.md and schema.md in nashsu's implementation. This governs:

  • What the wiki is for (research thread, competitive intel, course notes)
  • How new sources should be classified
  • What page types exist and their templates
  • Tone, language, and depth preferences
  • Ingest, query, and lint workflows
The schema is the wiki's constitution. It's what makes a research wiki different from a business intel wiki from the same sources. Different purpose → different schema → different LLM behavior → different wiki.
Three Verbs

Operations

The wiki has three primary operations: Ingest, Query, and Lint. Everything else is a variation on these.

Ingest

Processing new sources into the wiki. The LLM:

1. ReadLoad the raw source into context
2. Discuss takeawaysExtract key claims, entities, concepts
3. Write source summaryCreate a new page in sources/
4. Update related pagesA single source may touch 10-15 pages
5. Update index.mdCatalog the new page, update category counts
6. Append to log.mdTimestamped record of what changed and why
Ingest is the expensive operation. A single rich source can trigger updates across 10-15 wiki pages. This is the LLM earning its keep — the bookkeeping humans abandon.

Query

Asking questions against the wiki. The LLM:

1. Search the wikiFind pages relevant to the question
2. Synthesize an answerWith citations back to wiki pages
3. Identify gapsWhat's missing? What's speculation vs. sourced?
4. File the queryIf the answer is valuable, save it as a page in queries/
5. Update cross-refsLink the new query page from related entities
Queries get filed back. This is the compounding mechanism. A good answer doesn't evaporate after the user reads it — it becomes a page the LLM can reference next time.

Lint

Periodic health checks. The LLM audits the wiki for:

Contradictions

Two pages making claims that can't both be true. Flag for human resolution.

Stale Claims

Statements that may no longer be accurate given newer sources.

Orphan Pages

Pages nothing links to. Either link them or archive.

Missing Cross-References

Pages that should link to each other but don't.

Data Gaps

Sparse areas of the knowledge graph that warrant research.

Catalog Drift

index.md out of sync with actual pages; category counts wrong.

Lint is what keeps the wiki trustworthy over time. Without it, contradictions accumulate and orphans multiply. Run lint after large ingest batches or on a schedule.
nashsu/llm_wiki

Reference Implementation

A desktop application built by @nashsu that implements Karpathy's pattern with a polished three-column UI, knowledge graph visualization, and a raft of extensions beyond the base spec.

Beyond the Base Spec

Karpathy's gist describes the pattern. nashsu's implementation adds substantial features that make it practically usable:

Two-Step Chain-of-Thought Ingest

Analysis phase extracts entities and connections; generation phase writes wiki pages with full source traceability.

4-Signal Knowledge Graph

Relevance scoring combines direct links (×3.0), source overlap (×4.0), Adamic-Adar (×1.5), and type affinity (×1.0).

Louvain Community Detection

Automatic discovery of knowledge clusters. The graph self-organizes into topical communities.

Graph Insights

Surfaces surprising cross-community connections and knowledge gaps. One-click Deep Research from sparse areas.

Vector Semantic Search

Optional embedding-based retrieval via LanceDB. Recall improved from 58.2% to 71.4% with vectors enabled.

Persistent Ingest Queue

Serial processing with crash recovery, cancel, retry, and progress visualization.

Folder Import

Recursive folder ingestion preserving directory structure. Folder context guides LLM classification.

Deep Research

LLM-optimized search queries, multi-query web search via Tavily, auto-ingest results.

Async Review System

LLM flags items needing human judgment with predefined actions and pre-generated search queries.

Chrome Web Clipper

One-click capture using Mozilla Readability.js with auto-ingest.

Query Retrieval Pipeline

Four phases run for every user question:

1. Tokenized searchWith CJK bigram support for Chinese / Japanese / Korean
2. Vector search (optional)LanceDB semantic similarity for recall boost
3. Graph expansionFollow edges via the 4-signal relevance model
4. Budget-controlled context assemblyFit selected pages into the LLM's context window

UI Layout

Three-column desktop interface:

  • Left: Knowledge Tree — browse wiki pages hierarchically
  • Center: Chat — multi-conversation sessions with persistence
  • Right: Preview — live view of referenced wiki pages
  • Icon sidebar: Wiki · Sources · Search · Graph · Lint · Review · Deep Research · Settings

Additional Capabilities

Multi-Conversation Chat

Independent sessions, configurable history depth, cited references panel grouping sources by type.

Thinking Display

Rolling 5-line display with opacity fade for <think> blocks. Collapsed by default.

KaTeX Math

Inline and block LaTeX via remark-math and rehype-katex. Auto-detects LaTeX environments.

Cascade Deletion

Deleting a source removes related wiki pages. Shared entities preserved; only source-specific refs removed.

Multi-Format Ingest

PDF, DOCX, PPTX, XLSX/XLS/ODS, images, video/audio transcripts, web clips.

i18n

English and Chinese UI via react-i18next. LLM responds in configured language.

Technology Choices

Tech Stack

A Rust + TypeScript desktop app built on Tauri, with considered choices at every layer.

Core Stack

ComponentTechnology
Desktop frameworkTauri v2 (Rust + WebView)
FrontendReact 19 + TypeScript + Vite
UI componentsshadcn/ui + Tailwind CSS v4
EditorMilkdown (ProseMirror-based)
Graph visualizationsigma.js + graphology + ForceAtlas2
Vector DBLanceDB (Rust, embedded)
State managementZustand
Web searchTavily API

Document Processing

PDF

pdf-extract (Rust)

DOCX

docx-rs (Rust)

PPTX

ZIP + XML parsing

Spreadsheets

calamine for XLSX/XLS/ODS

Images

Vision LLM ingestion

Web clips

Mozilla Readability.js via Chrome extension

Supported LLM Providers

OpenAI
Anthropic
Google
Ollama (local)
Custom OpenAI-compatible

Why These Choices

Tauri over Electron

Smaller binary, native Rust backend for document processing and vector DB integration.

LanceDB embedded

No separate server. Vector index lives in the same filesystem as the wiki markdown.

Milkdown editor

ProseMirror-based, extensible, and natively markdown. Matches the wiki's file format.

sigma.js + Louvain

GPU-accelerated graph rendering handles wikis with thousands of pages and tens of thousands of edges.

Project Structure

my-wiki/ ├── purpose.md # Goals, scope, research questions ├── schema.md # Structure rules, page templates ├── raw/sources/ # Immutable documents (Layer 1) ├── wiki/ # Generated knowledge base (Layer 2) │ ├── index.md │ ├── log.md │ ├── overview.md │ ├── entities/ │ ├── concepts/ │ ├── sources/ │ ├── queries/ │ ├── synthesis/ │ └── comparisons/ ├── .obsidian/ # Vault config (optional Obsidian compat) └── .llm-wiki/ # App state, queue, vectors
End-to-End Usage

Workflow

From cold start to a living, growing knowledge base — the eight-step quickstart.

Eight-Step Quickstart

1. Launch appOpen LLM Wiki, create a new project from a template
2. Configure LLMSettings → pick provider (OpenAI / Anthropic / Google / Ollama / custom)
3. Define purposeEdit purpose.md — what is this wiki for?
4. Import sourcesDrag files / folders / web clips into the Sources panel
5. Watch ingestActivity Panel shows wiki pages being built in real time
6. QueryChat panel: ask questions against the accumulated wiki
7. Explore graphKnowledge Graph visualizes connections and clusters
8. Review & LintReview panel handles flagged items; Lint maintains health

Adding Sources

Drag & Drop

Drop files directly into the Sources panel. Folders ingest recursively.

Chrome Web Clipper

One-click capture of any web page. Auto-cleans with Readability.js, auto-ingests.

Deep Research

Give the LLM a topic; it generates multi-query web searches, fetches results, and ingests them.

Manual Paste

Paste text directly for quick capture of snippets, meeting notes, or Slack messages.

Querying

Ask natural-language questions in the Chat panel. The retrieval pipeline:

  • Tokenized search finds keyword matches (with CJK bigram support)
  • Vector search adds semantic neighbors (if enabled)
  • Graph expansion follows edges by the 4-signal relevance model
  • Budget-controlled assembly fits results into the LLM's context

Answers come with citations to wiki pages, grouped by type in the references panel. Valuable answers can be filed as new pages.

Knowledge Graph

The graph panel uses sigma.js with ForceAtlas2 layout. Features:

  • Louvain clustering auto-discovers topical communities — colored by cluster
  • Bridge detection highlights pages connecting otherwise-separate clusters
  • Sparse areas flagged for Deep Research — one-click to fill the gap
  • Click-through to any node opens the page in preview
The graph tells you what you didn't know you knew. Cross-community connections — entities appearing in two unrelated clusters — often point to insights the linear wiki browsing won't surface.

Review & Lint

Two maintenance panels keep the wiki healthy:

  • Review: LLM flags items needing human judgment. Predefined actions let you accept, reject, or investigate with one click. Pre-generated search queries make follow-up research fast.
  • Lint: Periodic audit for contradictions, stale claims, orphans, missing cross-refs. Run on schedule or after large ingest batches.
Getting It Running

Install & Deploy

Three install paths: pre-built binaries for the impatient, build-from-source for hackers, and Chrome extension for the Web Clipper.

Pre-Built Binaries

Fastest path. Download from the GitHub Releases page:

macOS

.dmg installer — drag to Applications

Windows

.msi installer — run and follow prompts

Linux

.deb (Debian/Ubuntu) or .AppImage (portable)

# Download from: open https://github.com/nashsu/llm_wiki/releases

Build from Source

Requires Node.js and Rust. Builds for your current platform.

git clone https://github.com/nashsu/llm_wiki.git cd llm_wiki npm install # Development mode with hot reload npm run tauri dev # Production build npm run tauri build

Chrome Web Clipper

The browser extension for one-click web page capture:

1. Open chrome://extensionsIn Chrome, Edge, Brave, or any Chromium browser
2. Enable Developer modeToggle in the top-right of the extensions page
3. Load unpackedSelect the extension/ directory from the llm_wiki repo
4. Pin the extensionClick the puzzle icon → pin LLM Wiki Clipper
5. Use itClick the icon on any page to clip and auto-ingest

This Guide's Deployment

The documentation site you're reading is a single-file HTML SPA deployed to Cloudflare Pages via Wrangler. Same workflow works for any static docs site.

# One-time: create the Pages project wrangler pages project create llm-wiki-guide \ --production-branch=main # Deploy the directory containing index.html wrangler pages deploy llm-wiki \ --project-name=llm-wiki-guide \ --commit-dirty=true # Verify it's live curl -sI "https://llm-wiki-guide.pages.dev/"
Karpathy's pattern is license-free. The gist is a specification; you can implement your own version in any stack. nashsu's app is one reference. Obsidian plugins, Logseq integrations, CLI tools, and web apps are all valid. The wiki is markdown; the stack is irrelevant.

Roll Your Own Implementation

Minimum viable LLM Wiki — what you need:

  • A directory of markdown files (the wiki)
  • A folder of immutable sources
  • A schema document (what this wiki is for)
  • An LLM with file read/write tools and a long context window
  • Three prompts: ingest, query, lint

Everything else — vector search, knowledge graph, clustering, Chrome extensions — is optimization. Claude Code with Agent Skills can implement the base pattern in under an hour; the value comes from sustained use.

llm-wiki-guide
8 sections
Pattern + Impl
GPL-3.0
llm-wiki-guide.pages.dev/#home