Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llm-wiki

Karpathy-style LLM knowledge base toolkit — let an LLM build and maintain a persistent, cross-linked Markdown wiki from your raw sources.

Inspired by Andrej Karpathy's LLM Wiki pattern. Instead of RAG (re-retrieving raw docs on every query), the LLM compiles raw sources into a persistent wiki. Knowledge compounds over time.

Features

  • 5 core operations: compile, ingest, query, lint, audit
  • CLI toolkit: wiki scaffold/lint/status/serve/list
  • Web viewer: beautiful read-only dashboard with knowledge graph visualization
  • Multi-wiki support: manage multiple independent knowledge bases
  • Agent-agnostic: works with Claude Code, Goose, Codex, or any LLM agent
  • Obsidian-compatible: wiki directories are valid Obsidian vaults

Quick start

# 1. Clone and set up PATH
git clone https://github.com/your-org/llm-wiki.git
export PATH="$PWD/llm-wiki/bin:$PATH"

# 2. Create a wiki
wiki scaffold ~/wikis/ai-research "AI Research"

# 3. Add a source and tell your LLM agent to ingest it
cp article.md ~/wikis/ai-research/raw/articles/
# Then: "ingest raw/articles/article.md"

# 4. Check health
wiki lint ~/wikis/ai-research
wiki status ~/wikis/ai-research

# 5. Start web viewer
wiki serve ~/wikis/ai-research
# Open http://localhost:4175

Install

Prerequisites

  • Python 3.8+
  • PyYAML: pip install pyyaml
  • For web viewer: pip install fastapi uvicorn markdown-it-py jinja2

Setup

git clone https://github.com/your-org/llm-wiki.git
cd llm-wiki
chmod +x bin/wiki

# Option A: Add to PATH
export PATH="$PWD/bin:$PATH"

# Option B: Symlink
ln -s "$PWD/bin/wiki" ~/.local/bin/wiki

Install as LLM skill

# Claude Code
cp -r skill/ ~/.claude/skills/llm-wiki/

# Goose — reference in .goosehints or config
# Codex — reference in AGENTS.md

CLI commands

Command Description
wiki scaffold <path> "<title>" Create a new wiki
wiki scaffold <path> --clean Remove a wiki
wiki lint [<path>] 7-pass health check
wiki status [<path>] One-screen overview
wiki serve [<path>] Start web viewer
wiki list List all registered wikis
wiki register <path> Register an existing wiki
wiki unregister <path> Unregister a wiki

When <path> is omitted, the CLI auto-detects the wiki from the current directory.

Wiki structure

<wiki-root>/
├── CLAUDE.md           ← Schema: scope, rules, article list, contradictions
├── raw/                ← Immutable sources (human adds, LLM reads)
│   ├── articles/
│   ├── papers/
│   ├── notes/
│   └── refs/           ← Pointer files for large binaries
├── wiki/               ← LLM-generated knowledge
│   ├── index.md        ← Master catalog
│   ├── concepts/
│   ├── entities/
│   └── summaries/
├── outputs/queries/    ← Query answers
├── log/                ← Per-day operation logs
└── audit/              ← Human feedback
    └── resolved/

The 5 operations

Operation What it does
compile Restructure wiki: split long pages, merge duplicates, rebuild index
ingest Add new source → summary + concept/entity updates (touches 5-15 pages)
query Answer questions grounded in the wiki, with dedup check
lint 7-pass health check (dead links, orphans, format validation)
audit Process human feedback from audit/ directory

Web viewer

wiki serve ~/wikis/ai-research --port 4175
  • Dashboard: page stats, activity timeline, contradictions, audit status
  • Knowledge graph: interactive D3 force-directed visualization
  • Page viewer: beautiful Markdown rendering with wikilink navigation
  • Search: keyword search across all wiki pages

Related work

License

MIT

About

Karpathy-style LLM knowledge base toolkit — let an LLM compile and maintain a persistent, cross-linked Markdown wiki from your raw sources, instead of re-retrieving them on every query.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages