Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multi-llm-wiki

A multi-domain, cross-referenced LLM knowledge base framework based on the Karpathy llm-wiki pattern.

中文文档

Instead of RAG (re-retrieving raw docs on every query), this pattern has the LLM compile raw sources into a persistent, cross-linked Markdown wiki. It adds a multi-wiki federation layer so you can split large knowledge domains into independent wikis (e.g., procurement, construction, property management) while maintaining lightweight cross-references between them.


What's different from the original llm-wiki skill

The original llm-wiki-skill is designed for a single-topic wiki. multi-llm-wiki extends it with:

Feature Original llm-wiki multi-llm-wiki
Single wiki
Multi-wiki federation
Cross-wiki reference index (cross-index.md)
Cross-wiki link detection script (cross-link.py)
CLAUDE.md cross-wiki routing table
Lint cross-index health check (Pass 8)
Chinese documentation

Install

For OpenCode

If your working directory contains llm-wiki/, OpenCode auto-discovers the skill — no copy needed. Just open the project directory and start using the operations: compile, ingest, query, lint, audit.

For Claude Code

cp -r llm-wiki/ ~/.claude/skills/multi-llm-wiki/

For Codex

cp -r llm-wiki/ ~/.codex/skills/multi-llm-wiki/

Alternatively, paste llm-wiki/SKILL.md directly into your agent context.

Quick start — Single wiki

# 1. Scaffold a new wiki
python3 llm-wiki/scripts/scaffold.py ~/my-wiki "My Research Topic"

# 2. Add raw sources
cp my-article.md ~/my-wiki/raw/articles/

# 3. Tell your agent: "ingest raw/articles/my-article.md"

# 4. Ask questions: "what does the wiki say about X?"

# 5. Run lint periodically
python3 llm-wiki/scripts/lint_wiki.py ~/my-wiki

Multi-Wiki Setup

When your knowledge domain is too large for a single wiki, split into multiple independent wikis with cross-wiki references.

Directory layout

<project-root>/
├── caigou/                  ← Each wiki is a standalone folder
│   ├── CLAUDE.md            ← Schema + cross-wiki routing table
│   ├── wiki/
│   │   ├── index.md
│   │   ├── concepts/
│   │   ├── cross-index.md   ← Cross-wiki reference index
│   │   └── ...
│   └── ...
├── gongcheng/               ← Another standalone wiki
│   ├── CLAUDE.md
│   ├── wiki/cross-index.md
│   └── ...
└── ...

Step-by-step

Step 1: Create the project directory and scaffold wikis

mkdir my-project
python3 llm-wiki/scripts/scaffold.py my-project/caigou "采购知识库"
python3 llm-wiki/scripts/scaffold.py my-project/gongcheng "工程建设知识库"

Each scaffold creates a complete wiki with wiki/cross-index.md and a CLAUDE.md with a cross-wiki routing table section.

Step 2: Build each wiki independently

Build each wiki's content one at a time — ingest raw files, compile concept pages. Each wiki should be internally complete first.

Step 3: Add cross-wiki annotations in concept pages

> **跨 wiki**:工程建设类资质见 [[../gongcheng/wiki/concepts/施工单位资质|施工单位资质]]

Step 4: Run cross-link.py to detect relationships

# Scan mode: shows all cross-wiki links detected
python3 llm-wiki/scripts/cross-link.py my-project

# Suggest mode: also writes 🟡 entries to cross-index.md
python3 llm-wiki/scripts/cross-link.py my-project --suggest

Step 5: Review and confirm entries

Run compile on each wiki. The LLM will present 🟡 entries for human confirmation.

  • Confirmed → 🟢, update CLAUDE.md routing table
  • Rejected → 🔴 or remove

Step 6: Verify with lint

python3 llm-wiki/scripts/lint_wiki.py my-project/caigou
python3 llm-wiki/scripts/lint_wiki.py my-project/gongcheng
# Pass 8 checks cross-index.md health

How cross-wiki references work

File Purpose Maintained by
CLAUDE.md routing table Quick keyword→wiki lookup during query Semi-automatic (compile)
wiki/cross-index.md Detailed concept-to-concept index Semi-automatic (ingest + cross-link.py + compile)
In-page [[../wiki/...]] annotations Explicit cross-wiki references LLM during ingest/compile

Cross-wiki query behavior

When a question in wiki A requires knowledge from wiki B:

  1. LLM reads CLAUDE.md routing table → keyword match
  2. LLM reads wiki/cross-index.md → detailed relationship
  3. LLM outputs: "This information is in ../wiki-b/wiki/concepts/page.md. Please switch to that wiki."
  4. Stops and waits. No cross-wiki hallucination.

Repo contents

multi-llm-wiki/
├── llm-wiki/                    ← The skill
│   ├── SKILL.md                 ← Main skill file
│   ├── references/
│   │   ├── schema-guide.md      ← CLAUDE.md schema template
│   │   ├── article-guide.md     ← Article writing conventions
│   │   ├── log-guide.md         ← log/ folder convention
│   │   ├── audit-guide.md       ← audit file format + workflow
│   │   └── tooling-tips.md      ← Obsidian, qmd, plugin + web
│   └── scripts/
│       ├── cross-link.py        ← Multi-wiki cross-reference detection
│       ├── scaffold.py          ← Bootstrap new wiki directory
│       ├── lint_wiki.py         ← 8-pass health check (incl. cross-index)
│       └── audit_review.py      ← Group open/resolved audits by target
├── audit-shared/                ← Shared TypeScript library
├── plugins/obsidian-audit/      ← Obsidian plugin
└── web/                         ← Local Node.js preview + feedback server

Running the web viewer

cd audit-shared && npm install && npm run build && cd ..
cd web && npm install && npm run build && cd ..
cd web && npm start -- --wiki "/path/to/wiki-root" --port 4175

Use cases

  • Research deep-dive — reading papers on a topic over weeks
  • Multi-domain knowledge bases — procurement + construction + property management
  • Team knowledge base — fed by Slack threads, meeting notes, docs
  • Reading companion — building a rich companion wiki as you read a book

Acknowledgment

This project is forked and extended from llm-wiki-skill by Lewis Liu, which was inspired by Andrej Karpathy's llm-wiki Gist.

Key extensions in multi-llm-wiki:

  • Multi-wiki federation with cross-index.md and cross-link.py
  • Cross-wiki routing table in CLAUDE.md
  • Lint Pass 8 for cross-index health
  • Chinese language support throughout

Related work

License

MIT

About

Multi-LLM Wiki

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages