Com­pile your Know­ledge Base into a LLM Wiki



There is docu­men­ta­tion. Somewhere.

Teams accu­mu­late know­ledge fas­ter than they orga­nize it, and most of it is hard to find when someone actually needs it. At a data-plat­form cus­to­mer, the plat­form team keeps a solid know­ledge base for the deve­lo­pers who build data pro­ducts on it. But that covers the plat­form its­elf. Ship­ping a data pro­duct also means mana­ging AD groups, working with the GitOps stack, and con­sul­ting the enter­prise archi­tec­ture cata­log. Those docs live else­where: other Con­fluence spaces, Ser­viceNow artic­les, the READ­MEs of refe­rence pro­jects. Cross-refe­ren­ces are often miss­ing, espe­ci­ally across tools. So fin­ding the right infor­ma­tion is hard, espe­ci­ally during onboar­ding — and when search fails, the default is a ticket to the plat­form ops team. The pro­blem does­n’t fade with expe­ri­ence: even senior deve­lo­pers struggle to keep up. None of this shows up as a bud­get line, but the cost is paid on every onboar­ding and every change.

Why today’s too­ling falls short

The recent wave of LLM too­ling pro­mi­sed a fix. Retrie­val-aug­men­ted gene­ra­tion (RAG) embeds chunks of the docs and retrie­ves them at query time. The Model Con­text Pro­to­col (MCP) lets the model fetch live pages on demand. Both leave syn­the­sis to query time. RAG returns chunks wit­hout con­text, because it starts from scratch on every query. MCP sol­ves a dif­fe­rent pro­blem: fet­ching live data, not com­pi­ling it.

What neither does is prepare the know­ledge in advance: com­pile it once, cite every claim, link rela­ted ideas expli­citly. Andrej Kar­pa­thy named that pat­tern an LLM Wiki in April 2026. The rest of this post is what an LLM Wiki is, where it earns its keep and where it breaks, and how we ser­ved one from Snow­flake — mir­rored by a public scaf­fold you can clone and run.

Know­ledge graph of a small LLM Wiki (38 pages). Each dot is a Mark­down page; dot size reflects inco­ming cross-refe­ren­ces; colour marks cate­gory (con­cept, decis­ion, run­book, source). The dense hub at the centre is the wiki index; source pages form the outer ring. Ren­de­red in Obsi­dian, which has native wikilink support.

Com­pi­la­tion beats re-synthesis

Karpathy’s framing is a soft­ware-engi­nee­ring ana­logy: com­pi­la­tion beats re-syn­the­sis. A com­pi­ler turns source into a binary once; you do not re-com­pile on every run. An LLM Wiki applies that to know­ledge. The LLM reads the raw sources and syn­the­si­zes them into cura­ted Mark­down pages, lin­king rela­ted con­cepts and sur­fa­cing gaps and con­tra­dic­tions. From then on, you query the wiki — not the raw sources.

A working wiki has three lay­ers. Raw sources — the scat­te­red tools from above — sit in fol­ders the LLM only reads. The wiki is a par­al­lel fol­der of Mark­down pages, one per con­cept, with expli­cit [[wikilinks]] bet­ween rela­ted topics. Because the LLM owns the wiki enti­rely, it crea­tes pages, updates them, and records where each claim came from. The schema — a sin­gle AGENTS.md file — tells the LLM how to struc­ture the wiki and what each page should contain.

Con­cre­tely, that is three places on disk:

knowledge-wiki/
├── AGENTS.md                    # the schema: how the agent maintains the wiki (you own this)
├── raw/                         # immutable copies of every source; the agent only reads here
│   ├── confluence/
│   ├── servicenow/
│   └── repos/
└── wiki/                        # the curated knowledge base; the agent owns it
    ├── index.md                 # the hub every page links back to
    ├── concepts/
    ├── decisions/
    ├── runbooks/
    └── sources/                 # one record per source: its URL, date, and the pages it touched

Kee­ping it cur­rent takes four ope­ra­ti­ons: inge­st­ing new sources into pages, ans­we­ring ques­ti­ons from the wiki alone, lin­ting for stale or orpha­ned con­tent, and refres­hing pages after sources change.

