back to resources
BLOG
AI Architecture
AI Trends

What Is an LLM Wiki? How to Build a Governed, Self-Improving Knowledge Layer for Enterprise AI

What an LLM wiki is, how it differs from RAG, and how to build one your enterprise can secure, keep accurate and afford at scale.

By
Jay Wilder
,
Published on
November 26, 2026
12
min read

TLDR

  • An LLM wiki is a knowledge base of interlinked pages that AI agents write, update and maintain for you.
  • It compiles knowledge once and keeps it current, so agents and people don't have to piece it back together from raw documents for every question.
  • For an enterprise, the hard part isn't writing the pages. It's controlling what goes in and out, keeping quality and cost in line as the wiki grows, and deciding where it runs, which models touch it and where the data lives.

Key Metrics:

Why is everyone talking about LLM wikis?

LLM wikis moved from a developer side project to an enterprise priority in about six months. In April 2026, Andrej Karpathy published an "idea file" on GitHub called LLM Wiki, describing a pattern for personal knowledge bases maintained by an LLM. Open-source implementations followed within weeks.

‍

His core observation landed with anyone who has built retrieval systems: in a typical RAG setup, the model rediscovers knowledge from scratch on every question, and nothing accumulates. In Karpathy's words, "the tedious part of maintaining a knowledge base is not the reading or the thinking — it's the bookkeeping." LLMs are good at bookkeeping.

‍

We now hear about LLM wikis in enterprise conversations every week. Banks, public-sector bodies and industrial companies are building their own, or asking how to harden the one they already have. The questions have shifted from "how do I build one?" to "how do I secure it, keep it accurate over time and keep it affordable at scale?" We've been working through the same questions when building our own LLM wiki here at deepset, called Kosmos.

What is an LLM wiki, and how is it different from RAG?

An LLM wiki is a persistent, structured layer of synthesized knowledge that sits between your raw sources and the agents and people who use them. Karpathy's pattern has three layers and three operations:

  • Raw sources are the immutable source of truth: documents, tickets, transcripts, usage data. The LLM reads them but never edits them.
  • The wiki is LLM-written markdown: summaries, entity pages, concept pages and cross-links. The LLM owns this layer.
  • The schema is a configuration file that tells the LLM how the wiki is structured and how to maintain it.
  • Ingest integrates a new source into every page it affects.
  • Query answers from the wiki and can file good answers back.
  • Lint checks for contradictions, stale claims and orphan pages.

‍

An LLM wiki doesn't replace RAG. It changes when the synthesis happens: at ingest time instead of at query time.

Classic RAGLLM wikiKnowledge graphAgent memory
When knowledge is synthesizedAt query time, every timeAt ingest time, once, then maintainedAt modeling time, by humans or pipelinesDuring a session or across sessions
Unit of knowledgeDocument chunksReadable, interlinked pagesEntities and typed relationsFacts tied to a user or agent
Who maintains itIndexing pipelineLLM agents, under rules you setData engineersThe agent itself
Readable by peopleRarelyYesWith toolingRarely
Best forPrecise lookups over large, changing corporaCross-source synthesis: "what's the full story on this topic?"Strict relationships and reasoning over structurePersonalization and continuity
Main riskSame context rebuilt on every callDrift, sensitive data leakage, runaway maintenance costHigh modeling effortUnbounded, unaudited growth

In practice, the strongest enterprise systems combine them. Retrieval feeds the wiki at ingest time, and retrieval over the wiki serves agents at query time.

What are LLM wiki use cases in regulated industries?

An LLM wiki pays off wherever one question means reading regulations, policies, procedures and incident history side by side, and where the answer is too sensitive to leave uncontrolled. Regulated industries are full of these questions:

IndustryWhat the wiki compilesA question it answersWho reviews sensitive pages
Financial servicesCredit, risk and conduct policies, mapped to regulator guidanceWhich of our policies does this new guidance affect?Compliance
Energy and utilitiesMaintenance procedures, safety incidents and grid-code changes, by assetWhat is the full maintenance and incident history of this substation?The responsible engineer or safety lead
ManufacturingSupplier specs, quality incidents and engineering change notices, by part or lineWhy did this part's defect rate change, and what changed upstream?Quality engineering
GovernmentLegislation, guidance and case notes, by policy areaHow has guidance on this policy changed, and which open cases does it affect?The policy owner, with access limited by security classification
Publishing and mediaArchive, rights and licensing terms, editorial standardsCan we republish this piece, in which markets and until when?Rights and legal
Pharma and life sciencesSOPs, deviations and regulatory submissionsWhich SOPs and submissions does this deviation touch?Quality assurance

