Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
312 lines (284 loc) · 16.3 KB
/
Copy pathindex.html
File metadata and controls
312 lines (284 loc) · 16.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The LLM Wiki Pattern</title>
<style>
:root{
--bg:#0b1220; --bg2:#0f1a2e; --ink:#e8eef7; --dim:#9fb0c8;
--accent:#ffd166; --accent2:#5ec8f0; --line:#243449; --good:#7ee2b8;
--bad:#ff9b9b; --card:#14213a;
--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
--sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
background:radial-gradient(1200px 800px at 70% -10%,#16263f 0%,var(--bg) 55%);
color:var(--ink);font-family:var(--sans);overflow:hidden;
}
/* starfield */
.stars{position:fixed;inset:0;pointer-events:none;opacity:.5}
.stars i{position:absolute;width:2px;height:2px;background:#fff;border-radius:50%;opacity:.7}
.deck{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}
.slide{display:none;width:min(1040px,92vw);max-height:92vh;overflow:auto;padding:8px 4px}
.slide.active{display:block;animation:fade .35s ease}
@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.kicker{color:var(--accent);font-weight:700;letter-spacing:.14em;text-transform:uppercase;font-size:.8rem;margin-bottom:.6rem}
h1{font-size:clamp(2rem,5.2vw,3.6rem);line-height:1.04;margin:.2rem 0 .6rem;letter-spacing:-.02em}
h2{font-size:clamp(1.5rem,3.6vw,2.4rem);line-height:1.1;margin:.2rem 0 1rem;letter-spacing:-.01em}
p,li{font-size:clamp(1rem,1.9vw,1.35rem);line-height:1.5;color:var(--ink)}
.lead{color:var(--dim);font-size:clamp(1.05rem,2.1vw,1.5rem);max-width:46ch}
ul{margin:.4rem 0;padding-left:1.2em}
li{margin:.5rem 0}
.dim{color:var(--dim)}
.accent{color:var(--accent)}
.accent2{color:var(--accent2)}
code,.mono{font-family:var(--mono);font-size:.92em}
.chip{display:inline-block;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:.25em .8em;font-size:.85rem;color:var(--dim);margin-right:.4rem}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:1.4rem;align-items:start}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:1.1rem 1.2rem}
.card h3{margin:.1rem 0 .5rem;font-size:1.15rem}
.card.bad{border-color:#5a2d33}
.card.good{border-color:#2d5a45}
pre{background:#0a1526;border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem;overflow:auto;font-family:var(--mono);font-size:1rem;line-height:1.5;color:#dce6f2}
pre .c{color:#6f8199}
pre .k{color:var(--accent2)}
pre .s{color:var(--good)}
table{border-collapse:collapse;width:100%;font-size:clamp(.9rem,1.5vw,1.05rem)}
th,td{border:1px solid var(--line);padding:.55rem .7rem;text-align:left;vertical-align:top}
th{background:#0a1526;color:var(--accent);font-weight:700}
tr:nth-child(even) td{background:rgba(255,255,255,.02)}
.arch{display:grid;grid-template-columns:1fr;gap:.8rem;margin-top:.6rem}
.layer{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:1rem 1.2rem}
.layer .n{font-family:var(--mono);font-size:1.5rem;color:var(--accent);font-weight:700;min-width:2.2ch}
.layer b{font-size:1.2rem}
.layer .path{font-family:var(--mono);color:var(--accent2)}
.big{font-size:clamp(1.6rem,4vw,2.6rem);line-height:1.15;letter-spacing:-.01em}
.arrow{color:var(--accent);font-weight:700}
/* chrome */
.hud{position:fixed;bottom:14px;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:0 20px;font-size:.8rem;color:var(--dim);pointer-events:none}
.progress{position:fixed;top:0;left:0;height:3px;background:var(--accent);width:0;transition:width .3s ease}
.nav{position:fixed;bottom:10px;left:50%;transform:translateX(-50%);display:flex;gap:8px;pointer-events:auto}
.nav button{background:var(--card);border:1px solid var(--line);color:var(--ink);border-radius:8px;padding:6px 12px;font-size:.9rem;cursor:pointer}
.nav button:hover{border-color:var(--accent)}
.hint{position:fixed;top:12px;right:16px;font-size:.75rem;color:var(--dim)}
.demo-tag{display:inline-block;background:#2b1d3a;border:1px solid #4a3a63;color:#d9b8ff;border-radius:8px;padding:.2em .7em;font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
</style>
</head>
<body>
<div class="stars" id="stars"></div>
<div class="progress" id="progress"></div>
<div class="hint">← → to move · <b>F</b> fullscreen</div>
<div class="deck" id="deck">
<!-- 1 -->
<section class="slide active">
<div class="kicker">HGSC Training · LLM Patterns</div>
<h1>The LLM Wiki Pattern</h1>
<p class="lead">Building a knowledge base that <span class="accent">compounds</span> — with Claude Code, plain Markdown, and no vector database.</p>
<p class="dim" style="margin-top:2rem">A 30-minute talk + live demo</p>
</section>
<!-- 2 -->
<section class="slide">
<div class="kicker">The problem</div>
<h2>Every new session starts from zero</h2>
<div class="cols">
<div class="card bad">
<h3 style="color:var(--bad)">The daily frustration</h3>
<p>You start a new session and re-explain the same background — who's on the team, what a shorthand term means, a decision from three sessions ago — before you can even ask your real question.</p>
</div>
<div class="card">
<h3>Why</h3>
<p>Nothing you and Claude worked out together carries over automatically. Unless that context lives somewhere the model can pick back up, you pay the re-explaining cost every session.</p>
</div>
</div>
<p class="lead" style="margin-top:1.4rem">Understanding never accumulates.</p>
</section>
<!-- 3 -->
<section class="slide">
<div class="kicker">The mental model</div>
<h2>Compile, don't retrieve</h2>
<p class="big">Like compiling code: the compile step is <span class="accent">expensive once</span> — every run after is <span class="good" style="color:var(--good)">fast and cheap</span>.</p>
<div class="cols" style="margin-top:1.6rem">
<div class="card">
<h3>One option: retrieve</h3>
<p>Chunk, embed, and retrieve the closest matches per query. Works — but retrieval is approximate, and every query starts over.</p>
</div>
<div class="card good">
<h3 style="color:var(--good)">This pattern: compile</h3>
<p>Synthesize <b>once</b> into organized pages. Query the compiled artifact selectively — and it carries over between sessions.</p>
</div>
</div>
<p class="dim" style="margin-top:1rem">Andrej Karpathy, April 2026 gist.</p>
</section>
<!-- 4 -->
<section class="slide">
<div class="kicker">Architecture</div>
<h2>Three layers</h2>
<div class="arch">
<div class="layer"><div class="n">1</div><div><b>Raw sources</b> · <span class="path">raw/</span><br><span class="dim">Immutable ground truth: PDFs, HTML, transcripts, emails. Never edited.</span></div></div>
<div class="layer"><div class="n">2</div><div><b>The wiki</b> · <span class="path">wiki/</span><br><span class="dim">LLM-generated Markdown, one page per concept. Cross-linked, with provenance. <b>This is what you query.</b></span></div></div>
<div class="layer"><div class="n">3</div><div><b>Instructions</b> · <span class="path">CLAUDE.md</span><br><span class="dim">How the wiki is built & maintained: naming, page shape, contradiction rules, index & log.</span></div></div>
</div>
</section>
<!-- 5 -->
<section class="slide">
<div class="kicker">Layer 3, reframed</div>
<h2>The "schema" is really a <span class="accent">CLAUDE.md</span></h2>
<div class="cols">
<div class="card">
<h3>What some tutorials do</h3>
<p>A bare <code>schema.md</code> — a passive data spec sitting in the folder.</p>
</div>
<div class="card good">
<h3>What the pattern actually wants</h3>
<p>Karpathy describes layer 3 as <b>a <code>CLAUDE.md</code> or <code>AGENTS.md</code></b> — the instructions file the agent reads <b>automatically</b> at session start.</p>
</div>
</div>
<p class="lead" style="margin-top:1.4rem">It's the wiki's <span class="accent">operating manual</span>, not just a schema. Your compile prompt gets to be one line because the rules already loaded.</p>
</section>
<!-- 6 -->
<section class="slide">
<div class="demo-tag">Live demo</div>
<h2 style="margin-top:.8rem">Meet the Ridgeline Community Observatory</h2>
<p class="lead">A fictional volunteer nonprofit. Four short, messy real-world source files:</p>
<table style="margin-top:1rem">
<tr><th>File</th><th>Type</th><th>What it is</th></tr>
<tr><td class="mono">membership-policy.pdf</td><td>PDF</td><td>Tiers, dues, equipment rules</td></tr>
<tr><td class="mono">visit-us.html</td><td>HTML</td><td>Public "Visit Us" web page</td></tr>
<tr><td class="mono">board-meeting-2026-06.txt</td><td>transcript</td><td>Monthly board meeting</td></tr>
<tr><td class="mono">treasurer-note.eml</td><td>email</td><td>Treasurer's note to members</td></tr>
</table>
<p class="dim" style="margin-top:1rem">Four formats in, one coherent wiki out. And they <span class="accent">disagree</span> in one place…</p>
</section>
<!-- 7 -->
<section class="slide">
<div class="demo-tag">Live demo</div>
<h2 style="margin-top:.8rem">Compile — one prompt</h2>
<pre><span class="c"># CLAUDE.md is loaded automatically, so the prompt is short:</span>
Compile this wiki. Read every file in <span class="k">raw/</span> and follow
<span class="k">CLAUDE.md</span> exactly: one page per concept in <span class="k">wiki/</span>,
cross-link related pages, cite sources, and write
<span class="k">index.md</span> and <span class="k">log.md</span> when done.</pre>
<p class="lead" style="margin-top:1.2rem">Out come <code>membership.md</code>, <code>equipment.md</code>, <code>events.md</code>, <code>governance.md</code> — cross-linked with <code>[[wiki-links]]</code>, each citing its <code>raw/</code> sources.</p>
</section>
<!-- 8 -->
<section class="slide">
<div class="demo-tag">Live demo</div>
<h2 style="margin-top:.8rem">Query the wiki, not the sources</h2>
<pre>Based on <span class="k">wiki/</span>, what will individual membership
cost in 2027, and what's the source for that?</pre>
<p class="lead" style="margin-top:1.2rem">Answers come from a curated, cross-referenced context — <span class="accent">not</span> a fresh retrieval guess. Faster, and it already knows how its own facts connect.</p>
</section>
<!-- 9 -->
<section class="slide">
<div class="demo-tag">Live demo · the payoff</div>
<h2 style="margin-top:.8rem">It surfaces the contradiction</h2>
<div class="cols">
<div class="card bad">
<h3 style="color:var(--bad)">Older sources say $40</h3>
<p>The policy PDF and the public web page: individual dues <b>$40</b>.</p>
</div>
<div class="card good">
<h3 style="color:var(--good)">Newer sources say $50</h3>
<p>Board transcript + treasurer email: raised to <b>$50</b>, effective 2027-01-01.</p>
</div>
</div>
<p class="lead" style="margin-top:1.3rem">A good compile <span class="accent">flags both with sources</span> instead of silently picking one. That surfaced conflict is often the most valuable output of the whole exercise.</p>
</section>
<!-- 10 -->
<section class="slide">
<div class="demo-tag">Live demo</div>
<h2 style="margin-top:.8rem">Add a source → it compounds</h2>
<pre><span class="c"># drop a new flyer into raw/, then:</span>
A new source was added to <span class="k">raw/</span>. Update the wiki
<span class="s">incrementally</span> per CLAUDE.md — <span class="s">do not rebuild</span>.
Touch only affected pages; refresh index and log.</pre>
<p class="lead" style="margin-top:1.2rem">It edits <code>events.md</code> and the index — and leaves everything else untouched. Prior work is <span class="accent">retained</span>, not redone.</p>
</section>
<!-- 11 -->
<section class="slide">
<div class="kicker">The real lesson</div>
<h2>Structure is the invariant — the rest adapts</h2>
<table>
<tr><th>Tutorial starter</th><th>A mature instantiation (<span class="mono">submissions-kb</span>)</th></tr>
<tr><td>Basic <code>CLAUDE.md</code></td><td>Full operating manual: voice, inbox protocol, source-disposition table, sanitization, curation</td></tr>
<tr><td>flat <code>wiki/</code></td><td>Topical dirs: <span class="mono">people/ systems/ terminology/ projects/</span>, each with a README index</td></tr>
<tr><td><code>raw/</code></td><td><code>sources/</code> + annotated <code>INDEX.md</code> + gitignored <code>inbox/</code> staging</td></tr>
<tr><td><code>log.md</code></td><td>Dropped — git history serves that role</td></tr>
</table>
<p class="lead" style="margin-top:1rem">Same three-layer skeleton, completely different body. Start simple; let structure emerge.</p>
</section>
<!-- 12 -->
<section class="slide">
<div class="kicker">Know the edges</div>
<h2>When it isn't the right fit</h2>
<ul>
<li><b>Multi-user / enterprise.</b> No access control or concurrency — it's single-writer. (Git review can be the checkpoint.)</li>
<li><b>Very large corpora.</b> Past ~100K tokens of compiled wiki, you likely still want retrieval underneath.</li>
<li><b>Highly dynamic data.</b> If sources change faster than you can review compiles, "compile once" strains.</li>
</ul>
<p class="lead" style="margin-top:1rem">Sweet spot: <span class="accent">personal- and team-scale</span> knowledge you query often and grow slowly.</p>
</section>
<!-- 13 -->
<section class="slide">
<div class="kicker">Your turn</div>
<h1>Go compile something</h1>
<ul>
<li>Work through <code>llm-wiki-pattern-tutorial.md</code> with the <code>sample-docs/</code>.</li>
<li>Copy the <code>starter/</code> scaffold to begin your own.</li>
<li>Read <code>BCM-HGSC/submissions-kb</code> on GitHub to see one grown up.</li>
</ul>
<p class="lead" style="margin-top:1.4rem">Compile once. Query many. Let knowledge <span class="accent">compound</span>.</p>
<p class="dim" style="margin-top:1.6rem">Search “Karpathy LLM wiki” · April 2026 gist</p>
</section>
</div>
<div class="nav">
<button onclick="go(-1)">‹ Prev</button>
<button onclick="go(1)">Next ›</button>
</div>
<div class="hud"><span>The LLM Wiki Pattern</span><span id="counter">1 / 13</span></div>
<script>
// starfield
(function(){
const s=document.getElementById('stars');let h='';
for(let i=0;i<70;i++){const x=(i*37+13)%100,y=(i*53+7)%100,d=(i%3)?.6:.3;
h+='<i style="left:'+x+'%;top:'+y+'%;opacity:'+d+'"></i>';}
s.innerHTML=h;
})();
const slides=[...document.querySelectorAll('.slide')];
let i=slides.findIndex(s=>s.classList.contains('active'));
if(i<0)i=0;
const counter=document.getElementById('counter');
const progress=document.getElementById('progress');
function render(){
slides.forEach((s,n)=>s.classList.toggle('active',n===i));
counter.textContent=(i+1)+' / '+slides.length;
progress.style.width=((i)/(slides.length-1)*100)+'%';
if(location.hash!=='#'+(i+1)) history.replaceState(null,'','#'+(i+1));
}
function go(d){i=Math.max(0,Math.min(slides.length-1,i+d));render();}
function goto(n){i=Math.max(0,Math.min(slides.length-1,n));render();}
addEventListener('keydown',e=>{
if(e.key==='ArrowRight'||e.key==='PageDown'||e.key===' '){go(1);e.preventDefault();}
else if(e.key==='ArrowLeft'||e.key==='PageUp'){go(-1);e.preventDefault();}
else if(e.key==='Home'){goto(0);}
else if(e.key==='End'){goto(slides.length-1);}
else if(e.key.toLowerCase()==='f'){
if(!document.fullscreenElement)document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen();
else document.exitFullscreen&&document.exitFullscreen();
}
});
// click right/left thirds to navigate (ignore buttons/links)
addEventListener('click',e=>{
if(e.target.closest('button,a'))return;
go(e.clientX > innerWidth*0.5 ? 1 : -1);
});
// deep link
const start=parseInt(location.hash.replace('#',''),10);
if(start>=1&&start<=slides.length)i=start-1;
render();
</script>
</body>
</html>