Ingest a source document or URL into the LLM wiki. Triggers when the user provides a file path like "raw/...", pastes a URL, or says "ingest", "add to the wiki", "process this", "read this into the wiki". Creates source, entity, and concept pages; updates index, overview, and log.
The core write operation. Every ingest ripples across the wiki — it doesn't just create a new page, it updates every related page, flags contradictions, and revises the living overview.
See wiki/references/schema.md for page formats, frontmatter spec, citation rules, and cross-linking conventions.
You MUST NOT write content files to the root wiki/ directory. Use the following hierarchy:
wiki/sources/ — Ingested source files.wiki/entities/ — Services, projects, people.wiki/concepts/ — Patterns, architectural pillars.wiki/syntheses/ — Query results.wiki/drafts/ — Speculative content.Read wiki/index.md and wiki/overview.md to understand the current wiki state before touching anything.
File path (e.g. raw/papers/llama2.md): use #tool:read/readFile.
URL: use #tool:web/fetch to retrieve full content, then save a clean markdown copy to raw/<category>/<slug>.md. Ask the user which category fits (raw/articles/, raw/papers/, raw/notes/).
Before writing any files, show the plan and wait for confirmation:
📋 Ingest plan for: [Source Title]
New pages:
- wiki/sources/slug.md
- wiki/entities/Name.md (new)
- wiki/concepts/Name.md (new)
Pages to update:
- wiki/entities/ExistingName.md (add appearance)
Contradictions detected: [none | list]
Proceed? (say "yes" or trim the list)
Extract from the source:
Create wiki/sources/<slug>.md using the Source page format in references/schema.md.
Every Key Claim must have a [raw/path/file.md:LINE] citation. No exceptions.
For each significant entity:
wiki/entities/<n>.md.For each significant concept:
wiki/concepts/<n>.md. For complex concepts, include a Mermaid diagram.[[NewSourceSlug]] to any existing pages that cover topics this source touches.Revise wiki/overview.md to reflect how this source changes the current synthesis. Rewrite relevant sections — don't just append.
Add all new pages to wiki/index.md under the right sections. Update the page count and date.
## [YYYY-MM-DD HH:MM] ingest | <Title>
- Files created: wiki/sources/<slug>.md, [entity/concept pages]
- Files updated: wiki/index.md, wiki/overview.md, [others]
- Contradictions flagged: [none | list]
If you're inferring a relationship not explicitly stated in the source, write it to wiki/drafts/<slug>.md and surface it to the user — don't assert it as verified.