The three-layer architecture is the safety boundary of an LLM Wiki. Do not let the agent freely edit original sources, and do not hide operating rules inside vague chat prompts.
Layer 1: immutable raw sources
raw/ holds originals: PDFs, markdown exports, transcripts, screenshots, CSVs, meeting notes, and clipped web pages. The agent may read this directory, but it should not modify or delete it. If a bad synthesis happens, the raw layer lets you rebuild the wiki from preserved evidence.
Layer 2: dynamic compiled wiki
wiki/ is the mutable output. It contains concept pages, source summaries, entity pages, syntheses, contradictions, and open questions. The agent may update this layer during ingest, query, and lint operations.
Layer 3: algorithmic schema
AGENTS.md, CLAUDE.md, or an equivalent root instruction file is the operating contract. It tells the agent which directories exist, which files are read-only, how pages are shaped, how links are written, and which checklist must be completed before a task is done.
| Layer | Write access | Primary job | Failure if mixed |
|---|---|---|---|
| raw/ | Human and import tools only | Preserve ground truth | AI edits can destroy the evidence needed to recover. |
| wiki/ | Agent may edit under schema rules | Maintain synthesized knowledge | The graph becomes a pile of notes with no predictable shape. |
| AGENTS.md | Human-reviewed edits | Define agent behavior | The model improvises file paths, metadata, and safety rules. |
Recommended folder tree
raw/
papers/
web/
meetings/
attachments/
wiki/
index.md
log.md
concepts/
entities/
sources/
syntheses/
contradictions.md
open-questions.md
AGENTS.md
Permission checklist
- Raw files are read-only during agent operations.
- Every compiled page has frontmatter, source status, and related links.
- Every ingest updates wiki/index.md and wiki/log.md.
- Every contradiction is preserved until a human resolves it.
- Every destructive cleanup requires explicit human approval.