How the three lay­ers relate: the schema governs the wiki’s struc­ture; the wiki is com­pi­led from the raw sources, which stay immutable

What a cura­ted wiki page looks like

Every wiki page opens with a front­mat­ter block: tags, a status field, and a last_updated date. Con­cept pages use a matu­rity sta­tus — stub, growing, mature — that advan­ces as other pages cite them. Decis­ion pages use their own voca­bu­lary: proposed, accepted, superseded. The lint ope­ra­tion reports drift auto­ma­ti­cally. For exam­ple, if a mature page drops below its cita­tion thres­hold after a refresh, lint bumps it back to growing.

Take one page — decisions/use-hidden-partitioning, from a tiny, public exam­ple wiki com­pi­led from two Apa­che Ice­berg docs (par­ti­tio­ning and par­ti­tion evo­lu­tion). It con­ta­ins three [[wikilinks]] to rela­ted pages, plus two source cita­ti­ons at the bot­tom, so every claim is traceable. Each source cita­tion links to a source page — a wiki record car­ry­ing the ori­gi­nal URL, the inges­tion date, and the list of wiki pages updated from it. Fol­low the link to read the ori­gi­nal; re-run the ingest to pick up chan­ges. This decis­ion record cap­tures why hid­den par­ti­tio­ning beats the Hive-style approach: the pro­blem con­text, the ratio­nale from the Ice­berg docs, and the trade­offs accepted.

The raw Apa­che docs behind it are a sin­gle flat page: no inter­nal links, no meta­data, no record of why the design was cho­sen. The cura­ted record keeps just the choice, the con­se­quen­ces, and the sources.

Here is that page, lightly abridged:

---
tags: [decision]
status: accepted
decided_on: 2013-01-01
last_updated: 2026-05-27
---

# Use Hidden Partitioning Over Hive-Style Partitioning

## Context
Early big-data table formats implemented partitioning as user-visible columns.
Three classes of bugs were endemic: silent data corruption from incorrect
partition value formats, silent full-table scans when readers omitted the
partition filter, and query breakage when the partition scheme changed.

## Decision
Iceberg tracks partition specs inside the table's [[Table Metadata]], not in
the user-facing schema. Writers supply data for logical columns only.
Readers write predicates against logical columns; the engine translates them
internally. This is referred to as [[Hidden Partitioning]].

## Sources
- [[sources/iceberg-docs-partitioning]]
- [[sources/iceberg-docs-evolution]]
- [[sources/iceberg-docs-reliability]]

Sca­led up, a wiki forms the graph this post ope­ned with: each dot a page, each line a [[wikilink]]. What was scat­te­red across sepa­rate docu­men­ta­tion pages is now cross-refe­ren­ced and traceable in one place.

RAG, MCP, and the wiki — com­ple­men­tary, not competing

The obvious objec­tion is that this is just RAG with extra steps. Those extra steps are the point. At ser­ving time the wiki is indeed retrie­val — a Snow­flake search ser­vice, later in this post — but it retrie­ves over com­pi­led, cited pages rather than raw chunks. All three approa­ches dif­fer less in how they retrieve than in what they retrieve from.

What each approach retrie­ves over

RAG ope­ra­tes on raw chunks at query time, so source attri­bu­tion stays weak — a docu­ment refe­rence, not a per-state­ment cita­tion. MCP fet­ches live pages, but the ans­wer lacks syn­the­sis. The LLM Wiki sits bet­ween the two: know­ledge is com­pi­led in advance, so the wiki bakes in cross-refe­ren­ces and cita­ti­ons, and fresh­ness beco­mes incre­men­tal rather than per-query.

RAG still wins at mil­li­ons of docu­ments, hard latency requi­re­ments, and fully unsta­ble con­tent. The wiki wins at focu­sed, sta­ble know­ledge bases — team wikis, rese­arch domains, gover­ned know­ledge sur­faces. Its edge over raw-page RAG is the per-state­ment attri­bu­tion in the table below: every claim traces to a source, which makes ans­wers auditable.

