---
title: "Karpathy's LLM Knowledge Base Approach"
aliases: [obsidian-rag, karpathy-wiki, llm-knowledge-base]
tags: [knowledge-management, obsidian, claude-code, workflow]
sources: [raw/Karpathy's Obsidian RAG + Claude Code = CHEAT CODE.md, raw/Как сделать Claude Code в 10 раз умнее.md]
created: 2026-04-15
updated: 2026-04-15
---

# Karpathy's LLM Knowledge Base Approach

Andrej Karpathy replaced RAG with a structured Obsidian vault + LLM system. No vector database, no embeddings — just markdown files with smart indexing.

## Key Takeaways

- LLMs navigate **index files**, not brute-force search every document
- **3-hop navigation**: `_master-index.md` → topic `_index.md` → article = fast + cheap
- Works for solo operators and small teams up to ~thousands of documents
- Obsidian is the **frontend** (graph view, search, browsing) — Claude Code is the **backend**
- The wiki is the LLM's domain — humans dump raw material, LLM maintains the wiki

## The Compiler Analogy

| Stage | Role | Path |
|-------|------|------|
| Raw sources | Input (articles, PDFs, clips) | `raw/` |
| LLM compiler | Processes raw → structured wiki | Claude Code |
| Wiki | The executable — queryable knowledge | `wiki/` |
| Lint | Health checks (broken links, gaps) | periodic audit |
| Query | Runtime — using the knowledge | any session |

## Why It Works Without RAG

Claude Code doesn't read every document when answering. It does 3-4 targeted file reads:
1. Read `wiki/_master-index.md` — what topics exist?
2. Read that topic's `_index.md` — what articles are in it?
3. Read 1-3 specific articles
4. Synthesize the answer

This scales because **the index is the retrieval mechanism**, not semantic similarity search.

## The Four Verbs

- **Clip** — Web Clipper → raw/ (one click)
- **Compile** — "compile" in Claude Code → wiki articles appear
- **Query** — ask questions → answers from wiki (3-4 file reads)
- **Audit** — "audit the wiki" → LLM finds gaps, contradictions

## Vault Structure

```
vault/
├── raw/          — inbox (you own this)
├── wiki/         — LLM's domain
│   ├── _master-index.md
│   └── {topic}/
│       ├── _index.md
│       └── {article}.md
└── output/       — query results
```

## Key Insight: Outputs Compound

Every query result can be filed back into the wiki (`--file-back`). Questions make the system smarter — the answer becomes part of the knowledge base.

## Related

- [[wiki/obsidian-rag/obsidian-rag-vs-true-rag|Obsidian RAG vs True RAG]]
- [[wiki/obsidian-rag/claude-code-obsidian-setup|Claude Code + Obsidian Setup]]
- [[wiki/concepts/_index|Session Knowledge Concepts]]
