Structure Beats Magic
← All concepts
System architecture

Compile, Don't Retrieve

RAG retrieves chunks per query and hopes; a wiki compiles knowledge once, structured, so the answer is read not reassembled. Do the work at write time, not read time.

Two ways to give an AI access to your knowledge, and the difference is when the work happens. Retrieval — the RAG pattern — does the work at read time: every query, grab the chunks that look similar, stuff them in the context, hope the relevant ones made the cut. Compilation does the work at write time: an agent reads your raw material once and builds a structured, interlinked record from it, so a later question is answered by reading an organized page, not by reassembling one from fragments on the fly.

The distinction sounds technical and is actually the whole game. Retrieval treats your knowledge as a pile to be searched afresh every time, which means every answer is only as good as that moment's similarity match — and similarity is not understanding. Compilation treats your knowledge as something to be understood and written down properly, once, so the structure is already there when the question arrives. You paid the organizing cost up front instead of paying a guessing cost on every read.

The compiled form has three properties retrieval can't offer. It's auditable — a human can open the page and see what the system believes, rather than trusting an opaque vector match. It's stable — the same question gets the same answer because it reads the same page, not whatever chunks ranked highest today. And it compounds — each new source is compiled into the existing structure, making connections to what's already there, so the record gets richer instead of just bigger. A retrieval index only grows; a compiled wiki develops.

The counter-intuitive part is who does which job. The machine compiles; the human reads. That's backwards from the instinct — surely the human organizes and the AI fetches? — but it's exactly right: compiling is tedious, mechanical, endless (the reason hand-built wikis die), while reading a well-organized page is the human's actual work. Hand the compilation to the agent and keep the judgement, and you get the thing every knowledge system promised and few delivered: notes that organize themselves and stay worth reading. The format that makes this work is the plainest one — markdown a person can audit, not a store only a machine can see.