Which tool for which job

MCP and the LLM Wiki are com­ple­men­tary, not com­pe­ting. MCP is for live ope­ra­ti­ons: open a ticket, fetch the cur­rent inci­dent. The LLM Wiki is for sta­ble know­ledge: explain a con­cept, or trace a decis­ion back to its source. dbt Labs, for ins­tance, recently added tools to its MCP ser­ver that let an LLM pull from dbt’s docu­men­ta­tion on demand. That works well when a query is a lookup — fetch the right cano­ni­cal page and you are done. The wiki is the bet­ter fit when ans­we­ring takes real syn­the­sis — recon­ci­ling seve­ral pages into one coher­ent ans­wer. The deci­ding fac­tor is how much syn­the­sis a query needs, not how many sources you have.


RAGMCPLLM Wiki
Syn­the­sisPer queryNone
Com­pi­led once
Source attri­bu­tionChunk IDPage URL
Per state­ment
Cross-refe­ren­cesNoneNoneBaked in
Fresh­nessPer queryLive
Com­pi­led cadence
Best forLarge, unsta­ble contentLive ope­ra­ti­onsFocu­sed, sta­ble knowledge

So the wiki and RAG are not rivals at ser­ving time. At scale the wiki is ser­ved via retrie­val; every retrie­ved unit is sim­ply alre­ady a syn­the­sis with its cita­ti­ons atta­ched. An infor­mal test put the com­pi­led cor­pus ahead on ques­ti­ons span­ning seve­ral sources, and roughly even with raw pages on sin­gle-page loo­kups — the ser­ving sec­tion has the detail.

Where it falls short

Syn­the­sis can lose detail: Com­pi­ling many pages into one means lea­ving things out. Ans­wers come from the com­pi­led wiki, not the raw sources, so a detail drop­ped during syn­the­sis is gone at query time — and, like any LLM step, syn­the­sis can intro­duce errors of its own. Per-state­ment cita­ti­ons make a page audi­ta­ble after the fact, and lint cat­ches some drift, but neither pre­vents a lossy or wrong page up front. Spot-che­cking com­pi­led pages against their sources stays necessary.

It only pays when syn­the­sis does: The wiki’s value is the syn­the­sis it bakes in. If your users› ques­ti­ons are point loo­kups — fetch one page, read one value — that syn­the­sis goes unu­sed, and raw-page RAG or MCP-on-docs ans­wers just as well. The wiki pays off when ans­we­ring means pul­ling seve­ral pages tog­e­ther, not when it means fin­ding one.

Stay­ing cur­rent has a cost: The wiki is com­pi­led, not live. Kee­ping it cur­rent means recom­pi­ling, and recom­pi­ling often enough to track a fast-moving source costs real time and tokens. In fast-chan­ging domains or live inci­dents it will lag. The fix is to split the work: the wiki for sta­ble know­ledge, MCP for live operations.

These limits point the same way: the wiki is worth the effort when know­ledge is sta­ble and ans­we­ring takes syn­the­sis. Once it exists, the next ques­tion is access — a querya­ble inter­face for end users, a dev tool for engineers.

Ser­ving the wiki from Snowflake

The wiki lives in Git. A coding agent with the repo che­cked out can alre­ady query it — that is the simp­lest way to use one. But that asks ever­yone to clone the repo and know how to point an agent at it, and it does not­hing for non-tech­ni­cal users. To reach ever­yone, the wiki has to be ser­ved some­where: a chat inter­face for non-tech­ni­cal rea­ders, and a hos­ted end­point that engi­neers and their coding agents can call wit­hout each clo­ning the repo. Snow­flake offers the tools for that, and is what we used — the wiki sits next to the gover­ned data, and search, agents, and access con­trol come built in. It is one ins­tance of the broa­der Snow­flake-as-GenAI-plat­form story.

The pipe­line

