obsidian-llm-vault

An LLM-maintained Obsidian wiki template — humans collect sources; the LLM compiles, links, and maintains. Works with Claude Code, Codex, Gemini.

Obsidian LLM Vault Template

用 LLM Agent 维护的 Obsidian 知识库模板 —— 人类收集与提问,LLM 编译、链接、查重。 An Obsidian knowledge base where an LLM agent is the maintainer.

A template for running an LLM-maintained wiki on top of Obsidian. Instead of RAG (retrieve at query time and re-derive every answer), this pattern compiles knowledge once into a persistent, cross-referenced, self-maintaining wiki of markdown files. The LLM handles summarizing, linking, filing, and linting; you handle sources and questions.

Inspired by Andrej Karpathy's "LLM Wiki" gist (April 2026): "Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase." See [[LLM Wiki Pattern]] for the full idea.

Why

Wikis die because maintenance burden grows faster than value — cross-references go stale, contradictions go unchecked, orphans accumulate. LLMs don't get bored, don't forget to update links, and can touch 15 files in one pass. Maintenance cost approaches zero.

Three-layer architecture

LayerDirectoryWho writesPurpose
Rawraw/YouRead-only source material: clippings, papers, notes, ideas
Wikiwiki/LLMCompiled knowledge: concepts, entities, syntheses, index
Devdev/CollaborateWork notes: ADRs, debriefs, projects, snippets

raw/ is immutable; wiki/ is freely refactored by the LLM; dev/ is collaborative and cautious about existing ADRs. Full rules: .claude/CLAUDE.md.

Quick start

git clone https://github.com/kbsonlong/obsidian-llm-vault.git my-vault
cd my-vault
# Open this folder as a vault in Obsidian, then wire up your agent (below).

Configure VAULT_ROOT

The /wiki-ingest and /wiki-query commands locate the vault via the VAULT_ROOT env var (default: the repo root). This lets you invoke them from any project while still reading/writing the correct vault.

# option 1: shell
echo 'export VAULT_ROOT=/absolute/path/to/my-vault' >> ~/.zshrc

# option 2: Claude Code settings.json
# { "env": { "VAULT_ROOT": "/absolute/path/to/my-vault" } }

Use with any agent

The rules are plain markdown, so any agent that reads project instructions works. This template ships entry files for several:

AgentEntry fileStatus
Claude Code.claude/CLAUDE.mdNative — commands & skills auto-load
Codex CLIAGENTS.mdSelf-contained summary included
Gemini CLIGEMINI.mdPoints to CLAUDE.md / AGENTS.md
Cursor / Windsurf.cursorrules / .windsurfrulesCopy from CLAUDE.md

Claude Code (native)

Works out of the box. .claude/CLAUDE.md, .claude/commands/ (/wiki-ingest, /wiki-query), and .claude/skills/ (obsidian-markdown, defuddle, wiki-ingest, …) load automatically. To use the two commands from any project, symlink them globally:

ln -s "$PWD/.claude/commands/wiki-ingest.md" ~/.claude/commands/wiki-ingest.md
ln -s "$PWD/.claude/commands/wiki-query.md" ~/.claude/commands/wiki-query.md

Codex CLI

Reads AGENTS.md — already included. Run codex in the repo root.

Gemini CLI

Reads GEMINI.md — already included.

Cursor / Windsurf / others

Copy the rules into the tool's instruction file:

cp .claude/CLAUDE.md .cursorrules      # Cursor
cp .claude/CLAUDE.md .windsurfrules    # Windsurf

Core workflows

  • /wiki-ingest <URL | file | text> — extract concepts & entities, create/update wiki pages, update the index. Presents a plan first and waits for confirmation.
  • /wiki-query <question> — synthesize an answer across the wiki, with [[wikilink]] citations.

Examples

  • wiki/concepts/LLM Wiki Pattern.md — concept page structure
  • wiki/entities/Andrej Karpathy.md — entity page structure, cross-linked to the concept
  • Page templates: .claude/skills/wiki-ingest/assets/templates/

License

MIT

Related

How to Install

  1. Download the ZIP or clone the repository
  2. Open the folder as a vault in Obsidian (File → Open Vault)
  3. Obsidian will prompt you to install required plugins

Stats

Stars

0

Forks

0

License

MIT

Last updated 28d ago

Categories