llm-wiki
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLLM Wiki — Second Brain for Claude Code + Obsidian
LLM Wiki — 适用于Claude Code + Obsidian的第二大脑
Inspired by Andrej Karpathy's LLM Wiki pattern (gist). This skill turns Claude Code (or any agent CLI) into a disciplined wiki maintainer that incrementally builds and maintains a persistent, interlinked Obsidian vault as you feed it sources. The knowledge compounds — cross-references, contradictions, and synthesis are already there when you query.
灵感来自Andrej Karpathy的LLM Wiki模式(gist)。该技能可将Claude Code(或任何Agent CLI)转变为严谨的维基维护者,在你导入数据源时逐步构建并维护一个持久化、相互关联的Obsidian知识库。知识会不断复利——当你查询时,交叉引用、矛盾点和整合内容已准备就绪。
Core principle
核心原则
Most LLM+docs workflows are RAG: retrieve fragments at query time, synthesize from scratch, forget. The wiki is compounding: sources are read once, integrated into a persistent markdown knowledge base, and kept current. You curate and ask; the LLM reads, files, cross-references, and maintains.
Obsidian is the IDE. The LLM is the programmer. The wiki is the codebase.
大多数LLM+文档工作流采用RAG:查询时检索片段,从头整合,用完即忘。而本维基采用复利模式:数据源仅读取一次,整合到持久化Markdown知识库中并保持时效性。你负责策划和提问;LLM负责阅读、归档、交叉引用和维护。
Obsidian是集成开发环境(IDE),LLM是程序员,维基是代码库。
When to use
适用场景
- Personal: track goals, health, psychology, journaling, self-improvement
- Research: deep dives over weeks on a topic — papers, articles, reports, evolving thesis
- Book companion: file chapters as you read; build a fan-wiki-style companion for characters, themes, plot threads
- Business/team: internal wiki fed by Slack, meeting notes, calls — LLM does maintenance nobody else wants to do
- Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives
Do NOT use when: you need one-shot Q&A over a fixed document (use RAG), you don't plan to add sources over time, or you don't want Obsidian in the loop.
- 个人场景:追踪目标、健康、心理状态、日志记录、自我提升
- 研究场景:针对某一主题进行数周深度研究——论文、文章、报告、不断演进的论点
- 书籍辅助:阅读时归档章节;构建类似粉丝维基的内容,涵盖角色、主题、情节线
- 商务/团队场景:由Slack消息、会议记录、通话内容填充的内部维基——LLM承担无人愿意做的维护工作
- 竞品分析、尽职调查、旅行规划、课程笔记、爱好深度研究
不适用场景:你需要对固定文档进行一次性问答(使用RAG即可)、不打算随时间添加数据源,或不想让Obsidian参与流程。
Architecture (three layers)
架构(三层)
vault/
├── raw/ # Layer 1 — IMMUTABLE source of truth
│ ├── <source files> # Articles, papers, PDFs, images, data
│ └── assets/ # Downloaded images from clipped articles
├── wiki/ # Layer 2 — LLM-owned knowledge base
│ ├── index.md # Content catalog (LLM updates every ingest)
│ ├── log.md # Append-only timeline (## [YYYY-MM-DD] <op> | <title>)
│ ├── entities/ # Person/Org/Place pages
│ ├── concepts/ # Ideas, theories, frameworks
│ ├── sources/ # One summary page per ingested source
│ ├── comparisons/ # Cross-source analysis pages
│ └── synthesis/ # High-level syntheses, theses, overviews
├── CLAUDE.md # Schema + conventions (Claude Code)
└── AGENTS.md # Same content, for Codex/Cursor/Antigravity- Layer 1 (raw/) — you own. LLM only reads; never writes.
- Layer 2 (wiki/) — LLM owns. It creates, updates, and cross-references pages. You read it.
- Layer 3 (CLAUDE.md / AGENTS.md) — the schema. Conventions, workflows, frontmatter rules. Co-evolved by you and the LLM.
vault/
├── raw/ # 第一层 — 不可变的事实来源
│ ├── <source files> # 文章、论文、PDF、图片、数据
│ └── assets/ # 从截取文章中下载的图片
├── wiki/ # 第二层 — LLM专属知识库
│ ├── index.md # 内容目录(LLM每次导入时更新)
│ ├── log.md # 仅追加的时间线(## [YYYY-MM-DD] <操作> | <标题>)
│ ├── entities/ # 人物/组织/地点页面
│ ├── concepts/ # 观点、理论、框架
│ ├── sources/ # 每个导入数据源对应的摘要页面
│ ├── comparisons/ # 跨数据源分析页面
│ └── synthesis/ # 高层级整合内容、论点、概述
├── CLAUDE.md # Schema + 约定规则(供Claude Code使用)
└── AGENTS.md # 相同内容,供Codex/Cursor/Antigravity使用- 第一层(raw/) — 由你掌控。LLM仅读取,绝不写入。
- 第二层(wiki/) — 由LLM掌控。它负责创建、更新和交叉引用页面。你可以阅读这些内容。
- 第三层(CLAUDE.md / AGENTS.md) — Schema。包含约定规则、工作流、前置元数据规则。由你和LLM共同演进。
Three core operations
三项核心操作
- Ingest — LLM reads a source, discusses takeaways with you, writes a source summary, updates 10-15 relevant pages, updates index, appends to log. See .
references/ingest-workflow.md - Query — LLM reads first, drills into relevant pages, synthesizes with citations. Good answers get filed back into the wiki so explorations compound. See
index.md.references/query-workflow.md - Lint — Health check: contradictions, stale claims, orphan pages, missing cross-refs, concepts mentioned but lacking their own page, data gaps to fill with web search. See .
references/lint-workflow.md
- 导入(Ingest) — LLM读取数据源,与你讨论要点,撰写数据源摘要,更新10-15个相关页面,更新目录,追加到日志。详见。
references/ingest-workflow.md - 查询(Query) — LLM先读取,深入相关页面,结合引用内容生成整合答案。优质答案会重新归档到维基,让探索内容持续复利。详见
index.md。references/query-workflow.md - 检查(Lint) — 健康检查:识别矛盾点、过时声明、孤立页面、缺失的交叉引用、被提及但未创建独立页面的概念、需通过网络搜索填补的数据缺口。详见。
references/lint-workflow.md
Quick start
快速开始
bash
undefinedbash
undefined1. Initialize a vault (in Obsidian's vault directory)
1. 初始化知识库(在Obsidian的知识库目录中)
python scripts/init_vault.py --path ~/vaults/research --topic "LLM interpretability"
python scripts/init_vault.py --path ~/vaults/research --topic "LLM interpretability"
2. Drop a source into raw/, then ingest
2. 将数据源放入raw/,然后导入
/wiki-ingest ~/vaults/research/raw/anthropic-monosemanticity.pdf
/wiki-ingest ~/vaults/research/raw/anthropic-monosemanticity.pdf
3. Ask questions (answers can be re-filed into the wiki)
3. 提问(答案可重新归档到维基)
/wiki-query "how does monosemanticity compare to mechanistic interpretability?"
/wiki-query "how does monosemanticity compare to mechanistic interpretability?"
4. Periodic health check
4. 定期健康检查
/wiki-lint
/wiki-lint
5. See the timeline
5. 查看时间线
/wiki-log --last 10
undefined/wiki-log --last 10
undefinedSlash commands (this plugin ships)
斜杠命令(本插件内置)
| Command | Purpose |
|---|---|
| Bootstrap a fresh vault with schema files + starter structure |
| Read a source, discuss, update wiki, log it |
| Search wiki, synthesize answer, offer to file back |
| Run health check — contradictions, orphans, stale claims, gaps |
| Show recent log entries (uses unix tools on |
| 命令 | 用途 |
|---|---|
| 用Schema文件和初始结构引导创建新知识库 |
| 读取数据源,讨论内容,更新维基,记录日志 |
| 搜索维基,生成整合答案,提供归档选项 |
| 运行健康检查——识别矛盾点、孤立页面、过时声明、缺口 |
| 显示近期日志条目(基于 |
Sub-agents (this plugin ships)
子Agent(本插件内置)
| Agent | When dispatched |
|---|---|
| Delegated ingest flow — reads source, proposes updates, applies after your approval |
| Runs the health-check workflow independently, reports findings |
| Answers queries using index-first search, synthesizes with citations |
| Agent | 调度时机 |
|---|---|
| 委托导入流程——读取数据源,提议更新内容,经你批准后应用 |
| 独立运行健康检查工作流,报告发现的问题 |
| 使用目录优先搜索回答问题,结合引用内容生成整合答案 |
Python tools (scripts/
)
scripts/Python工具(scripts/
目录)
scripts/All tools are standard library only (no pip installs). Run with .
python scripts/<tool>.py --help| Script | Purpose |
|---|---|
| Create folder structure + seed CLAUDE.md, AGENTS.md, index.md, log.md |
| Helper: extract text/frontmatter from a source file, ready for LLM review |
| Regenerate |
| Append a standardized log entry |
| BM25 search over wiki pages (standalone fallback when index.md isn't enough) |
| Find orphans (no inbound links), stale pages, missing cross-refs, broken links |
| Compute link graph stats — hubs, orphans, clusters, disconnected components |
| Render a wiki page (or subtree) to a Marp slide deck |
所有工具仅依赖标准库(无需pip安装)。运行方式:。
python scripts/<工具名>.py --help| 脚本 | 用途 |
|---|---|
| 创建文件夹结构 + 初始化CLAUDE.md、AGENTS.md、index.md、log.md |
| 辅助工具:从数据源文件提取文本/前置元数据,供LLM审阅 |
| 根据维基页面的前置元数据(分类、日期、数据源数量)重新生成 |
| 追加标准化日志条目 |
| 对维基页面进行BM25搜索(当index.md不足以满足需求时的独立备选方案) |
| 查找孤立页面(无入站链接)、过时页面、缺失的交叉引用、失效链接 |
| 计算链接图统计数据——枢纽页面、孤立页面、集群、断开的组件 |
| 将维基页面(或子树)渲染为Marp幻灯片 |
Cross-tool compatibility
跨工具兼容性
The vault's schema lives in CLAUDE.md (Claude Code) or AGENTS.md (Codex/Cursor/Antigravity/OpenCode). The same content works in both. This plugin ships both templates. For per-tool setup instructions see .
references/cross-tool-setup.mdCLAUDE.md → Claude Code
AGENTS.md → Codex CLI, Cursor, Antigravity, OpenCode, Gemini CLI
.cursorrules → legacy Cursor (pre-AGENTS.md)The scripts are pure Python stdlib → run identically everywhere. Only the loader file changes per tool.
知识库的Schema存储在CLAUDE.md(供Claude Code使用)或AGENTS.md(供Codex/Cursor/Antigravity/OpenCode使用)中。两份内容完全通用。本插件内置两种模板。各工具的设置说明详见。
references/cross-tool-setup.mdCLAUDE.md → Claude Code
AGENTS.md → Codex CLI、Cursor、Antigravity、OpenCode、Gemini CLI
.cursorrules → 旧版Cursor(AGENTS.md之前的版本)脚本为纯Python标准库实现 → 在所有环境中运行方式一致。仅加载文件会因工具而异。
Obsidian setup (recommended)
Obsidian推荐设置
- Obsidian Web Clipper — browser extension; converts web articles to markdown and drops them in
raw/ - Download images locally — Settings → Files and links → Attachment folder path = . Settings → Hotkeys → bind "Download attachments for current file" to
raw/assets/Ctrl+Shift+D - Graph view — see hubs/orphans; essential for spotting structural problems
- Marp plugin — Markdown-based slide decks directly from wiki pages
- Dataview plugin — dynamic tables/lists over page frontmatter (tags, dates, source counts)
- Git — the vault is a plain markdown repo; version it
Full setup walkthrough:
references/obsidian-setup.md- Obsidian Web Clipper — 浏览器扩展;将网页文章转换为Markdown并放入目录
raw/ - 本地下载图片 — 设置 → 文件与链接 → 附件文件夹路径 = 。设置 → 快捷键 → 将“下载当前文件的附件”绑定为
raw/assets/Ctrl+Shift+D - 图谱视图 — 查看枢纽/孤立页面;对发现结构问题至关重要
- Marp插件 — 直接从维基页面生成基于Markdown的幻灯片
- Dataview插件 — 基于页面前置元数据(标签、日期、数据源数量)生成动态表格/列表
- Git — 知识库是纯Markdown仓库;进行版本控制
完整设置指南:
references/obsidian-setup.mdWhy this works (vs plain RAG)
为何该方案优于普通RAG
| Plain RAG | LLM Wiki |
|---|---|
| Rediscover knowledge each query | Knowledge accumulates |
| Cross-references re-computed every time | Cross-references pre-written and maintained |
| Contradictions surface only if you ask | Contradictions flagged during ingest |
| Exploration disappears into chat history | Good answers re-filed as new pages |
| Scales by embeddings infrastructure | Scales by markdown + |
At ~100 sources / hundreds of pages, + filesystem search is enough. Past that, layer in a local search tool like qmd or use .
index.mdscripts/wiki_search.py| 普通RAG | LLM Wiki |
|---|---|
| 每次查询都需重新检索知识 | 知识持续积累 |
| 交叉引用每次查询都需重新计算 | 交叉引用已预先撰写并维护 |
| 仅当你主动提问时才会发现矛盾点 | 导入时即标记矛盾点 |
| 探索内容仅存在于聊天记录中 | 优质答案会重新归档为新页面 |
| 依赖嵌入向量基础设施实现扩展 | 通过Markdown + |
Related skills (chains via context: fork
)
context: fork相关技能(通过context: fork
链式调用)
context: forkThis skill is marked so other skills can chain into it:
context: fork- — PARA-method memory; complementary as long-term personal memory that feeds sources into the wiki
para-memory-files - (mattpocock) — lightweight Obsidian note helper; this skill is the maintained-wiki layer on top
obsidian-vault - — when wiki outgrows ~500 pages, use rag-design to bolt on a retrieval layer
rag-design - — expose the wiki as an MCP tool
mcp-design - — for multi-agent wiki maintenance (ingestor + linter + librarian)
agent-communication
本技能标记为,因此其他技能可链式调用它:
context: fork- — PARA方法记忆库;作为长期个人记忆库,可将数据源导入维基,形成互补
para-memory-files - (mattpocock) — 轻量级Obsidian笔记助手;本技能是其上层的维基维护层
obsidian-vault - — 当维基规模超过约500个页面时,使用rag-design添加检索层
rag-design - — 将维基作为MCP工具暴露
mcp-design - — 用于多Agent维基维护(导入器 + 检查器 + 管理员)
agent-communication
Reference docs
参考文档
- — full vault layout, page frontmatter, naming conventions
references/wiki-schema.md - — entity, concept, source, comparison, synthesis templates
references/page-formats.md - — the detailed ingest flow the wiki-ingestor agent follows
references/ingest-workflow.md - — query patterns, citation format, re-filing answers
references/query-workflow.md - — health-check heuristics
references/lint-workflow.md - — Obsidian plugins, hotkeys, vault config
references/obsidian-setup.md - — per-tool setup (Codex, Cursor, Antigravity, etc.)
references/cross-tool-setup.md - — Bush's Memex, why the LLM changes the maintenance math
references/memex-principles.md
- — 完整知识库布局、页面前置元数据、命名约定
references/wiki-schema.md - — 实体、概念、数据源、对比、整合内容的模板
references/page-formats.md - — wiki-ingestor Agent遵循的详细导入流程
references/ingest-workflow.md - — 查询模式、引用格式、答案重新归档规则
references/query-workflow.md - — 健康检查启发式规则
references/lint-workflow.md - — Obsidian插件、快捷键、知识库配置
references/obsidian-setup.md - — 各工具设置说明(Codex、Cursor、Antigravity等)
references/cross-tool-setup.md - — Bush的Memex原理,为何LLM改变了维护逻辑
references/memex-principles.md
Templates (assets/
)
assets/模板(assets/
目录)
assets/- ,
CLAUDE.md.template,AGENTS.md.template— schema loaders per tool.cursorrules.template - ,
index.md.template— starter index and loglog.md.template - — entity, concept, source-summary, comparison, synthesis
page-templates/ - — small worked example you can study or copy
example-vault/
- ,
CLAUDE.md.template,AGENTS.md.template— 各工具对应的Schema加载器.cursorrules.template - ,
index.md.template— 初始目录和日志模板log.md.template - — 实体、概念、数据源摘要、对比、整合内容的模板
page-templates/ - — 可研究或复制的小型示例知识库
example-vault/
Iron rule
铁则
The LLM never edits files in . Ever. Sources are immutable. All LLM writes go to . If you need to correct a source, do it in yourself — then re-ingest.
raw/wiki/raw/LLM绝不编辑目录下的文件。 永远不会。数据源是不可变的。所有LLM写入操作都仅针对目录。若需修正数据源,请自行在目录中修改——然后重新导入。
raw/wiki/raw/