Private LLMs and RAG
LLM Wiki vs RAG: Karpathy's Pattern and Enterprise Knowledge Bases
LLM wiki vs RAG explained: what Karpathy's pattern is, where it works, where it breaks on permissions, GDPR and audit, and hybrid designs for enterprises.
In short
An LLM wiki, a pattern Andrej Karpathy published in April 2026, has an AI agent compile source documents into interlinked Markdown pages that it keeps current. Retrieval-augmented generation (RAG) instead retrieves source passages at question time. The wiki suits bounded personal or team corpora; enterprises with mixed permissions, frequent updates and GDPR duties usually need RAG or a hybrid.
Key takeaways
- Andrej Karpathy's LLM wiki, published as a GitHub gist on 4 April 2026, has an AI agent compile immutable source documents into interlinked Markdown pages, following a schema file such as CLAUDE.md or AGENTS.md, through ingest, query and lint operations.
- The core difference from RAG is timing: the wiki processes knowledge when a source arrives, while RAG retrieves source passages when a question is asked, which keeps per-user permissions and source citations intact.
- The pattern suits bounded corpora with one audience; the gist says its index file works at moderate scale, about 100 sources and hundreds of pages, and recommends adding search as the wiki grows.
- As an enterprise knowledge base, compiled pages can blend sources with different permissions, copy personal data into derived text and repeat model errors, which complicates access control, GDPR rectification and erasure, and audit.
- A hybrid keeps most of the benefit: reviewed pages per access domain that cite source IDs, versioned in Git with lint checks and an owner, alongside permission-aware RAG over the sources.
What is an LLM wiki?
An LLM wiki is a knowledge base that a large language model (LLM) writes and maintains: a folder of interlinked Markdown pages compiled from your source documents. Andrej Karpathy set out the pattern in a GitHub gist titled “LLM Wiki”, created on 4 April 2026.
He calls the gist an idea file: you give it to your own AI agent, such as Claude Code, Codex or OpenCode, which works out the specifics with you. The pattern has three layers:
- Raw sources: the articles, papers, images and data files you collect. The LLM reads them but never edits them, and they remain the source of truth.
- The wiki: Markdown pages the LLM creates and updates, such as summaries, entity pages, concept pages and comparisons. You read them; you rarely write them.
- The schema: an instructions file, such as CLAUDE.md for Claude Code or AGENTS.md for Codex, that defines the wiki’s structure, conventions and workflows.
Two files help navigation: index.md lists every page with a one-line summary and is read first when answering, and log.md is an append-only record of ingests, queries and checks.
The gist argues that people abandon wikis because upkeep grows faster than value, and that an LLM makes upkeep almost free. In the transcript of a Sequoia Ascent 2026 fireside chat, posted on his blog on 30 April 2026, Karpathy described these LLM knowledge bases as wikis built for an organisation or an individual.
How do people build an LLM wiki with an AI agent and Obsidian?
The gist’s set-up is simple: an AI agent edits the Markdown files, Obsidian displays them and Git keeps the history. Karpathy compares Obsidian to an integrated development environment (IDE), the LLM to the programmer and the wiki to the codebase.
The schema tells the agent how to run three operations:
- Ingest. You add a source; the agent reads it, discusses the main points with you, writes a summary page, updates the index and related pages, and appends to the log. One source can touch 10 to 15 pages, and Karpathy prefers to ingest one at a time and check each update.
- Query. The agent finds and reads the relevant pages and answers with citations. Useful answers, such as a comparison, can be filed back as new pages.
- Lint. Periodically, the agent looks for contradictions, claims that newer sources have superseded, orphan pages, missing cross-references and gaps.
Obsidian suits this because a vault is a local folder of plain Markdown files, reloaded when another program changes them. Its graph view shows how pages connect, and its Web Clipper extension turns web articles into Markdown sources.
Scale changes the tooling. The gist says the index file works at moderate scale, about 100 sources and hundreds of pages, without embedding-based retrieval. Beyond that, it recommends proper search, such as qmd, a local tool that combines keyword and vector search with LLM re-ranking. A large LLM wiki brings retrieval back.
The pattern also circulates as agent skills: packaged instructions an agent loads when a request matches. Hermes Agent, for example, offers an optional llm-wiki skill based on the gist. Review any skill or community implementation, including the many linked in the gist’s comments, as third-party code; our guide to governing agent skills explains how.
What is the difference between an LLM wiki and RAG?
The difference is timing. An LLM wiki processes knowledge ahead of time, when a source arrives. Retrieval-augmented generation (RAG) retrieves passages from the sources when a question is asked, and a model answers from them.
In RAG, Karpathy argues, the model rediscovers knowledge for every question, while a wiki already holds the cross-references, flagged contradictions and a synthesis of everything read. That makes a wiki strong on questions that span many documents, provided the synthesis is correct.
RAG comes from a 2020 paper by Lewis and colleagues, which named two open problems with knowledge held only in a model’s weights: providing provenance and updating knowledge. RAG tackles both by keeping knowledge in a searchable index outside the model. A compiled wiki puts knowledge back into model-written text, so provenance and updates become rules your schema must define. Our explainer on retrieval-augmented generation covers the pipeline.
| LLM wiki | RAG | Hybrid | |
|---|---|---|---|
| When knowledge is processed | At ingest, as the model writes pages | At question time, from retrieved passages | Stable topics compiled and reviewed; sources retrieved per question |
| Citations | Set by the schema; answers draw on pages, not sources | To the retrieved source passages | Pages cite source IDs; answers cite pages and sources |
| Permissions | One audience per wiki; each page blends its sources’ rights | Filtered per user and passage at retrieval | One wiki per access domain, plus permission-aware retrieval |
| Freshness | As current as the last ingest and lint | As current as the last index update | Sources re-indexed; pages flagged when a cited source changes |
| Cost | Model time per ingest across many pages, plus review | Pipelines, search infrastructure and tokens per question | Both, compiling only high-value topics |
| Failure modes | Errors written into pages and repeated; stale or blended content | Missed or badly ranked passages; answers beyond the evidence | Pages drifting from sources when checks lapse |
| Best fit | Personal or team research over a bounded corpus | Large, changing collections with access rules | Enterprise knowledge bases that need synthesis and control |
Is an LLM wiki better than RAG?
Not in general: it depends on corpus size, permissions and update rate. An LLM wiki is better for a bounded corpus that changes slowly and that every reader may see in full. RAG is better for large, frequently changing collections with different access rights.
- Corpus size. The gist’s index file works at around 100 sources and hundreds of pages; larger collections need search anyway.
- Permissions. If every reader of the wiki may read every source, compiled pages are safe to share. If not, you need retrieval that filters per user.
- Update rate. One new source can change 10 to 15 pages. Frequent updates multiply model time and review effort, while RAG re-indexes only what changed.
For enterprise knowledge, a hybrid is usually the safer design: a small set of reviewed pages for stable topics, and permission-aware RAG over the sources for everything else.
Where does an LLM wiki work well?
It works best where one person or a small team owns a bounded body of knowledge and wants synthesis rather than search, as in the gist’s examples: research over weeks or months, notes on a book, course notes, competitive analysis and due diligence.
For an individual, an LLM wiki is a practical AI second brain: a personal knowledge base that grows with each article or note, while the model does the summarising, cross-referencing and filing that people tend to abandon.
Teams can use it for research notes or architecture decisions when four conditions hold: one audience, a corpus small enough to review, low sensitivity and an owner who checks the pages. Remove one and the risks below grow.
Why does an LLM wiki break as an enterprise knowledge base?
Because what suits one person collides with enterprise controls. The gist was written for personal knowledge bases and does not discuss access control, personal data or audit.
- Access control. A page that synthesises five documents carries information from all five. If their readers differ, the page leaks or must be limited to people who may read every source; per-passage filtering does not survive compilation. Our RAG security guide explains why derived content gets the narrowest rights of its sources.
- Provenance. Answers built from pages sit one step away from the evidence. Unless each claim cites a source identifier and version, reviewers cannot check it and auditors cannot trace it.
- Errors that repeat. A wrong summary becomes the basis for later pages and answers. In FABLES, a human evaluation of LLM summaries of fiction books, none of the LLM-based faithfulness raters tested correlated strongly with human annotations, especially at detecting unfaithful claims. A model’s lint pass cannot replace human review.
- Staleness and update cost. A changed or withdrawn source can affect many pages. Without a map from sources to pages the wiki drifts; with one, every change triggers rewrites and reviews.
- Scale. Past the gist’s moderate scale, the index file is not enough. Loading much of the wiki into the context is no reliable fix: in the Lost in the Middle study, models often used information in the middle of long inputs significantly worse than at the start or end.
- Audit trail.
log.mdis written by the agent it records. Git history is stronger evidence, but you still need to record the sources, model, prompt and person behind each change. - Data classification. A page should carry the highest classification of its sources, so one confidential document can raise a whole topic page; our post on data classification for enterprise AI sets out a framework.
- Model choice. Ingest has the model read every source, so with a hosted model the whole corpus passes through the provider’s service. For confidential material, use a model on infrastructure you control, such as a private LLM.
What does the GDPR mean for an LLM-maintained wiki?
If wiki pages contain personal data, the GDPR applies to them as well as to the sources, and compiled text makes some duties harder. The gist’s team wiki, fed by chat threads, meeting transcripts and customer calls, would usually contain personal data. This is not legal advice: obligations depend on your role and processing, so involve your data protection officer.
- Data minimisation and storage limitation (Article 5(1)(c) and (e)). Personal data must be limited to what the purpose needs and kept in identifiable form no longer than necessary. An entity page per person, compiled from every source that mentions them, can easily exceed both.
- Accuracy (Article 5(1)(d)). Every reasonable step must be taken to erase or rectify inaccurate personal data without delay, so a summary error about a person is a compliance issue, not only a quality issue.
- Rectification (Article 16). People can have inaccurate data about them corrected without undue delay and incomplete data completed. The correction has to reach every page that repeated the error.
- Erasure (Article 17). Where a listed ground applies, such as the data no longer being necessary, and no exception does, personal data must be erased without undue delay. Deleting the source is not enough: derived pages, the log, search indexes and Git history, which keeps every earlier version, can all hold copies.
The simplest control is design: keep personal data out of compiled pages, or confine it to pages that cite their sources so they can be found and rewritten. Those citations also help you demonstrate compliance, which Article 5(2) requires. Our guide to GDPR-compliant LLM deployment covers lawful basis, impact assessments and data subject rights.
How do you combine an LLM wiki with permission-aware RAG?
Compile pages only where synthesis pays off, keep retrieval for everything else and make every page traceable to its sources. A hybrid enterprise knowledge base with LLMs has six parts:
- One wiki per access domain. Compile pages only from sources with the same readers, such as one team’s documents or one classification level, so every reader of a page may read all its sources.
- Permission-aware RAG over the sources. Questions the pages do not cover, or that need exact wording, go to retrieval that filters each passage by the user’s rights. Index the pages too, with the rights of their domain.
- Pages that cite source IDs. Each claim or section cites a document ID with a version or content hash, so reviewers can check it and a change or erasure request finds every affected page.
- Git versioning and review. The agent proposes changes on a branch, and a named owner reviews and merges them. Each commit records the sources, model and schema version used.
- Lint in code and by people. Scripts catch broken citations, deleted sources and sources changed since compilation. The model can flag possible contradictions; people resolve them.
- Ownership. Each wiki has an owner who approves sources, reviews changes, sets retention and answers for the content.
Research supports pairing compiled summaries with retrieval. RAPTOR builds a tree of summaries in advance and retrieves from it at question time; with GPT-4, it improved the best previous accuracy on the QuALITY question-answering benchmark by 20 percentage points. Hermes Agent’s llm-wiki skill already adds some of these controls: source markers on pages that draw on several sources, and contradictions flagged for review rather than silently overwritten.
How can you try an LLM wiki safely?
Start with a corpus that would do little harm if a page were wrong or seen by the wrong person.
- Pick a bounded corpus with one owner, one audience and no personal data, such as public standards, research papers or your team’s design notes.
- Restrict the tools. Make raw sources read-only for the agent, sandbox it and limit its network access. Obsidian’s community plugins get the app’s full access to files and the internet, so keep its default Restricted Mode or allow only reviewed plugins, and approve one route for syncing the vault.
- Write the rules into the schema: every claim cites a source ID, contradictions are flagged rather than silently resolved, and pages carry their sources’ classification.
- Review every change in Git before it merges.
- Compare with RAG. Ask the wiki and plain RAG over the same sources the same real questions, and check the answers against the sources.
How SysArt helps
SysArt helps organisations decide where compiled knowledge pages add value and where answers should come straight from the sources. As part of our enterprise RAG work, we design hybrid knowledge bases on infrastructure you control, with permission-aware retrieval, cited wiki pages per access domain, review in Git, lint checks and the records your security, privacy and compliance teams need. We work on your stack, independent of any agent or model vendor.
Frequently asked questions
What is Karpathy's LLM wiki?
It is a pattern Andrej Karpathy published as a GitHub gist on 4 April 2026 for building personal knowledge bases with LLMs. An AI agent reads curated, unchanging source documents and maintains a folder of interlinked Markdown pages, such as summaries, entity pages and comparisons, following a schema file such as CLAUDE.md or AGENTS.md. The agent ingests new sources, answers questions from the pages and runs lint checks for contradictions and gaps.
Is an LLM wiki better than RAG?
It depends on corpus size, permissions and update rate. An LLM wiki works well for a bounded collection that changes slowly and that everyone who reads the wiki may read in full. Retrieval-augmented generation (RAG) fits large, frequently updated collections with different access rights, because it searches the sources at question time, filters by user and cites passages. For enterprise knowledge, a hybrid of reviewed pages and permission-aware retrieval is usually safer.
How do you use Obsidian for an LLM wiki?
In Karpathy's set-up, an AI agent edits the wiki's Markdown files while Obsidian displays them, so you can follow links and inspect the graph view as pages change. An Obsidian vault is a local folder of plain Markdown files, which lets the agent, Obsidian and Git work on the same files. Community plugins get Obsidian's full access to files and the internet, so keep Restricted Mode on or allow only reviewed plugins for sensitive material.
Can an LLM wiki work as an enterprise knowledge base?
Only with added controls. A compiled page can blend sources with different permissions, so either restrict it to people who may read every source or build one wiki per access domain. Pages should cite source IDs, changes should pass review in Git, lint checks should flag broken citations and changed sources, and each wiki needs an owner. Permission-aware RAG over the original sources covers the questions the pages do not answer.
Is an LLM wiki an AI second brain?
For one person, it can serve as one. Karpathy presents the pattern as a way to build personal knowledge bases, with examples such as journal entries, articles, podcast notes and research reading, while the agent does the summarising, cross-referencing and filing. In an organisation, the same notebook needs more: access control, named owners, review of changes and a way to correct or delete personal data across every derived page.
How does the GDPR apply to an LLM-maintained wiki?
If wiki pages contain personal data, the GDPR applies to them as well as to the sources, including the Article 5 principles of data minimisation, accuracy and storage limitation. Where rectification under Article 16 or erasure under Article 17 applies, it must reach every derived page, and Git keeps earlier versions of each page. Keeping personal data out of compiled pages, or tracing each page to its sources, makes these duties manageable. This is not legal advice.
What is an LLM wiki skill?
It is the pattern packaged as an agent skill: a SKILL.md file of instructions that an agent loads when you ask it to build, update, query or check a wiki. Hermes Agent, for example, offers an optional llm-wiki skill based on Karpathy's gist, which adds source markers to pages that draw on several sources and flags contradictions for review. Treat any third-party skill as software, and review it before an agent runs it.
Sources
- Andrej Karpathy: LLM Wiki, an idea file published as a GitHub gist (created 4 April 2026, one revision) · checked 13 November 2026
- Andrej Karpathy: Sequoia Ascent 2026 summary, with an LLM-cleaned transcript of his fireside chat (blog, 30 April 2026) · checked 13 November 2026
- Publications Office of the EU: Regulation (EU) 2016/679, General Data Protection Regulation, Official Journal text (Articles 5, 16 and 17) · checked 13 November 2026
- Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (NeurIPS 2020) · checked 13 November 2026
- Sarthi et al.: RAPTOR, Recursive Abstractive Processing for Tree-Organized Retrieval (arXiv 2401.18059) · checked 13 November 2026
- Liu et al.: Lost in the Middle, How Language Models Use Long Contexts (TACL) · checked 13 November 2026
- Kim et al.: FABLES, Evaluating Faithfulness and Content Selection in Book-Length Summarization (arXiv 2404.01261) · checked 13 November 2026
- Obsidian Help: How Obsidian stores data (vaults, Markdown files and sync options) · checked 13 November 2026
- Obsidian Help: Plugin security (community plugin access and Restricted Mode) · checked 13 November 2026
- Hermes Agent documentation (Nous Research): optional llm-wiki skill based on Karpathy's LLM Wiki · checked 13 November 2026