Karpathy LLM Memory Wiki
by @dobrinalexandru
Compilation-over-retrieval knowledge wiki for OpenClaw agents. Drop sources in, get structured cross-referenced pages out. Knowledge compounds instead of dis...
clawhub install wiki-systemπ About This Skill
name: karpathy-wiki description: Compilation-over-retrieval knowledge wiki for OpenClaw agents. Drop sources in, get structured cross-referenced pages out. Knowledge compounds instead of disappearing. Based on Andrej Karpathy's LLM Wiki pattern.
Wiki System
> "The tedious part of maintaining a knowledge base is not the reading or thinking β it's the bookkeeping." > β Andrej Karpathy
Most AI memory systems retrieve and forget. You ask a question, the agent fetches context, answers, and the insight vanishes into chat history. Next session, same question, same fetch, same synthesis from scratch.
This skill implements Karpathy's compilation-over-retrieval pattern (original gist): instead of fetching raw sources every time, the agent builds and maintains a structured wiki β cross-referenced markdown pages that compound knowledge over time. The human curates what goes in; the agent handles the summarization, cross-referencing, and maintenance that humans typically abandon because the overhead grows unbearably.
Three Layers
1. Raw Sources (immutable) β PDFs, articles, papers, URLs. You drop them in, the agent reads but never modifies them.
2. The Wiki (LLM-maintained) β structured markdown pages in memory/wiki/ with frontmatter, claims, cross-references. The agent creates, updates, and maintains these automatically.
3. The Schema (WIKI-SCHEMA.md) β rules for structure, naming, and workflows. Co-evolves with your knowledge base.
Three Operations
[[cross-references]] across related pages. A single source can touch multiple existing pages.Compatibility
Works out of the box with
memory/wiki to memorySearch.extraPaths so wiki pages are searchable via memory_search. No manual config needed.MEMORY.md; the wiki compiles external knowledge into memory/wiki/. Different inputs, different outputs, never touching each other's files. Dreaming can even queue wiki candidates to the ingestion queue β the 4AM ingest cron picks them up 90 minutes after dreaming finishes at 2:30AM.Enhanced with (optional)
memory/**/*.md recursively, so wiki pages are auto-indexed every 10 minutes with no extra config.memory/wiki/index.md to the sync script lets cross-session recall know what wiki topics exist, even on different devices.[[wikilink]] cross-references are Obsidian-compatible. Point Obsidian at memory/wiki/ to browse, visualize the knowledge graph, and follow links.What the wiki agent never modifies
DREAMS.md β owned by Dreaming diarymemory/YYYY-MM-DD.md β owned by daily compactionmemory/dreaming/ β owned by Dreaming reportsmemory/projects/active/ β owned by project workflowsmemory/decisions.log, memory/learnings.log β owned by tracking systemsNote: The setup script appends a wiki reference section to MEMORY.md once during installation (so the agent knows the wiki exists). After setup, the wiki system never modifies MEMORY.md again β Dreaming retains full ownership.
How It Works
You drop sources into work/wiki-sources/
|
v
[Wiki Ingest - cron or manual]
Reads sources, extracts claims, creates/updates pages
|
v
memory/wiki/*.md (structured pages with frontmatter + cross-references)
|
v
[OpenClaw Memory Index]
memory_search finds wiki pages alongside your other memory files
Wiki pages live inside memory/ so every OpenClaw memory backend indexes them automatically. No extra configuration needed.
Installation
Basic setup (directories, templates, MEMORY.md reference):
bash skills/karpathy-wiki/scripts/wiki-setup.sh
Full setup with automated cron jobs and SuperMemory cloud sync:
bash skills/karpathy-wiki/scripts/wiki-setup.sh --all --tz America/New_York
Flags:
--tz TIMEZONE β timezone for cron jobs (default: UTC)--with-cron β create ingest (daily 4AM) and lint (Sunday 3:30AM) cron jobs--with-sync β add wiki index to SuperMemory sync script (enables cloud persistence)--all β enable both --with-cron and --with-syncThe basic setup creates:
1. memory/wiki/ with index.md and log.md
2. work/wiki-sources/ with pdfs/, articles/, papers/ subdirs
3. WIKI-SCHEMA.md at workspace root
4. Ingestion queue at work/wiki-sources/ingestion-queue.md
5. Wiki reference section appended to MEMORY.md (if present)
Cron jobs and SuperMemory sync are opt-in β you control what gets automated.
Uninstall
openclaw cron delete # Get IDs: openclaw cron list | grep Wiki
openclaw cron delete
rm -rf memory/wiki/ work/wiki-sources/ WIKI-SCHEMA.md
Usage
Adding knowledge
During a conversation:
1. Save the source to work/wiki-sources/
2. Add it to work/wiki-sources/ingestion-queue.md:
## Pending
- [ ] articles/my-article.md | Added 2026-04-07
- [ ] https://example.com/paper | Added 2026-04-07
3. Say "wiki ingest" β the agent processes the queue immediatelyTrigger ingest outside a conversation:
openclaw cron run
Automated: Cron processes up to 3 sources daily at 4AM.
Querying the wiki
The agent checks memory/wiki/index.md for relevant pages, reads them, and synthesizes answers with citations. If a question reveals a knowledge gap, it adds an entry to the ingestion queue for future research.
Manual lint
Say "wiki lint" to run a health check anytime.
Page Format
Pages use domain-prefixed kebab-case names with YAML frontmatter:
---
title: "Senolytics Overview"
domain: longevity
created: 2026-04-07
updated: 2026-04-07
sources:
- work/wiki-sources/papers/unity-trial.pdf
tags: [senescence, aging]
confidence: high
status: active
Senolytics Overview
Summary
2-3 sentence overview.Key Claims
1. Claim with source attributionOpen Questions
Unresolved questions Related
[[longevity-cellular-reprogramming]]
Domains: bio, vita, longevity, tech, ops, finance, people (customizable in WIKI-SCHEMA.md)
See skills/karpathy-wiki/templates/page-template.md for a starter.
File Layout
WIKI-SCHEMA.md <- Rules and conventions
memory/wiki/index.md <- Page catalog (<4000 tokens)
memory/wiki/log.md <- Activity log (append-only)
memory/wiki/{domain}-{topic}.md <- Wiki pages
work/wiki-sources/ <- Raw source documents
work/wiki-sources/ingestion-queue.md <- Processing queue
skills/karpathy-wiki/scripts/ <- Ingest and lint prompts
skills/karpathy-wiki/templates/ <- Scaffold templates
skills/karpathy-wiki/references/ <- Background on the pattern
Cron Schedule
| Job | Schedule | Recommended Model | Purpose | |-----|----------|-------------------|---------| | Wiki Ingest | 4:00 AM daily | Reasoning-capable (e.g., Claude Sonnet, GPT-4o, Gemini Pro) | Process ingestion queue β needs synthesis and cross-referencing | | Wiki Lint | Sunday 3:30 AM | Fast/cheap (e.g., Claude Haiku, GPT-4o-mini, Gemini Flash) | Health check β mechanical validation, no creative thinking needed |
Timezone configurable via --tz during setup. Ingest runs 90 minutes after Dreaming (2:30AM) to avoid conflicts. Model is set during cron creation β change anytime with openclaw cron edit .
Troubleshooting
openclaw memory status to check index. Try openclaw memory index --force.openclaw cron list for status. Restart gateway if needed.Credits
Inspired by Andrej Karpathy's LLM Wiki pattern. Implementation adapted for OpenClaw's memory architecture with compatibility across all memory backends (builtin, QMD, Honcho), optional Dreaming integration, and SuperMemory cloud persistence.
See skills/karpathy-wiki/references/karpathy-llm-wiki.md for the full concept breakdown.
π‘ Examples
Adding knowledge
During a conversation:
1. Save the source to work/wiki-sources/
2. Add it to work/wiki-sources/ingestion-queue.md:
## Pending
- [ ] articles/my-article.md | Added 2026-04-07
- [ ] https://example.com/paper | Added 2026-04-07
3. Say "wiki ingest" β the agent processes the queue immediatelyTrigger ingest outside a conversation:
openclaw cron run
Automated: Cron processes up to 3 sources daily at 4AM.
Querying the wiki
The agent checks memory/wiki/index.md for relevant pages, reads them, and synthesizes answers with citations. If a question reveals a knowledge gap, it adds an entry to the ingestion queue for future research.
Manual lint
Say "wiki lint" to run a health check anytime.
π Tips & Best Practices
openclaw memory status to check index. Try openclaw memory index --force.openclaw cron list for status. Restart gateway if needed.