Saltar al contenido principal

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 conceptOur artifactCoverage
The wikiknowledge/** (markdown + status/owner/updated frontmatter)high
index.mdknowledge/INDEX.md (one row per doc, lint-enforced two-way)high
log.mdknowledge/decisions/log.mdhigh
The schemaCLAUDE.md + knowledge-base.mdhigh
Raw sources layerresearch/reference docs (mixed into knowledge/ root today)partial
Entity pages— (topic docs exist; no per-entity pages)low
LINT opscripts/knowledge-lint.shstructural onlypartial
INGEST opgovernance rule #5 ("research becomes knowledge") — policy, no toollow
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 are canonical. The graph is a star around the manifest, not an interlinked wiki.
  • Under-built spine: orientation.md links only ~9 docs; design-source-of-truth.md (a canonical map of design homes) has zero in/out links.
  • Stale index: decisions/adrs/README.md omits 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's knowledge/.
  • Cross-project sharing = the claude-kit plugin, not a repo. Genuinely reusable conventions ship as templates/rules in packages/claude-kit-plugin and reach every repo via /kit-update. No _shared package, 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.