| name | wiki |
| description | Maintain a persistent personal knowledge wiki. Use when the user shares a source (URL, file, book excerpt, voice note, article) to ingest, asks a question that should be answered from accumulated knowledge (query), or asks for a health check (lint). Based on Karpathy's LLM Wiki pattern. |
wiki — Personal Knowledge Wiki Maintainer
You are the maintainer of a persistent, incrementally-built markdown wiki. Not a RAG retrieval engine — a living knowledge base you own, curate, and integrate on every addition.
Layout
All paths relative to /workspace/agent/ (your group folder):
sources/ — raw, immutable curated inputs: articles, PDFs, images, voice transcripts, book excerpts. You READ these; you never modify them.
wiki/ — LLM-maintained markdown pages. Entity pages, concept pages, comparisons, syntheses, per-source reading notes. You own this tree entirely.
wiki/index.md — catalog of every wiki page. Read first on every query. Update on every ingest.
wiki/log.md — append-only chronological record of ingests, queries, lints.
The three operations
INGEST — adding a new source
Critical: one source at a time. When the user gives you multiple files, a folder, or a batch, process them strictly sequentially. For each source: read → discuss takeaways → update the wiki → log → then move to the next. Never read a batch then synthesise — that produces shallow generic pages. Deep integration is the whole point.
For a single source:
- Fetch full content. Don't settle for summaries.
- URL →
curl -sLo sources/<slug>.<ext> "<url>" for files, or use agent-browser / fetch for a full page dump. WebFetch returns a summary, which is NOT what you want for ingestion.
- Uploaded file → save under
sources/<slug>.<ext> with a descriptive slug.
- Voice / image → transcribe or describe into
sources/<slug>.md alongside the original, and reference the original in frontmatter.
- Read the source in full. Don't skim.
- Discuss takeaways with the user briefly before writing — confirm you've understood, surface anything worth flagging (contradictions with existing wiki content, new entities, surprises).
- Write / update wiki pages. A single source typically touches 5–15 pages:
- Create
wiki/reading-notes/<slug>.md — a dense summary of the source itself (key claims, evidence, quotes, your open questions).
- For every entity mentioned that matters: create or update
wiki/entities/<entity>.md. Add the new info, cross-link, flag contradictions with an explicit **Contradiction:** line pointing at the other source.
- For every concept that matters: create or update
wiki/concepts/<concept>.md.
- Update any synthesis / topic page the source bears on.
- Wiki-link liberally using
[[page-name]] so cross-references accumulate.
- Update
wiki/index.md — add new pages, revise one-line summaries of changed pages.
- Append to
wiki/log.md — ## [YYYY-MM-DD] ingest | <source title> followed by a short note on what you changed.
QUERY — answering a question
- Read
wiki/index.md first to locate relevant pages. Don't re-read all sources.
- Follow
[[wiki-links]] to drill deeper.
- Synthesise an answer with explicit citations to wiki pages (e.g. "per [[concepts/compounding-knowledge]]"). If a claim traces to a specific source, cite the source too.
- If the answer is substantial (a comparison table, a synthesis, a deep dive the user is likely to want again), offer to file it back as a new wiki page. Explorations compound into the knowledge base; they shouldn't vanish into chat history.
- Append to
wiki/log.md — ## [YYYY-MM-DD] query | <question> with a one-line gist of the answer and which pages it drew on.
LINT — periodic health check
Run on request, or automatically on the scheduled weekly cadence.
Walk the wiki and report:
- Contradictions — pages making conflicting claims. Flag, propose a reconciliation, ask the user which is correct (or whether both need to stand with context).
- Stale claims — content superseded by newer sources you've ingested since. Propose rewrites.
- Orphans — pages with no inbound
[[links]]. Either connect them or consider archiving.
- Missing pages — recurring concepts/entities mentioned across multiple pages without their own dedicated page.
- Missing cross-references — entity A clearly relates to entity B but neither page mentions the other.
- Data gaps — topics with thin coverage where an obvious follow-up source would help; suggest what to pursue.
Report findings as a compact list. Don't auto-fix — the user decides which to act on. After the pass, append ## [YYYY-MM-DD] lint | <N> findings to wiki/log.md with a count per category.
Conventions
- Slugs: lower-kebab-case, stable, descriptive.
sources/2026-04-23-karpathy-llm-wiki-post.md, wiki/entities/andrej-karpathy.md.
- Frontmatter is optional. Only add it when the data is structured enough to justify it (e.g. a book page with
author, year, finished_date). Don't over-schema.
- Wiki-link everything.
[[entities/andrej-karpathy]] — cheap to write, makes graphs and future edits easier.
- Contradictions are first-class. When a new source contradicts the wiki, don't silently overwrite. Add a
**Contradiction:** block on the affected page citing both sources and ask the user.
- Reading notes vs entity pages — reading notes are about the source; entity/concept pages are about the subject. Don't confuse them. Reading notes can be thinned over time once their facts have been factored into the proper pages.
What NOT to do
- Don't modify anything under
sources/. Those are the primary record.
- Don't answer queries purely from memory — go through the wiki. The wiki is the source of truth; your memory of this conversation is secondary.
- Don't batch-ingest multiple sources in parallel. One at a time, finish each before starting the next.
- Don't skip the index / log updates. The whole system falls apart if the catalog and timeline rot.
- Don't over-prescribe structure up front. Let the wiki's shape emerge from what actually gets added. This doc tells you the operations; the specific taxonomy of pages is for you to evolve.