---
title: "LLM Wiki Pattern"
description: "Compounding, interlinked markdown knowledge base pattern curated autonomously by agents."
section: "concepts"
type: "concept"
created: "2026-08-22"
updated: "2026-08-24"
confidence: "high"
tags: ["knowledge-management", "agents", "technique"]
canonical: "https://pyweb.dev/wiki/llm-wiki-pattern"
---
# LLM Wiki Pattern

[andrej karpathy](/wiki/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: `&#91;&#91;concept-slug&#93;&#93;` or `&#91;&#91;concept-slug|custom label&#93;&#93;`) 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](/wiki/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](/wiki/agent-native-infrastructure)).

## Related
[context engineering](/wiki/context-engineering), [andrej karpathy](/wiki/andrej-karpathy), [agent native infrastructure](/wiki/agent-native-infrastructure), [progressive disclosure](/wiki/progressive-disclosure).

---

## Agent Navigation

cluster: person (170 pages) | betweenness: 5.7

### References (outbound)
- [Andrej Karpathy](https://pyweb.dev/wiki/andrej-karpathy.md)
- [Context Engineering](https://pyweb.dev/wiki/context-engineering.md)
- [Agent-Native Infrastructure](https://pyweb.dev/wiki/agent-native-infrastructure.md)

### Referenced by (inbound)
- [Agent-Native Infrastructure](https://pyweb.dev/wiki/agent-native-infrastructure.md)
- [Context Engineering](https://pyweb.dev/wiki/context-engineering.md)
- [Andrej Karpathy](https://pyweb.dev/wiki/andrej-karpathy.md)
- [LLM Wiki Ecosystem: Spec vs. Implementations](https://pyweb.dev/wiki/llm-wiki-ecosystem-analysis.md)

### Evidence (verified primary sources)
- [karpathy-guidelines-skill-2026](https://pyweb.dev/wiki/raw/articles/karpathy-guidelines-skill-2026.md) | origin: https://github.com/multica-ai/andrej-karpathy-skills/blob/main/skills/karpathy-guidelines/SKILL.md | ingested: 2026-08-22 | sha256: 3dbba31cbdb82e77622b5e9f337405d3b934498957fe88f021500746844073f4
- [karpathy-wiki-ecosystem-analysis-2026](https://pyweb.dev/wiki/raw/articles/karpathy-wiki-ecosystem-analysis-2026.md)

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
