Agentops llm-wiki
Build and maintain a compounding external-knowledge wiki from clipped articles, papers, and transcripts. Triggers: "llm wiki", "ingest this", "second brain", "compile my reading", "wiki lint", "what do we know about <topic>". Based on Andrej Karpathy''''s LLM Wiki pattern (April 2026).
git clone https://github.com/boshu2/agentops
T=$(mktemp -d) && git clone --depth=1 https://github.com/boshu2/agentops "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills-codex/llm-wiki" ~/.claude/skills/boshu2-agentops-llm-wiki && rm -rf "$T"
skills-codex/llm-wiki/SKILL.mdLLM Wiki Skill (proposal)
Purpose: Keep a compounding markdown wiki of external knowledge (articles, papers, transcripts, clipped web content) maintained by an LLM so the bookkeeping is free and the knowledge accumulates. Based on Andrej Karpathy's "LLM Wiki" pattern published April 2026. See references/architecture.md for the full design rationale and how it interoperates with existing AgentOps skills.
Status: PROPOSAL — not yet merged. Opened 2026-04-11 for council review. See
for the research that motivated this skill..agents/research/2026-04-11-karpathy-llm-wiki-integration.md
The core idea in one paragraph
RAG has a critical flaw: there is no accumulation. Each query re-discovers fragments from the raw source corpus. The LLM Wiki pattern replaces per-query RAG with a persistent LLM-maintained markdown wiki that sits between raw sources and the user. The LLM reads each raw doc once, extracts concepts, writes summaries, cross-links related ideas, and keeps the whole thing current. On query time, the LLM reads the already-compiled wiki — much faster, much richer, and it compounds.
Karpathy's metaphor: "Obsidian is the IDE. The LLM is the programmer. The wiki is the codebase." Same as AgentOps's internal-flywheel pattern, applied to external knowledge.
What this skill IS
A specification for four operations against a wiki-structured vault:
— process new raw source → write wiki pages + update index + logingest
— answer a question from wiki pages → file synthesis results back as new pagesquery
— periodic health-check for contradictions, stale claims, orphans, missing conceptslint
— move a mature wiki page from draft to reviewed, or from wiki to authored contentpromote
What this skill is NOT
- Not a replacement for
—compile
handles internal AgentOps artifacts (skills/compile
→.agents/learnings/
)..agents/compiled/
handles external source material (llm-wiki
→raw/
). They complement; they don't overlap. Seewiki/
for the distinction.references/architecture.md - Not a replacement for
—research
writes net-new research artifacts from investigation;research
organizes pre-existing external material. A research artifact can cite wiki pages; a wiki page can inform a research artifact.llm-wiki - Not a RAG system — it's the opposite. RAG retrieves fragments per query; LLM Wiki pre-compiles them into durable pages.
- Not auto-scheduled — the skill defines the operations; scheduling (cron / systemd / launchd / Codex hooks) is the host's problem. References doc explains the 3-tier model (always-on Tier 1 local LLM, on-demand Tier 2 Claude, human Tier 3) but doesn't force a specific scheduler.
Quick Start
# Initialize the wiki layout in the current project $llm-wiki init # Drop a raw file into raw/articles/ then ingest it $llm-wiki ingest raw/articles/karpathy-llm-wiki-gist.md # Query the wiki for what we know about a topic $llm-wiki query "what's the Karpathy LLM Wiki pattern?" # Lint the wiki for orphans, contradictions, stale pages $llm-wiki lint # Promote a mature wiki page out to authored content $llm-wiki promote wiki/concepts/llm-wiki.md --to platform-lab/patterns/llm-wiki-architecture.md
Flags
| Flag | Default | Description |
|---|---|---|
| 2 | Operator tier. Tier 1 writes only and never touches authored dirs. Tier 2 writes and can promote. Tier 3 (human) does the final promotion to / authored paths. |
| | Override the default raw inbox location |
| | Override the default wiki output location |
| off | Show what would be ingested/written without making changes |
| off | For , apply auto-fixes (orphan linking, stale flagging) instead of just reporting |
| 30 days | For , only consider pages touched since this date |
| | Override the index location |
| | Override the log location |
Execution phases
Phase 1 — init
initCreate the wiki layout in the current project if not already present:
<project>/ ├── INDEX.md ← content catalog ├── LOG.md ← append-only operation log ├── SOUL.md ← (optional) user identity for always-load ├── CRITICAL_FACTS.md ← (optional) ~150-token always-load context ├── raw/ ← Karpathy raw layer │ ├── articles/ │ ├── papers/ │ ├── transcripts/ │ ├── screenshots/ │ └── assets/ └── wiki/ ← Karpathy compiled layer ├── sources/ ← per-raw-doc summaries ├── entities/ ← people, orgs, products, tools ├── concepts/ ← ideas, frameworks, theories └── synthesis/ ← cross-cutting analyses
Seeds
INDEX.md and LOG.md with headers; leaves SOUL.md and CRITICAL_FACTS.md as optional stubs. Writes a _CLAUDE.md (or updates existing) with the workflow sections. Idempotent — re-running on an existing layout is a no-op.
Phase 2 — ingest <raw-path>
ingest <raw-path>For each raw source:
- Read it fully (don't skim).
- Write a summary page at
with frontmatter:wiki/sources/<slug>.mdtype: source raw: <path to raw file> ingested: <ISO datetime> status: draft|reviewed # draft if Tier 1, reviewed if Tier 2 - Extract candidate entities (people, organizations, products, tools) → stub pages in
or update existing ones. Add a backlink from the source page.wiki/entities/ - Extract candidate concepts (ideas, frameworks) → stub pages in
or update existing ones.wiki/concepts/ - Update
with every new page. Failure to update index = lint failure later.INDEX.md - Append to
:LOG.mdYYYY-MM-DD HH:MM | <actor> | INGEST | <source slug> | <pages created> | <wikilink> - If any existing
page covers this topic, revise it to incorporate the new source; don't leave stale versions.wiki/synthesis/*
Tier 1 constraint: If running as
--tier 1, all writes get status: draft. Tier 1 never touches wiki/synthesis/ (synthesis requires review). Tier 1 never modifies existing status: reviewed pages.
Phase 3 — query <question>
query <question>Answer a question from the wiki:
- Search
for relevant pages. Also checkwiki/**
,.agents/learnings/
, authored content dirs if present..agents/findings/ - Synthesize an answer with citations — every non-trivial claim must cite a specific page via wikilink.
- If the answer is non-trivial and likely to be asked again, file it as a new
with the question, answer, and citations.wiki/synthesis/<slug>.md - Append to
with opLOG.md
.QUERY
Authored content takes precedence over wiki drafts. If a concept is already covered in
.agents/findings/ or .agents/learnings/, cite that first and treat the wiki as supplementary.
Phase 4 — lint
lintWalk
wiki/ and flag:
- Orphan pages — no backlinks from any other wiki page and no entry in
INDEX.md - Broken wikilinks — links pointing at pages that don't exist
- Stale pages —
date >ingested
cutoff AND the domain is evolving (user-configured stale-domain list)--since - Contradictions — two pages making incompatible claims without a reconciliation note. Simple keyword heuristic + LLM re-read for candidates.
- Missing concepts — entities or concepts referenced in
that don't have a dedicated pagewiki/sources/ - Index drift — files in
that aren't listed inwiki/**
, OR index entries that point at non-existent filesINDEX.md
Write findings to
wiki/synthesis/lint-YYYY-MM-DD.md. Don't auto-fix by default — lint reports, human or Tier 2 decides.
With
--force, auto-fix:
- Add missing index entries
- Flag stale pages with
status: stale - Write orphan warning comments to orphan pages
Append to
LOG.md with op LINT.
Phase 5 — promote <wiki-path> --to <destination>
promote <wiki-path> --to <destination>Move a mature wiki page to authored content:
- Verify the destination is a valid target (
,platform-lab/patterns/*
,career/*
, or similar project-specific authored dirs).learning/*
to preserve history if possible; otherwise rewrite.git mv- Update
— remove from wiki section, add to authored section.INDEX.md - Find and update all backlinks to the old path.
- Append to
with opLOG.md
.PROMOTE
Tier 1 cannot promote. Tier 2 can promote within the wiki (
status: draft → reviewed). Tier 3 (human) promotes out of the wiki to authored dirs.
Integration with existing AgentOps skills
| Skill | Interaction |
|---|---|
| Operates on internal artifacts → . Structurally identical to but for internal sources. The two wikis ( and ) can cross-link but don't merge. |
| Can cite wiki pages in research artifacts. Can optionally run on material as a pre-step to writing a research artifact. |
| Can promote wiki-page concepts that have crystallized into reusable patterns into via its normal finding-registry flow. |
| Should learn to inject relevant pages alongside content when a session starts. |
| Phase 2 (Extract Learnings) can be informed by recent pages as supporting context. |
| Can query for past context on the domain being pre-mortem'd. |
| Can activate high-value wiki pages into MEMORY.md alongside promotions. |
Relationship to the AgentOps flywheel
The AgentOps flywheel compounds internal work knowledge (what we did, what we learned, what went wrong). The LLM Wiki compounds external reading knowledge (what we read, what others figured out, what the state of the art is).
Both flywheels feed each other:
- Wiki pages can be cited by research artifacts that feed the internal flywheel
- Internal learnings can reference wiki pages when explaining "why we adopted approach X"
- Findings can be enriched with wiki-sourced context
Design principle: external and internal knowledge live in separate trees (
wiki/ vs .agents/) so the provenance is always clear. The two trees cross-link; they don't merge.
Scheduling (not part of this skill, but referenced)
The Karpathy pattern works best when the skill runs on a schedule, not just on-demand. The proposed 3-tier model (from the community implementations):
- Tier 1 — always on, cheap local LLM (e.g., Gemma 4 26B A4B on a consumer GPU). Nightly ingest of
, draft generation, orphan detection, lint.raw/ - Tier 2 — on-demand expensive expert (Claude / Codex / equivalent). Weekly review of drafts, synthesis, promotion to authored content.
- Tier 3 — human. Weekly approval of promotions to long-term memory / authored content.
See
references/architecture.md for the full tier model and scheduling recommendations. The skill is tier-agnostic; the host project wires up the scheduler.
Open questions for council review
- Should the wiki layout (
,raw/
) live at project root, or underwiki/
? Proposal recommendation: project root, to keep external knowledge visibly distinct from internal work..agents/wiki/ - Does this overlap with
enough that the two should merge? Proposal recommendation: no — keep them separate and document the split.skills/compile - Should the 3-tier model be baked into the skill via a
flag, or left as convention? Proposal recommendation:--tier
flag with Tier 2 as default.--tier - Should
also seedinit
andSOUL.md
, or leave them optional? Proposal recommendation: seed as stubs with instructions.CRITICAL_FACTS.md - What's the right output contract? Post-mortem uses
; shouldcouncil/schemas/verdict.json
have its own output schema for ingest/query/lint results? Proposal recommendation: yes, shape TBD by council.llm-wiki
References
— the research artifact that motivated this skill.agents/research/2026-04-11-karpathy-llm-wiki-integration.md- references/architecture.md — full design rationale, tier model, interop details, anti-patterns
- references/research.md — external-source research summary and synthesis
- Karpathy's original LLM Wiki gist (April 2026)
- Community implementations: NicholasSpisak/second-brain, eugeniughelbur/obsidian-second-brain
See Also
— the internal-artifact compiler (structurally identical pattern, different source)skills/compile/SKILL.md
— research artifact authoringskills/research/SKILL.md
— mining knowledge from transcriptsskills/forge/SKILL.md
— context injection at session startskills/inject/SKILL.md
— the six-phase knowledge flywheel this skill extends externallyskills/post-mortem/SKILL.md
Proposal status: OPEN. This SKILL.md describes the intended behavior but there is no implementation yet. Council review (via
$pre-mortem --preset=product) should validate the design before any code is written. If accepted, the next step is to implement the ingest and query phases first (ship them as experimental), then lint and promote once the first two are validated.