← Back to glossary
+Suggest a term
Concept·Patterns & Practices·Added today

LLM Wiki

Also known as: agent wiki, LLM wiki pattern, repo wiki pattern

A pattern for giving AI agents durable codebase or domain knowledge: instead of retrieving raw documents at query time, a model compiles them once into a maintained wiki of structured markdown pages that agents read directly. Popularized by Andrej Karpathy in early 2026.

The LLM Wiki pattern starts from a simple observation: RAG (retrieval-augmented generation) asks the model to search and assemble relevant context fresh every time a question is asked. That works for one-off queries, but agents working inside a codebase need stable, structured knowledge they can rely on across many tasks. The pattern's answer is to compile raw sources, docs, conventions, and architecture notes into a persistent wiki, formatted for how LLMs actually read, and then maintain that wiki as the source changes.

Andrej Karpathy described the concept in a widely-shared GitHub Gist in early 2026, framing it as: the LLM is the programmer, the wiki is the codebase, and you are the architect. The idea spread fast. Cognition launched DeepWiki, generating agent-readable wikis for public GitHub repositories. Factory built AutoWiki, treating docs as a build artifact regenerated in CI on every push. LangChain open-sourced OpenWiki as a general-purpose implementation. All three are variations on the same core pattern.

For builders, the practical payoff is fewer wrong assumptions from coding agents and lower token costs for structural queries. An agent that already has an accurate map of a repository does not need to re-read raw file trees and READMEs on every task. The pattern also applies beyond code: the same compile-once, maintain-often logic works for product specs, support knowledge bases, and any domain where an agent needs to stay oriented across a long-running engagement.

This definition is AI-generated and refreshed weekly. It may contain inaccuracies. Use your own judgment, especially for production decisions.
Related terms
OpenWikiContext engineeringAGENTS.mdRAGLiving Spec