Each case follows the same pattern: sensitive sources, a cross-source question people ask every week, and a named reviewer for the pages that carry risk. The rest of this article covers the controls that make that pattern safe to run.

What is Kosmos, deepset's own LLM wiki?

Kosmos is the knowledge substrate we're building to run core business functions at deepset. It's a wiki that agents across the company read from and write to. It started as a company-wide hackathon with seven teams covering sales, customer success, marketing, finance, partnerships, product usage and a shared auth and design layer. Now a dedicated cross-functional pod builds it.

‍

It has two goals. The first is a central point of access to company knowledge for every person and every agent. The second matters more: synthesis. Kosmos pulls from many systems, so it can tell a story about any topic that no single tool can. Our agents then rely on that story when they triage and evaluate ideas. Building it raised the questions every enterprise team asks about an LLM wiki: who can write to it, what can leak and what it costs.

How do you control what goes into and out of an LLM wiki?

You wrap every agent step in deterministic controls: rules in code that run the same way every time, whatever the model decides. Karpathy's pattern lets the LLM own the wiki layer. That works for a personal notebook. In a company, the wiki holds sensitive data, so the model can't be the only thing deciding what gets written and who sees it.

The agents do what they're good at: reading unstructured sources, synthesizing them and linking pages. The gates do what code is good at: enforcing the same rule every time.

  • Ingress gate. Only allowlisted sources and connectors can feed the wiki. Content is classified and PII is redacted before any model sees it. Every page inherits an owner and an access label from its sources.
  • Ingest agent. A RAG and agent pipeline retrieves related pages, decides which ones a new source affects and drafts the updates. Every claim must cite a source, so answers stay verifiable.
  • Write gate. Schema validation, citation checks and change-size limits run before anything is committed. Pages tagged as sensitive go to a human reviewer, the same way Kosmos routes customer health ratings to a value engineer.
  • Versioned wiki. Treat the wiki like code. Git-style history gives you a diff, an author and a rollback for every change. Scheduled lint jobs flag contradictions, stale claims and orphan pages.
  • Egress gate. Retrieval is filtered by the user's or agent's permissions before the model sees anything. A sales agent never gets HR pages in its context window, whatever the prompt says. Tools and MCP servers that can reach the wiki are allowlisted, too.

‍

This directly answers the question we hear most from security teams: how do you let people extend the wiki, and connect their own tools to it, without opening a path for sensitive data to leak? Answers that users file back to the wiki re-enter through the ingress gate, not through a side door. And because the controls are code, not prompts, you can test, audit and prove them.

‍

This is the balance Haystack was built for: agent flexibility where it helps, deterministic pipelines where it matters. For more on engineering the system around the model, see our guide to harness engineering.

How do you keep an LLM wiki accurate, affordable and fast as it grows?

You close the loop: trace every ingest, lint and query, evaluate them against goals the business sets, and tune the system automatically, with a human approving the changes. An LLM wiki is never finished. Every new source triggers agent work, and that work costs tokens, takes time and can introduce errors.

‍

The enterprise teams we talk to describe the same three failure modes:

  • Quality drift. Pages contradict each other, claims go stale and errors compound over months.
  • Cost creep. One source can touch 10 to 15 pages, according to Karpathy's own description. Multiply that by thousands of sources a day and a frontier model on every step, and the bill grows faster than the value.
  • Trace overload. Teams collect more trace data than they can use. It can take several engineers to sift through traces, run evals and ship a single improvement. As one AI leader at a large financial services organization told us, evals sit in one silo and production traces in another.

‍

Self-optimization treats the wiki as a system to tune, not a document to babysit. It works on four levers:

LeverWhat you tuneSignal you watch
ModelsA smaller or open-weight model for classification, linking and lint; a stronger model only for hard synthesisCost per ingest, page-quality evals
ContextHow many related pages the ingest agent retrieves, and how much of eachTokens per step, citation accuracy
CadenceEvent-driven updates for fast-moving sources, scheduled batches for slow onesFreshness against cost
StructureSchema, page granularity, index designQuery latency, answer completeness

The goal is to optimize quality, cost and performance together, and to predict the effect of a change before it ships. A change that halves cost but drops citation accuracy below your threshold should never reach production.

‍

Haystack Enterprise Platform gives you the foundation: production tracing for every agent run, and cost reporting by model, pipeline, service and workspace. Evaluations of model and harness changes against cost and quality goals, and optimization recommendations that need human approval before deployment, are the next steps on that loop.

