self-maintaining-wiki.md A developer describes a pattern for an AI agent that autonomously builds and maintains a persistent personal wiki from work artifacts and external sources. The agent handles filing, linking, summarizing, and deduplication while the human focuses on work and questions. The system uses three storage layers—capture inbox, curated notes, and index—plus a configuration file to turn a generic agent into a disciplined knowledge base maintainer. A pattern for an agent that captures, organizes, and maintains a personal knowledge base on its own. This is an idea file. It is meant to be handed to an agent platform Claude Code, Codex, OpenCode, or similar as a starting point. It describes the pattern, not a fixed implementation — the agent and the operator work out the concrete details together. Most of the knowledge produced while working with an agent evaporates into chat history: decisions and their rationale, hard-won fixes, reusable techniques, open threads to come back to. Plain retrieval systems upload files, retrieve chunks at query time don't help here either — they re-derive an answer from scratch on every question and accumulate nothing. This pattern is different. The agent builds and maintains a persistent wiki — a structured, interlinked set of markdown notes — out of two streams: the artifacts that surface while you work with it, and any external sources you choose to add. Knowledge is compiled once into durable notes and then kept current, rather than rediscovered per query. The cross-links are already in place, contradictions are already flagged, and the synthesis already reflects everything captured so far. The division of labor is the point. The agent owns the wiki: it does the filing, typing, linking, summarizing, deduplicating, and indexing — the bookkeeping that makes a knowledge base useful but that humans abandon. You do the work, supply the sources, and ask the questions. A common setup is the agent on one side and an Obsidian-style markdown editor on the other, so you can browse links and the graph while the agent edits. This is domain-independent. The same machinery serves personal tracking, long-running research, reading a book, team knowledge fed by meetings and threads, competitive analysis, course notes, or any context where knowledge accumulates over time and should be organized rather than scattered. Three storage layers plus one configuration file. Capture layer inbox . An append-only landing zone. Newly captured artifacts arrive here with provisional metadata and minimal processing. Writing here is cheap and never blocks, which keeps recall high. It is kept separate from the curated layer so half-formed captures never pollute the clean notes. If external sources are also ingested, keep the immutable originals in their own location — the inbox holds extracted notes, not the source files themselves. Curated layer the wiki . The clean layer the agent maintains: atomic, typed, domain-organized markdown notes that are interlinked. This is what a human browses. The agent creates pages, updates them as new material arrives, and keeps cross-references consistent. Index layer. Generated navigation: a content catalog manifest , maps of content, and a chronological log. This lets the agent and the human find things without scanning every note. The configuration file e.g. CLAUDE.md or AGENTS.md . The conventions and workflows: directory layout, the metadata schema, and how to capture, curate, answer, and lint. This is what turns a generic agent into a disciplined maintainer; it is co-evolved over time as conventions settle. An illustrative layout adapt freely : wiki/ inbox/ raw captures with provisional metadata review/ low-confidence captures awaiting a human decision notes/ curated, domain-organized notes