🛰️ LLM Wiki di Karpathy con MdExplorer
Il pattern emergente per costruire conoscenza che si accumula nel tempo con l'aiuto di un agente AI
Cos'è un LLM Wiki?
Un LLM Wiki è un wiki strutturato in file markdown che un agente AI mantiene attivamente. Il pattern è stato proposto da Andrej Karpathy (co-fondatore OpenAI, ex Director of AI Tesla) ad Aprile 2026 in un gist pubblico.
L'idea centrale: invece di fare retrieval (RAG) su documenti grezzi ad ogni domanda — riscoprendo le stesse cose mille volte — un LLM costruisce e mantiene un wiki di pagine sintetiche. Le risposte utili diventano nuove pagine. La conoscenza si compone nel tempo.
"MdExplorer è l'IDE; l'LLM è il programmatore; il wiki è il codebase."
— adattamento dell'idea di Karpathy (LLM Wiki, Aprile 2026)
An LLM Wiki is a wiki of markdown files that an AI agent actively maintains. The pattern was proposed by Andrej Karpathy (OpenAI co-founder, former Tesla AI Director) in April 2026 via a public gist.
Core idea: instead of doing retrieval (RAG) on raw documents on every query — rediscovering the same things over and over — an LLM builds and maintains a wiki of synthetic pages. Useful answers become new pages. Knowledge compounds over time.
"MdExplorer is the IDE; the LLM is the programmer; the wiki is the codebase."
— adapted from Karpathy's LLM Wiki idea (April 2026)
L'architettura a tre layer
Il pattern organizza la conoscenza in tre layer chiaramente separati:
Raw Sources
Documenti grezzi (PDF, articoli, transcript). Immutabili. Curati dall'umano.
Wiki
Pagine markdown sintetiche: indice, log, entità, concetti, sintesi. Mantenute dall'LLM.
Schema
Un singolo CLAUDE.md con le regole strutturali. Definito dall'umano, seguito dall'LLM.
La separazione è cruciale: il raw è sacro (mai modificato), il wiki è mutabile (l'LLM lo aggiorna ad ogni ingest), lo schema è il contratto (cambia raramente, in modo controllato).
The pattern organizes knowledge into three clearly separated layers:
Raw Sources
Raw documents (PDFs, articles, transcripts). Immutable. Curated by the human.
Wiki
Synthetic markdown pages: index, log, entities, concepts, summaries. Maintained by the LLM.
Schema
A single CLAUDE.md with the structural rules. Defined by the human, followed by the LLM.
The separation is crucial: raw is sacred (never modified), wiki is mutable (LLM updates it on every ingest), schema is the contract (changes rarely, in a controlled way).
Use case: chi fa cosa
Diagramma degli attori e delle interazioni principali. Il curatore umano aggiunge fonti, fa domande, approva. L'agente AI riassume, aggiorna, sintetizza, segnala contraddizioni e gap.
Diagram of actors and main interactions. The human curator adds sources, asks questions, approves. The AI agent summarizes, updates, synthesizes, flags contradictions and gaps.
github.com/salaroglio/mdexplorer-demo e apri llm-wiki/diagrams/.
@startuml
skinparam backgroundColor #f7fafc
skinparam shadowing false
skinparam roundCorner 12
skinparam DefaultFontName Helvetica
skinparam DefaultFontColor #1a202c
skinparam actor {
BackgroundColor #667eea
BorderColor #5568d3
FontColor #ffffff
}
skinparam usecase {
BackgroundColor #ffffff
BorderColor #667eea
FontColor #1a202c
}
actor "👤 Curatore umano" as Human
actor "🤖 Agente AI" as LLM
rectangle "MdExplorer (substrato del wiki)" {
usecase "📥 Aggiunge una source grezza" as UC1
usecase "💬 Pone una domanda al wiki" as UC2
usecase "✅ Approva i cambiamenti" as UC3
usecase "🧹 Lancia il lint periodico" as UC4
usecase "📝 Scrive il riassunto" as UC5
usecase "🔄 Aggiorna entità e concetti" as UC6
usecase "🔍 Cerca via index" as UC7
usecase "✍️ Sintetizza con citazioni" as UC8
usecase "📜 Logga le operazioni" as UC9
usecase "🚨 Segnala contraddizioni e gap" as UC10
}
Human --> UC1
Human --> UC2
Human --> UC3
Human --> UC4
LLM --> UC5
LLM --> UC6
LLM --> UC7
LLM --> UC8
LLM --> UC9
LLM --> UC10
UC1 ..> UC5 : <<triggers>>
UC1 ..> UC6 : <<triggers>>
UC2 ..> UC7 : <<triggers>>
UC2 ..> UC8 : <<triggers>>
UC4 ..> UC10 : <<triggers>>
@enduml
Workflow: ingest di una nuova source
Quando l'umano aggiunge un nuovo documento grezzo, l'agente AI esegue una procedura ben definita: legge, riassume, propaga le modifiche su entità e concetti correlati, e logga l'operazione. Niente decisioni unilaterali: l'umano vede sempre il diff prima del commit.
When the human adds a new raw document, the AI agent executes a well-defined procedure: reads, summarizes, propagates changes to related entities and concepts, and logs the operation. No unilateral decisions: the human always sees the diff before the commit.
@startuml
skinparam activity {
BackgroundColor #ffffff
BorderColor #667eea
StartColor #5568d3
EndColor #5568d3
DiamondBackgroundColor #f093fb
DiamondBorderColor #764ba2
}
skinparam ArrowColor #5568d3
|👤 Umano|
start
:Aggiunge file in **sources/raw/**;
|🤖 Agente AI|
:Legge la fonte intera;
:Estrae claim chiave + riferimenti;
:Scrive **sources/YYYY-MM-titolo.md**;
:Identifica entità menzionate;
if (entità esiste?) then (sì)
:Aggiorna **entities/<nome>.md**;
else (no)
:Crea **entities/<nome>.md**;
endif
:Identifica concetti menzionati;
if (concetto esiste?) then (sì)
if (contraddice il vecchio?) then (sì)
#f093fb:**SEGNALA CONTRADDIZIONE**;
:Logga `CONFLICT`;
else (no)
:Aggiorna **concepts/<nome>.md**;
endif
else (no)
:Crea **concepts/<nome>.md**;
endif
:Aggiorna **index.md**;
:Append in **log.md**: INGEST;
|👤 Umano|
:Esamina il diff sintetico;
if (modifiche OK?) then (sì)
:git commit;
stop
else (no)
#f093fb:Richiede modifiche;
detach
endif
@enduml
Workflow: rispondere a una domanda
Quando l'umano fa una domanda, l'LLM cerca via index.md, legge le pagine candidate per intero (non chunks), sintetizza con citazioni puntuali e — se la risposta è non banale — propone di salvarla come nuova pagina concept. Questo è il meccanismo del knowledge compounding.
When the human asks a question, the LLM searches via index.md, reads candidate pages in full (not chunks), synthesizes with precise citations and — if the answer is non-trivial — proposes saving it as a new concept page. This is the knowledge compounding mechanism.
@startuml
skinparam sequence {
ArrowColor #5568d3
ParticipantBackgroundColor #667eea
ParticipantBorderColor #5568d3
ParticipantFontColor #ffffff
LifeLineBorderColor #5568d3
LifeLineBackgroundColor #e0e7ff
}
actor "👤 Curatore" as H
participant "🛰️ MdExplorer" as MDE
participant "🤖 Agente AI" as LLM
participant "📚 Wiki files" as W
participant "📜 log.md" as L
H -> MDE : domanda
MDE -> LLM : query + file system
== Discovery ==
LLM -> W : leggi **index.md**
W --> LLM : catalogo
LLM -> W : leggi 2-5 pagine candidate
W --> LLM : contenuto completo
== Sintesi ==
LLM -> LLM : sintetizza con citazioni
LLM --> H : risposta + [fonte]
== Compounding ==
LLM -> H : "Salvo come nuova concept page?"
alt risposta utile
H -> LLM : sì
LLM -> W : crea **concepts/<nuovo>.md**
LLM -> W : aggiorna **index.md**
LLM -> L : QUERY → SAVED
else one-shot
H -> LLM : no
LLM -> L : QUERY (no save)
end
@enduml
RAG vs LLM Wiki: quando usare cosa
Il pattern non sostituisce RAG in tutti i casi — sono complementari. RAG eccelle quando il corpus è enorme ed eterogeneo; LLM Wiki eccelle quando il dominio è focalizzato e la qualità conta più della copertura.
| Aspetto | RAG | LLM Wiki |
|---|---|---|
| Sorgente | Documenti grezzi | Wiki sintetico |
| Storage | Vector DB (embeddings) | File markdown |
| Operazione per query | Embed + retrieve + rerank + LLM | Read index + 2-5 pages + LLM |
| Knowledge compounding | ❌ Non si accumula | ✅ Ogni risposta utile diventa pagina |
| Visibilità | ❌ Chunk opachi | ✅ Pagine leggibili e diffabili |
| Quando usarlo | Corpus enorme, query varie | Dominio focalizzato, qualità prima |
The pattern doesn't replace RAG in all cases — they're complementary. RAG excels with large heterogeneous corpora; LLM Wiki excels with focused domains where quality matters more than coverage.
| Aspect | RAG | LLM Wiki |
|---|---|---|
| Source | Raw documents | Synthetic wiki |
| Storage | Vector DB (embeddings) | Markdown files |
| Per-query operation | Embed + retrieve + rerank + LLM | Read index + 2-5 pages + LLM |
| Knowledge compounding | ❌ Doesn't accumulate | ✅ Every useful answer becomes a page |
| Visibility | ❌ Opaque chunks | ✅ Readable, diffable pages |
| When to use | Huge corpus, varied queries | Focused domain, quality first |
Perché MdExplorer è il substrato perfetto
Il pattern LLM Wiki può essere implementato con setup multi-app frammentato (editor markdown generico + Git CLI + agenti AI esterni configurati a mano). MdExplorer ha tutto il necessario già pronto, in un'unica app cross-platform:
- 📂 Project-based: una cartella di markdown è un "progetto" first-class con search, link tracking, indicizzazione
- 📜
CLAUDE.mdnativo: il file schema è già parte della convenzione MDE - 🔄 Git integrato: vedi cosa l'LLM ha modificato, fai diff, blame, revert
- 🔍 Search semantico locale: indicizzazione con
nomic-embed-texton-device, no cloud - 📊 PlantUML embedded: i diagrammi nelle pagine concept sono renderizzati live
- 🤖 LLM locale: LLamaSharp permette di mantenere il wiki senza dipendenze cloud
- 🪟 App Store interno: embedi Claude Code, Copilot CLI, Gemini direttamente nell'app via iframe
The LLM Wiki pattern can be implemented with a fragmented multi-app setup (generic markdown editor + Git CLI + manually-configured external AI agents). MdExplorer has everything needed built-in, in a single cross-platform app:
- 📂 Project-based: a folder of markdown is a first-class "project" with search, link tracking, indexing
- 📜 Native
CLAUDE.md: the schema file is already part of MDE conventions - 🔄 Git integrated: see what the LLM modified, diff, blame, revert
- 🔍 Local semantic search: indexing with on-device
nomic-embed-text, no cloud - 📊 Embedded PlantUML: diagrams in concept pages render live
- 🤖 Local LLM: LLamaSharp lets you maintain the wiki without cloud dependencies
- 🪟 Internal App Store: embed Claude Code, Copilot CLI, Gemini directly via iframe
Inizia in 3 minuti
- Scarica MdExplorer da qui e installalo
- Clona la demo:
git clone https://github.com/salaroglio/mdexplorer-demo - Apri il progetto in MdExplorer e naviga in
llm-wiki/ - Leggi
README.md, poiCLAUDE.md, poiindex.md - Apri i diagrammi in
llm-wiki/diagrams/per vederli renderizzati - Prendi
CLAUDE.mdcome template e adattalo al tuo dominio
Suggerimento: il wiki funziona meglio quando il dominio è focalizzato (es. "tutto su un progetto open source", "tutto su un autore", "tutto su un'area di ricerca"). Se il tuo dominio è troppo eterogeneo, considera invece RAG o un mix dei due.
- Download MdExplorer from here and install it
- Clone the demo:
git clone https://github.com/salaroglio/mdexplorer-demo - Open the project in MdExplorer and navigate to
llm-wiki/ - Read
README.md, thenCLAUDE.md, thenindex.md - Open the diagrams in
llm-wiki/diagrams/to see them rendered - Take
CLAUDE.mdas a template and adapt it to your domain
Tip: the wiki works best when the domain is focused (e.g. "everything about one open source project", "everything about one author", "everything about one research area"). If your domain is too heterogeneous, consider RAG or a mix instead.
Risorse
- Gist originale di Karpathy — il documento che ha lanciato il pattern
- Demo LLM Wiki su GitHub — un wiki completo con sources, entità, concetti, diagrammi
- Workflow Claude Code con MdExplorer — come integrare Claude Code nel tuo flusso
- Scarica MdExplorer — Windows e Linux, gratis e open source
- Karpathy's original gist — the document that launched the pattern
- LLM Wiki demo on GitHub — a complete wiki with sources, entities, concepts, diagrams
- Claude Code workflow with MdExplorer — how to integrate Claude Code into your flow
- Download MdExplorer — Windows and Linux, free and open source