The LLM Wiki pattern, introduced by Andrej Karpathy in 2026, allows LLM agents to incrementally build a knowledge base. The system consists of three layers: raw sources, managed wiki pages, and a schema-regulation file. Key operations include ingesting new sources, querying the wiki, and linting to maintain data integrity.

The baseline implementation provides six starter-pack templates for various domains. Users can deploy these via LLM agents like OpenCode, which manage notes and entity relationships based on system instructions. While useful for general information, the baseline approach lacks formal ontology and strict logical verification, making it prone to hallucinations.

The llm-wiki-kbt project addresses these limitations by introducing a structure based on classical logic. It replaces generic links with typed relations such as subclassOf and partOf. Consistency is enforced by programmatic linting rather than the LLM, allowing for deductive reasoning and the creation of domain-specific ontologies.

The kbt implementation uses two record types: entities with defined attributes and relations between them. Each wiki specifies a perspective of consideration, including goals and rules. This structure enables rigorous proof-based decision-making, suitable for high-stakes fields like scientific research and technical analysis.

A practical example is the Euclidean geometry wiki, which contains 33 entities and 116 relations. It defines geometric primitives and theorems using formal schemas. Both the baseline and kbt repositories are open-source, allowing users to integrate them with LLM agents to manage structured knowledge bases.