Why does an enterprise LLM wiki need to be sovereign, without model lock-in?

An LLM wiki is your company's knowledge in compiled form, so you need to control where it runs, which models read it and where every page lives. A raw document leak exposes one file. A wiki leak exposes the synthesis: the full story on every customer, deal and product decision, already cross-linked.

‍

That changes the questions you ask about the stack:

  • Where does it run? Managed cloud for speed, a European sovereign cloud such as STACKIT for jurisdictional control, or self-hosted in your private cloud, your data center or an air-gapped network for maximum control.
  • Which models touch it? Every ingest and lint pass sends your knowledge through a model. You decide whether that's a hosted API, a self-hosted open-weight model or a mix, chosen step by step. A model-agnostic stack lets you switch without rebuilding retrieval, tools or gates.
  • Where does the data reside? The wiki, its version history, embeddings, traces and cost logs all hold sensitive content. Traces are often the most sensitive of all, because they record every prompt and retrieved page. All of it should stay in infrastructure you control.
  • Can you inspect it? If the wiki's maintenance agents ship as a closed binary, you can't audit them or improve them. Open source lets your engineers read the code, change it and avoid lock-in.

‍

Haystack Enterprise Platform is model-agnostic and runs as a managed cloud service or self-hosted in your private or sovereign cloud, including on-premises deployments. It's built on Haystack, our Apache 2.0 open-source framework. You get the same LLM wiki architecture wherever your compliance rules say it has to run. For the full picture, read our sovereign AI explainer.

How do you get started with an enterprise LLM wiki?

Start small, govern from day one and measure before you scale:

  • Pick one domain and one decision. An internal policy set, a set of operating procedures or a regulatory area. Name the team that consumes it and the decision it supports.
  • Write the schema first. Define page types, required fields, citation rules and who owns each page type.
  • Allowlist sources and connect them through MCP. Compile what needs synthesis. Fetch the rest on demand.
  • Put gates in code, not prompts. Classification and redaction at ingress, validation at write, permission filtering at egress.
  • Version everything. Every page change should have a diff, an author (human or agent) and a rollback.
  • Keep humans on high-stakes pages. Automate more as evals show where the agent is reliably right.
  • Trace from the first ingest. Track cost per ingest, page quality and query latency from day one, so you can tune instead of guess.
  • Choose your deployment and models deliberately. Decide where the wiki and its traces live, and which models may see which data, before it holds anything sensitive.

LLM wiki FAQ

What is an LLM wiki?

An LLM wiki is a knowledge base of interlinked pages that an LLM writes and maintains from your raw sources. It compiles knowledge once and keeps it current, instead of re-deriving it for every question.

Who came up with the LLM wiki?

Andrej Karpathy described the pattern in an April 2026 GitHub gist titled "LLM Wiki." It defines three layers (raw sources, wiki, schema) and three operations (ingest, query, lint).

Is an LLM wiki a replacement for RAG?

No. An LLM wiki moves synthesis from query time to ingest time. Enterprise systems still use retrieval to feed the wiki and to serve its pages to agents.

How do you stop sensitive data from leaking through an LLM wiki?

Put deterministic controls around every agent step: source allowlists and redaction at ingress, validation and human review at write time, and permission-filtered retrieval at egress. Run it where you control the infrastructure.

How much does it cost to run an LLM wiki?

Cost scales with source volume, pages touched per ingest and the models you use. Tracing, cost reporting and routing simpler steps to smaller models keep it in line with the value it delivers.

Can an LLM wiki run on-premises or air-gapped?

Yes, with a self-hostable, model-agnostic stack and open-weight models. Haystack Enterprise Platform supports self-hosted, on-premises and air-gapped deployments.

How can deepset help you build an LLM wiki?

We're building Kosmos on the same platform our customers use, and we'll keep sharing what we learn. If your team is planning an LLM wiki, or hardening one that already exists, we can help you design the controls, the optimization loop and the deployment. Talk to our team.

‍

Curious about building AI Apps and Agents?

meet the author
meet the authors
Jay Wilder
Jay Wilder
VP Marketing & Developer Relations

Leading GTM and community strategy to help companies build AI with purpose to solve complex, high-impact challenges.

Table of Contents
GET STARTED WITH A PERSONALIZED DEEPSET DEMO
Book demo

See why organizations like Airbus, The Economist, and OakNorth choose deepset.

Book Demo
EXPLORE HAYSTACK ENTERPRISE PLATFORM