Connect any LLM to your Obsidian vault — with Karpathy LLM-wiki structure check.
A pattern for personal knowledge bases: sources stay raw, the wiki grows, the LLM does the maintenance.
Inspired by Andrej Karpathy's LLM-wiki pattern.
After installing, obsidian-brain will:
- Connect to your local Obsidian vault
- Audit whether it follows the Karpathy LLM-wiki structure
- Suggest what to add or change (without modifying your data)
- Provide a CLI for agents to read/write/audit
$ obrain init
$ obrain audit
============================================================
obsidian-brain / Karpathy LLM-wiki Audit
============================================================
Status: NEEDS WORK
Score: 45 / 100
...
irm https://raw.githubusercontent.com/sean0407/obsidian-brain/main/install.ps1 | iexcurl -fsSL https://raw.githubusercontent.com/sean0407/obsidian-brain/main/install.sh | bashgit clone https://github.com/sean0407/obsidian-brain.git
cd obsidian-brain
pip install python-frontmatter pyyamlEdit config.yaml:
vault_path: "C:/Users/Sean/OneDrive/_Obsidian"python cli.py initThis creates:
your-vault/
├── sources/ # Raw materials (immutable)
├── wiki/
│ ├── concepts/ # Abstract ideas
│ ├── entities/ # People, orgs, things
│ └── summaries/ # Source summaries
├── queries/ # Saved Q&A
├── CLAUDE.md # Schema (read by your LLM)
├── index.md # Content catalog
└── log.md # Operation log
python cli.py auditfrom obsidian_brain import Brain
brain = Brain()
brain.push(
agent="researcher",
title="AI Trends 2025",
content="## Findings\n\n...",
tags=["AI", "trends"]
)| Command | Description |
|---|---|
obrain init |
Create Karpathy wiki structure |
obrain audit |
Check structure compliance |
obrain push |
Push a note to the vault |
obrain search "query" |
Full-text search |
obrain recent |
Show recent notes |
This project follows the LLM-wiki pattern:
- Three layers:
sources/(raw) →wiki/(LLM-maintained) →schema - Sources are immutable — LLM reads but never writes
- Wiki is a persistent, compounding artifact — knowledge accumulates
CLAUDE.mdis the schema — tells the LLM how to operate on the wikiindex.mdis the catalog — what every page is and where it liveslog.mdis the timeline — what happened and when
Any LLM agent (Claude Code, Codex, OpenCode, Cursor) can:
- Clone this repo and run
obrain init - Read the
CLAUDE.mdit generates - Follow the Ingest / Query / Lint workflow
- Run
obrain auditperiodically to check structure
The LLM is the programmer. The wiki is the codebase. obsidian-brain is the linter.
MIT