LLM Wiki Reference¶
This reference captures the conceptual model behind the current MedPaper agent-wiki workflow and records the external source that motivated it.
Primary Reference¶
- Andrej Karpathy,
llm-wiki.md - Gist: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
- Raw: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f/raw/ac46de1ad27f92b28ac95459c782c07f6b8c964a/llm-wiki.md
Why It Matters Here¶
Karpathy's core idea is not "query raw files every time". It is:
- Keep raw sources immutable.
- Let the LLM maintain a persistent markdown wiki between the user and the sources.
- Use a schema / operating document so the agent behaves like a disciplined wiki maintainer rather than a generic chatbot.
That maps directly onto the MedPaper design:
- Raw sources: PubMed records, local files, web captures, markdown intake, source artifacts, and extracted sections.
- Wiki layer: reference notes, knowledge maps, synthesis pages,
index.md, andlog.md. - Schema layer: MCP instructions, skills, prompts, hooks, frontmatter conventions, and trust labels.
The Parts We Reused¶
- Persistent compiled knowledge instead of one-shot RAG answers.
index.mdandlog.mdas first-class navigation and operational artifacts.- A repeating loop of ingest, query, and lint / refresh.
- Human-guided source curation with LLM-owned markdown maintenance.
The Parts We Tightened For MedPaper¶
Karpathy's gist is intentionally abstract. In MedPaper we make several parts more explicit:
- MedPaper is the durable writer; Foam is the reading and navigation layer.
- Notes carry explicit trust labels, provenance, and canonical identifiers.
- Local or extracted sources can be upgraded into verified canonical identities.
- Reference notes now materialize stable block anchors for key findings and evidence sections.
- Reference notes also materialize explicit context links to journal, author, topic, MeSH, and section hub notes for graph traversal.
- Knowledge maps and synthesis pages now emit Foam-friendly queries and embeds.
Known Practical Limits¶
These are relevant when applying the LLM wiki pattern in this repository:
- Table / figure notes now materialize matched source-fragment anchors backed by asset-aware blocks and segmentation when those artifacts are available, but not every underlying layout fragment is surfaced yet.
- Context hub notes are currently lightweight registry pages, not full semantic ontology or concept-synthesis layers.
- For larger corpora, deterministic retrieval layers beyond a plain markdown index may still be needed.
Related Local Files¶
docs/how-to/llm-wiki.mddocs/reference/foam.mdARCHITECTURE.mdsrc/med_paper_assistant/infrastructure/persistence/reference_manager.pymemory-bank/kb-integration-blueprint.md