The LLM-Wiki pattern, mapped to our knowledge base
:::note Contenido en inglés Esta página del wiki se sincroniza desde la base de conocimiento en inglés y todavía no está traducida. :::
reference· tech-lead · updated 2026-06-28 · source
Reference doc, not a normative rule — the norms live in the knowledge-base governance. Start navigation at orientation.md and the INDEX.md manifest.
Source: Karpathy, "LLM Wiki — a pattern for personal knowledge bases" (https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).
The pattern in brief
An LLM-maintained, interlinked markdown knowledge base that compounds over time instead of re-deriving answers on every query — explicitly anti-RAG. Three layers and three operations:
- Layers: raw sources (immutable inputs) → the wiki (LLM-synthesized: summaries, entity
pages, cross-references) → the schema (a config doc — like
CLAUDE.md— defining structure + workflows). Plus an index (one-line catalog of every page) and a log (chronological record of ingests / queries / lints). - Operations: INGEST (process a source → update the relevant pages), QUERY (search the wiki, not raw sources; valuable answers become new pages), LINT (health-check for contradictions, stale claims, orphan pages, missing cross-references).
Core insight: the tedious part of a KB is the bookkeeping (cross-refs, consistency, multi-file edits) — LLMs excel at that; humans curate and think.
How it maps to us
| Pattern concept | Our artifact | Coverage |
|---|---|---|
| The wiki | knowledge/** (markdown + status/owner/updated frontmatter) | high |
| index.md | knowledge/INDEX.md (one row per doc, lint-enforced two-way) | high |
| log.md | knowledge/decisions/log.md | high |
| The schema | CLAUDE.md + knowledge-base.md | high |
| Raw sources layer | research/reference docs (mixed into knowledge/ root today) | partial |
| Entity pages | — (topic docs exist; no per-entity pages) | low |
| LINT op | scripts/knowledge-lint.sh — structural only | partial |
| INGEST op | governance rule #5 ("research becomes knowledge") — policy, no tool | low |
| QUERY→page loop | — (answers don't become pages by default) | low |
We implement the storage half strongly and the operational half weakly.
Verified gaps (audit 2026-06-26)
- Cross-link debt: 20 of 41 docs are orphans (reachable only via
INDEX.md) — 8 arecanonical. The graph is a star around the manifest, not an interlinked wiki. - Under-built spine:
orientation.mdlinks only ~9 docs;design-source-of-truth.md(a canonical map of design homes) has zero in/out links. - Stale index:
decisions/adrs/README.mdomits ADR-006/007/008/009 and still marks 004/005 "Proposed". - Dead stratum still
canonical: a 2026-05-21 desktop / DigitalOcean / per-seat-USD / MDX-plan layer outranks its live successors (Vercel + Fly, B2B MXN, ADR-006) — violating "latest wins". - LINT is structural: no orphan or contradiction detection; "latest wins" is unenforced policy.
Recommendation (effort #884)
Adopt the full pattern: the 3-layer taxonomy (sources / wiki / schema), back-fill cross-links to
kill orphans, retire the dead stratum, and harden LINT to fail on orphan / stale / stale-ADR-
index. INGEST and QUERY→page become a kit-knowledge-ingest skill (follow-up #890). Whether the
product's per-client brain (ADR-007) should adopt compound-KB-over-RAG is an open spike (#893).
Relationship to the central knowledge palace (RESOLVED — ADR-013)
The two-source-of-truth question is decided: the monorepo knowledge/ is the single SoT
(ADR-013, #909/#910). The separate repo
tuempresadigital/knowledge ("knowledge palace") and its read-only kb lens are retired.
- Per-project, self-owned (fractal). Each project's monorepo owns its own
knowledge/and is its own SoT — no repo reads another repo'sknowledge/. - Cross-project sharing = the claude-kit plugin, not a repo. Genuinely reusable conventions ship
as templates/rules in
packages/claude-kit-pluginand reach every repo via/kit-update. No_sharedpackage, no central repo, no lens (José: "0 infra nueva"). - The lens's read function is already covered: docs.tuempresa.digital (humans), MemPalace mining
the monorepo
knowledge/(recall), the plugin (machine-readable conventions). - The palace's
tedos/wing held 1 doc and its_shared/was 9/10 stale duplicates of monorepo content — so reconciliation is salvaging ~2 unique docs, then archiving/renaming the external repo.