Get­ting the wiki into Snow­flake is the easy part. Snowflake’s Git inte­gra­tion can pull the repo directly; in our test we ins­tead published the Mark­down to a cloud-sto­rage stage, to work around access limits in the envi­ron­ment. Eit­her way, a sche­du­led job loads the pages and inde­xes them for Cor­tex Search, re-pro­ces­sing only what changed.

The step that needs care is chun­king. Cor­tex Search embeds a text column for seman­tic search but trun­ca­tes any­thing past its embed­ding win­dow — about 512 tokens, roughly 385 words — so a whole page inde­xed as one row would lose its tail. The job the­r­e­fore splits each page into smal­ler chunks. Split nai­vely, though, and a chunk loses its page’s front­mat­ter and source links, and the cita­tion trail breaks. So the job car­ries each page’s meta­data and cita­ti­ons into every chunk — a retrie­ved chunk can still name the page and source it came from.

The same approach is mir­rored by a public scaf­fold of SQL scripts you can read end to end: the input tables and a sync pro­ce­dure that par­ses each page’s front­mat­ter and chunks it, the Cor­tex Search ser­vice, hel­per UDFs that resolve [[wikilinks]], and the Cor­tex Agent that ans­wers over them. Clone cortex-kb-scaffold, point it at a stage of Mark­down, and you get the pipe­line descri­bed here.

Archi­tec­ture of the Snow­flake ser­ving layer: the wiki flows from Git into Snow­flake, where a job splits it into cita­tion-pre­ser­ving chunks, Cor­tex Search inde­xes them, and a sin­gle agent ser­ves both chat and coding-tool users.

Rea­ching the agent

On top of the search ser­vice sits a sin­gle Cor­tex Agent — the thing users and tools actually talk to. It ans­wers from the wiki, fol­lows [[wikilinks]], and returns the source cita­ti­ons atta­ched to each chunk. That one agent ser­ves ever­yone two ways: non-tech­ni­cal users chat with it in CoWork (form­erly Snow­flake Intel­li­gence) inside Snow­sight, and engi­neers reach it from Cor­tex Code (since rebran­ded to CoCo, Snowflake’s coding agent) or any app over its REST API — a setup teams alre­ady run over raw sources alone, no wiki in bet­ween. It is the same agent and the same cita­ti­ons eit­her way, with no sepa­rate iden­tity layer. And because it is all Snow­flake objects, the same roles that gate the rest of the plat­form govern access — no bol­ted-on per­mis­sion layer for the wiki.

When to use it, and how to start

The pat­tern fits a spe­ci­fic shape: sta­ble know­ledge where ans­we­ring a ques­tion takes real syn­the­sis, onboar­ding is a recur­ring cost, and ans­wers have to trace back to a source. If your team sits bet­ween a RAG bot that returns scat­te­red chunks and a ticket queue, a cura­ted wiki can fill the gap. It does not fit every case. For point-lookup ques­ti­ons — or a sin­gle cano­ni­cal source you can hand an agent directly — raw-page RAG or the dbt-style MCP-on-docs pat­tern is simp­ler and just as good. For very large, real-time, or fast-moving con­tent, RAG or MCP wins.

Karpathy’s gist is the ori­gi­nal con­cept note — enough to build one from scratch. If you would rather not start from a blank fol­der, I keep a wiki­seed tem­p­late: the file lay­out shown ear­lier, the AGENTS.md schema that tells the agent how to main­tain the wiki, and the skills that run the loop. No CLI and no build step — just Mark­down and an AI coding agent. Get­ting star­ted takes two steps:

  1. Get the files. Use the Use this tem­p­late but­ton (or git clone) to create a fol­der you name.
  2. Initia­lize. Open it in Claude Code, Git­Hub Copi­lot, or Cor­tex Code and type initialize the wiki. It asks for your wiki’s name, domain, and cate­go­ries, then cle­ars the exam­ple pages so you start clean.

From there the loop is three plain-lan­guage trig­gers: Ingest <url> pulls a source into raw/ and syn­the­si­zes pages from it, Query: <question> ans­wers from the wiki with cita­ti­ons, and Lint the wiki flags stale or orpha­ned pages. Point it at your own docs, and the wiki fills in.