wiki / concepts / llm-wiki-pattern

LLM Wiki Pattern

high confidence updated 2026-08-24 knowledge-management · agents · technique

LLM Wiki Pattern

andrej karpathy’s approach to durable knowledge: compile it once into interlinked markdown, keep it current, cross-reference, flag contradictions. Instead of rediscovering the same knowledge from scratch each time you ask an LLM, build a wiki that the LLM can reference.

Why

LLMs don’t persist learning between sessions. Every conversation starts fresh. A wiki is the external memory: the knowledge is compiled once (with sources, confidence, contradictions noted) and loaded on demand. The alternative — re-researching every time — wastes tokens and produces inconsistent results.

How it works

  • SCHEMA.md defines the structure: frontmatter, tags, page thresholds, update policy.
  • index.md lists every page. log.md records every change.
  • Wikilink syntax (for example: [[concept-slug]] or [[concept-slug|custom label]]) connects pages into a graph. Minimum 2 outbound links per page.
  • raw/ holds source articles. Pages cite raw sources via provenance markers.
  • The schema enforces quality: page thresholds (create when 2+ sources mention it), update policy (newer supersedes older, contradictions noted not hidden).

Relation to context engineering

context engineering (Matt) is the same idea applied to project instructions (AGENTS.md, CONTEXT.md). The wiki is for knowledge; those are for project context. Both say: compile once, keep current, don’t rediscover.

In 2026 the pattern was productized: TencentDB Agent Memory ships “LLM-Wiki” as one of its four governed memory asset types, explicitly crediting Karpathy’s knowledge-base pattern (see agent native infrastructure).

context engineering, andrej karpathy, agent native infrastructure, progressive disclosure.