ScholarOS
LLM-Wiki

The pattern
behind ScholarOS

In April 2026, Andrej Karpathy shared a pattern for building AI knowledge bases that compound over time. It went viral — 16M+ views on GitHub. Not because it was complicated, but because it was obvious once you saw it.

The pattern

What is
LLM-Wiki?

LLM-Wiki is not a product. It’s not a framework. It’s a pattern — a way of organizing knowledge so that an AI can read it, maintain it, and get smarter every time you add to it. Karpathy described it in a GitHub Gist, and it became one of the most discussed AI workflows of the year.

The core idea is simple: instead of stuffing documents into a vector database and hoping the retriever finds the right chunks, you pre-compile your knowledge into structured, interlinked markdown pages. A human writes or reviews them. An AI maintains them. And every query reads those pages directly — no retrieval pipeline, no re-ranking, no approximation.

Karpathy’s own example wiki reached roughly 100 articles and 400,000 words. At that scale, it was still faster and more accurate than RAG systems operating on the same material. The reason is straightforward: the synthesis already happened.

16M+

Views on the Gist

~400K

Words in the example wiki

~100

Articles, still beating RAG

The problem

Why traditional RAG
doesn’t compound

RAG was a breakthrough when it appeared. But for personal knowledge — the kind that lives in your notes, your courses, your research — it has a structural flaw.

Every query starts from zero

When you ask a RAG system a question, it re-embeds your query, re-searches the vector store, re-ranks the results, and generates an answer. None of that work persists. Tomorrow it does the same thing for a similar question.

Synthesis gets repeated

If your notes say X in three different places, the RAG system has to find all three chunks, reconcile them, and synthesize an answer. Every single time. It never remembers that it already figured out how those pieces connect.

Quality degrades at scale

As your knowledge base grows, retrieval gets harder. More chunks, more noise, more chances for the wrong context to sneak in. The system that worked with 50 documents struggles with 500.

No structure, just proximity

Vector similarity measures how close embeddings are in vector space. That’s a rough proxy for relevance, not a guarantee. The system doesn’t know that two concepts are related — it just knows their vectors are nearby.

“RAG is stateless. Every question is the first question. That’s fine for general knowledge. For your own material, it’s a dead end.”

The architecture

Three layers,
each with a clear job

LLM-Wiki organizes knowledge into three distinct layers. Each layer has a single responsibility. Together they form a pipeline that turns raw sources into queryable, composable knowledge.

1

raw/

Immutable sources

Drop your sources here. PDFs, lecture notes, past papers, textbook chapters — anything that feeds the wiki. These files are never modified by the AI. They are the ground truth. If the wiki says something wrong, the source is always there to correct it.

2

wiki/

AI-generated topic pages

This is where synthesis lives. The AI reads your raw sources and writes interlinked topic pages — one file per concept, connected by wikilinks. Each page synthesizes information from multiple sources into a coherent, structured document. These pages grow with your knowledge base, never reset.

3

outputs/

Published artifacts

Revision summaries, flashcard decks, mock exams, study guides — anything generated from the wiki for a specific purpose. These are derived artifacts, not primary knowledge. They can be regenerated at any time from the wiki layer.

raw/wiki/outputs/
Operations

Three operations,
one workflow

The entire system runs on three actions. Each one touches the wiki layer and leaves it better than it found it.

ingest

Drop raw sources into the raw/ folder. The LLM reads every document, identifies key concepts, creates or updates topic pages in wiki/, and adds wikilinks between related pages. The wiki grows. Nothing is overwritten that shouldn’t be — it updates incrementally, like a careful editor revising a living document.

query

Ask a question. The LLM reads the relevant wiki pages directly — no vector search, no chunking, no retrieval pipeline — and generates an answer grounded in pre-synthesized knowledge. It can also update the wiki if the answer reveals a gap or a new connection. Every query makes the system smarter.

lint

A health check for your knowledge base. The LLM scans every page for broken wikilinks, contradictions between pages, orphaned topics with no connections, and stale content that no longer matches the source material. Think of it as a linter for your mind — it catches drift before it becomes a problem.

The key insight

Synthesis happens once,
then gets updated

This is the single most important difference between LLM-Wiki and every other approach. In RAG, the LLM synthesizes an answer from raw chunks every time you ask a question. In LLM-Wiki, synthesis happens at ingest time. The question then reads the pre-synthesized result.

Traditional RAG

1Query arrives
2Embed query
3Search vector store
4Retrieve top-k chunks
5Re-rank results
6Synthesize answer from chunks
7Return answer
8Forget everything

Repeated every query. No memory. No compounding.

LLM-Wiki

1Sources arrive (once)
2LLM reads and synthesizes
3Writes structured wiki pages
4Links pages together
5Wiki is ready
6Query arrives
7LLM reads relevant wiki pages
8Returns answer (fast, grounded)

Synthesis once, queries many. Knowledge compounds.

“The heavy lifting happens at ingest time — one cost — instead of at query time — repeated cost. That’s the shift. You pay once to compile knowledge. Then every question you ask is cheap, fast, and grounded.”

The implementation

How ScholarOS
makes it real

Karpathy described the pattern. We built the product. ScholarOS takes the LLM-Wiki approach and wraps it in an interface that feels like home — an Obsidian vault you already know, with AI that compiles and maintains the wiki for you.

Obsidian as the IDE

Your vault is a standard Obsidian vault. Every backlink, graph view, and community plugin works exactly as you expect. The wiki pages are just markdown files you can open, read, and edit by hand if you want.

Claude Code as wiki maintainer

An AI agent reads your sources, writes wiki pages, maintains links, and runs lint checks. It operates on the same files Obsidian reads — no abstraction layer, no proprietary format.

Git for version control

Every change to the wiki is a commit. You can see what the AI added, what it changed, and why. Roll back if something went wrong. The entire history of your knowledge base is traceable.

LLM proxy for multi-provider access

One subscription gives you access to GPT-5, Claude 4, and Gemini. The best model for each task — heavy synthesis for Claude, fast queries for GPT, broad coverage for Gemini — without managing API keys.

Local

Your files never leave your machine

Scoped

AI answers only from your material

Compounding

Every session makes the next one smarter

Stop re-retrieving.
Start compounding.

ScholarOS takes the LLM-Wiki pattern and makes it effortless. Drop your sources. Ask your questions. Watch your knowledge grow.

Read the original pattern on Karpathy’s GitHub Gist

LLM-Wiki — The pattern behind ScholarOS