LLM Wiki — Andrej Karpathy
Tổng quan Intro
Ngày 4/4/2026, Andrej Karpathy — co-founder OpenAI, cựu Director of AI Tesla — đăng một GitHub Gist tên llm-wiki.md. Trong vòng vài ngày, bài này đạt 16 triệu lượt xem, 5,000+ stars và 4,711 forks, trở thành một trong những ý tưởng AI viral nhất năm 2026.
Ý tưởng cốt lõi: thay vì để LLM tái tạo kiến thức từ đầu mỗi lần bạn hỏi (RAG), hãy để LLM xây dựng và duy trì một wiki markdown có cấu trúc từ nguồn tài liệu của bạn. Wiki này tích lũy theo thời gian — mỗi nguồn mới được tích hợp vào những gì đã có, không phải đặt sang một bên để retrieval sau.
Bảng tóm tắt 12 kỹ thuật Overview
| ID | Kỹ thuật | Theme |
|---|---|---|
| 1 | Compilation Metaphor | Core Idea |
| 2 | Ba lớp kiến trúc | Architecture |
| 3 | Three Operations | Architecture |
| 4 | Index & Log | Architecture |
| 5 | CLAUDE.md Schema | Schema |
| 6 | Knowledge Lifecycle | Memory |
| 7 | Knowledge Graph | Scale |
| 8 | Hybrid Search | Scale |
| 9 | Automation Hooks | Automation |
| 10 | Folder Structure | Impl |
| 11 | Use Cases | Impl |
| 12 | Scaling Path | Impl |
RAG vs LLM Wiki Compare
| Aspect | RAG (Traditional) | LLM Wiki (Karpathy) |
|---|---|---|
| Knowledge persistence | None — stateless, forgets every session | Full — builds and compounds over time |
| Multi-doc synthesis | Per query, rebuilt from scratch | Pre-compiled into interlinked pages |
| Contradiction detection | ❌ No | ✅ Yes — flagged during ingest |
| Source traceability | High (chunk-level) | Moderate (page-level) |
| Setup complexity | Low (upload & go) | Low-Medium (30 min setup) |
| Best for | Quick Q&A on fixed docs | Deep research over weeks/months |
| Infrastructure | Vector DB, embeddings | Just markdown files + LLM |
| Scale limit | Scales with infra | index.md tốt đến ~200 pages; hybrid search cho hơn |
Core — Kiến trúc & Operations Architecture
1. The Compilation Metaphor
1Vấn đề với RAG
Hầu hết mọi người trải nghiệm LLM + documents theo kiểu RAG: upload files, LLM retrieve relevant chunks khi query, generate answer. Cơ chế này hoạt động, nhưng LLM đang re-discover knowledge từ đầu mỗi câu hỏi. Không có accumulation. Hỏi câu hỏi cần tổng hợp 5 tài liệu → LLM phải tìm và ghép fragment mỗi lần.
Compilation: compile once, query many times
Cũng giống như compiler: source code không được execute trực tiếp mỗi lần — được compile thành optimized binary. Compilation tốn kém nhưng bù đắp qua mọi lần execution tiếp theo.
2. Ba lớp kiến trúc
2Ưu điểm
- Raw sources immutable → không bao giờ mất nguồn gốc
- LLM owns wiki layer → bạn không cần manually maintain
- Schema file → LLM disciplined, nhất quán qua nhiều sessions
- Simple infrastructure — chỉ cần folder + markdown
Nhược điểm
- LLM errors có thể propagate vào wiki nếu không lint
- Schema cần time để co-evolve và stabilize
3. Three Operations: Ingest / Query / Lint
3Ingest — Thêm source mới
Drop source vào raw/ → tell LLM process. LLM sẽ:
Query — Hỏi câu hỏi
LLM đọc index.md → tìm relevant pages → đọc pages → synthesize answer
với citations. Answers có thể là: markdown page, comparison table, Marp slides,
matplotlib chart.
Lint — Health check định kỳ
Sau mỗi ~20 pages mới, chạy lint để tìm:
4. Index & Log — Navigation Infrastructure
4index.md — Content catalog
wiki/index.md (ví dụ)
# Wiki Index
## Entities
- [[Transformer Architecture]] — Attention mechanism, encoder-decoder design (2 sources)
- [[BERT]] — Bidirectional pre-training for NLP (3 sources)
- [[GPT-3]] — Large-scale language model with emergent capabilities (1 source)
## Concepts
- [[Attention Mechanism]] — Scaled dot-product attention, multi-head attention
- [[Scaling Laws]] — Relationship between compute, data, parameters
## Comparisons
- [[BERT vs GPT]] — Bidirectional vs autoregressive comparisonlog.md — Chronological audit trail
wiki/log.md
## [2026-04-10] ingest | Attention Is All You Need (2017)
Created: transformer-architecture.md, attention-mechanism.md, positional-encoding.md
Updated: index.md (+3 entries)
## [2026-04-11] query | "How does multi-head attention differ from single-head?"
Filed answer as: wiki/attention-multi-head-comparison.md
## [2026-04-12] lint | routine health check
Fixed: 2 orphan pages linked, 1 contradiction flagged in scaling-laws.md5. CLAUDE.md Schema — The Real Product
5Ví dụ CLAUDE.md cho research wiki
CLAUDE.md (schema file)
# Wiki Schema — AI Research
## Structure
- wiki/ — entity pages (one concept per file)
- raw/ — immutable sources
- wiki/index.md — catalog
- wiki/log.md — chronological log
## Entity Page Format
```markdown
# [Entity Name]
**Type**: Concept | Person | Project | Library | Decision
**Summary**: One sentence.
**Sources**: [[source-1]], [[source-2]]
**Confidence**: 0.85 (2 sources, last confirmed 2026-04-10)
---
## Overview
## Key Properties / Arguments
## Relationships
- uses: [[Entity A]]
- contradicts: [[Entity B]]
## Open Questions
```
## Ingest Workflow
1. Read source
2. Identify entities (list them before writing)
3. Create/update entity pages
4. Update cross-references
5. Update index.md
6. Append to log.md
## Lint Rules
- Every entity page must have ≥1 inbound link
- Confidence <0.5 → flag for verification
- Contradiction found → mark both pages, log decisionƯu điểm
- Schema transferable — share với người khác cùng domain, họ có running start
- LLM consistent qua nhiều sessions — không phải "nhắc nhở" format mỗi lần
- Co-evolve theo thời gian — schema reflect cách domain thực sự work
- Separates concerns — bạn curate sources; LLM handles bookkeeping
Nhược điểm
- Cần time để phát triển schema đủ tốt (vài dozen sources đầu tiên)
- Schema phải được update khi domain evolve
Advanced — Memory & Scale (LLM Wiki v2) Scale
6. Knowledge Lifecycle — Confidence & Forgetting
6Confidence Scoring
Mỗi fact trong wiki có confidence score: bao nhiêu sources support, lần xác nhận gần nhất, có contradictions không. Confidence decays với time, strengthens với reinforcement.
Supersession — Version control cho knowledge
Khi info mới contradicts/updates existing claim: old claim được marked stale với link tới claim mới. Không xóa, không chỉ thêm note — explicitly supersede với timestamp.
Forgetting — Ebbinghaus curve
Facts không được access/reinforce nhiều tháng → fade (không xóa, nhưng deprioritized). Architecture decisions decay chậm; transient bugs decay nhanh.
Consolidation Tiers
7. Knowledge Graph — Entity + Typed Relationships
7Entity Extraction
Khi ingest source: extract structured entities — people, projects, libraries, concepts, files, decisions. Mỗi entity: type, attributes, typed relationships to other entities.
Typed Relationships
8. Hybrid Search — Scale Beyond 200 Pages
8Ưu điểm
- BM25 catches exact terms (hiệu quả với technical jargon)
- Vectors catch semantic similarity (same concept, different words)
- Graph catches structural connections (downstream dependencies)
- RRF fusion: không cần tune weights, robust với noisy results
Nhược điểm
- Setup phức tạp hơn index.md approach
- Overkill với wiki nhỏ (<200 pages)
- Need to maintain vector index khi wiki update
9. Automation Hooks — Event-driven Maintenance
9Implementation Impl
10. Folder Structure — Minimal Viable Setup
10Cấu trúc chuẩn
Minimal viable wiki structure
my-wiki/
├── raw/ ← drop PDFs, articles, notes ở đây (immutable)
│ ├── paper1.pdf
│ └── article1.md
├── wiki/ ← LLM-generated entity pages
│ ├── index.md ← catalog of all pages
│ ├── log.md ← chronological audit trail
│ ├── attention-mechanism.md
│ ├── transformer-architecture.md
│ └── bert.md
└── CLAUDE.md ← schema: conventions + workflows (bạn + LLM co-evolve)
Note template chuẩn
wiki/_template.md
# [Entity Name]
**Summary**: One sentence describing this concept.
**Tags**: #topic1 #topic2
**Created**: 2026-04-20
**Last Updated**: 2026-04-20
---
## Overview
## Key Properties
## Related Notes
- [[Related Entity A]]
- [[Related Entity B]]11. Use Cases — Contexts LLM Wiki Shines
115 use cases Karpathy đề xuất
12. Scaling Path — Từ Minimal đến Enterprise
126 tầng scaling
Tổng kết Wrap
LLM Wiki là một trong những ý tưởng đơn giản nhất nhưng powerful nhất trong AI workflow 2026. Insight cốt lõi — thay vì re-derive, hãy compile — khiến knowledge compounding thực sự khả thi với một người dùng đơn lẻ và không cần infrastructure phức tạp.
Karpathy không viết code, không build sản phẩm — ông viết một markdown file 500 dòng mô tả một pattern. Đó là sức mạnh của ý tưởng đúng đắn ở đúng thời điểm.
my-wiki/, thêm 5 PDFs về topic
bạn đang research, paste ingest prompt vào Claude Code — bạn có working wiki trong 30 phút.