Andrej Karpathy's LLM Wiki: Building your own document-to-knowledge graph system
Most people's experience with LLMs and documents looks like RAG: you upload files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation.
The idea here is different. Instead of just retrieving from raw documents at query time, the LLM incrementally builds and maintains a persistent wiki - a structured, interlinked collection of markdown files.
When you add a new source, the LLM reads it, extracts the key information, and integrates it into the existing wiki - updating entity pages, revising topic summaries, noting where new data contradicts old claims.
This is the core bottleneck of naive RAG. Zero durable memory. No accumulation. No compounding intelligence. Every hard question forces the system to rediscover the same relationships from scratch - burning compute to rebuild context it should already own.
The wiki is a persistent, compounding artifact. The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read.
Three layers:
Raw sources: your curated, immutable document collection
The wiki: LLM-generated, interlinked markdown pages
The schema: a CLAUDE.md / AGENTS.md config that defines structure and workflows
Three operations:
Ingest: drop a source, the LLM processes it, updates 10-15 wiki pages
Query: ask questions, file good answers back as new pages
Lint: periodic health-checks for contradictions, orphan pages, stale claims
The winning architecture:
Humans drive the judgment, strategy, and the hard questions
LLMs handle the heavy bookkeeping: updating knowledge, linking entities, maintaining system coherence
The wiki is just a git repo of markdown files. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.
But here's the question the graph community is already asking: is a Personal Wiki just a Knowledge Graph in disguise?
If you have nodes and you have links, you have a Graph. The flat .md file approach is elegant and simple to start - but at 10k+ nodes it hits an efficiency ceiling.
Massive token waste. High latency for relationship-heavy queries. Using an agent to crawl flat files is a brute-force approach to what GraphRAG solves structurally: stop using tokens to "discover" relationships and start using them to reason over them.
Naive RAG as we know it is just a stepping stone. The future of AI isn't just about faster answers. It's about building knowledge that compounds -- and the graph layer is what makes it scale.
LLM Wiki gist.github.com/karpathy/442a6
Andrej Karpathy recently put a name to something people in the trenches have been circling for months linkedin.com/posts/danielck
Is a "Personal Wiki" just a Knowledge Graph in disguise? linkedin.com/posts/guykorla
#LLM #DataEngineering #DataModeling #GraphRAG #PKM #AIAgents #EmergingTech
--
The Year of the Graph Spring 2026 newsletter issue is out!
Beyond Context Graphs: How Ontology, Semantics, and Knowledge Graphs Define Context
yearofthegraph.xyz/newsletter/202
All things #KnowledgeGraph, #GraphDB, Graph #Analytics / #DataScience / #AI and #SemTech.
Subscribe and follow to be in the know. Reach out if you'd like to be featured
Post
Conversation
Love seeing everyone arrive at the same place from different doors
Karpathy via wikis, Graph community via infra, Agent builders via coordination
All roads lead to shared context graphs 
Quote
Brana Rakic
@BranaRakic
The next big shift in AI agents: shared context graphs
Something interesting is converging. Karpathy is building personal knowledge bases with LLMs. Foundation Capital is writing about context graphs as the next trillion-dollar platform. Every AI lab is...
every person should have a personal context graph
every company should have one too