Structure
βββ AGENTS.md # Schema & operational protocol for the LLM βββ index.md # Machine-readable catalog of all pages + 1-line summaries βββ log.md # Chronological append-only record of updates βββ raw/ # Immutable source documents (transcripts, docs, repos) βββ wiki/ # LLM-maintained synthesized knowledge base βββ entities/ # Teams, key stakeholders, critical vendors βββ systems/ # Architectures, services, data pipelines, tech stacks βββ processes/ # Deployments, incident response, sprint cadences βββ glossary/ # Internal jargon, acronyms, company metrics
High-Level Methodology
Implementing a Git-backed LLM Wiki requires treating documentation like a software codebase: version-controlled, modular, validated by CI, and maintained via automated agent loops.
ββββββββββββββββββββββββββββββββββββββββββ
β Human Layer β
β - Drops notes/transcripts into raw/ β
β - Reviews PRs & browses via Obsidian β
βββββββββββββββββββββ¬βββββββββββββββββββββ
β (git push / gh pr)
βΌ
βββββββββββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββββββ
β Agent Layer β β Git Remote β β Automation / CI β
β - Ingests raw files β βββββββ> β β <βββββββ β - Schema validation β
β - Cross-links wiki/ β (PR/push)β `main` + β β - Broken link checker β
β - Compiles index/log β β agent branchesβ β - llms.txt compiler β
βββββββββββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββββββ
1. Repository Topology & Branching Architecture
- Two-Tier Directory Structure:
raw/: Read-only inbox for source materials (meeting notes, Google Doc exports, Slack threads, architecture decision records).wiki/: Write-target for the LLM agent, containing small, atomic concept pages (entities/,systems/,processes/,glossary/).
- Branch Policy:
main: Protected branch representing the verified current state.agent/*: Ephemeral feature branches used by the LLM for multi-file updates and batch ingestions.- Direct pushes to
mainare reserved for human quick-edits or restricted service accounts running fast sync routines.
2. The Agent Operating Loop
- Ingestion Lifecycle:
- Human commits a source file to
raw/notes-2026-09.md. - Agent parses the source, references
index.md, and determines which entity, system, or process pages require creation or mutation. - Agent creates a branch, applies atomic edits across target files, and appends a log entry.
- Agent opens a Pull Request using the GitHub CLI (
gh pr create) containing a summary of touched pages.
- Human commits a source file to
- Autonomous Maintenance (Linting):
- Periodic scheduled jobs prompt the agent to inspect the graph for dead ends, unlinked references, orphan pages, and stale dates
3. Continuous Integration & Artifact Compilation
- Every push to
mainor open PR runs an automated CI pipeline:- Frontmatter Linting: Validates required YAML fields (
title,type,updated,sources). - Wikilink Integrity: Verifies all
[target-page](./target-page.md)links resolve to existing files. - AI Context Compilation: Aggregates core wiki pages into single-file machine contexts (
llms.txtandllms-full.txt) published to an internal endpoint or artifact registry for internal retrieval.
- Frontmatter Linting: Validates required YAML fields (
Obstacles, Risks & Pragmatic Solutions
1. Merge Conflicts on Central Registry Files
- Obstacle: If the agent and multiple team members try to append entries to a monolithic
index.mdorlog.md, Git line-level collisions will halt automated merges. - Solution:
- Fragmented Logs: Replace a single
log.mdwith a directory of small append-only records:log/YYYY-MM-DD-ingest-<topic>.md. - Dynamic Indexing: Stop manually editing
index.md. Use an automated CI script (or an Obsidian Dataview query) to recompile the index table dynamically from page frontmatter metadata on every build.
- Fragmented Logs: Replace a single
2. Local Desktop Sync Clashes (e.g., Obsidian Git)
- Obstacle: Team members running auto-sync plugins (like
obsidian-git) on a timer will encounter local rebasing failures if the agent pushes updates to the remote repository while local changes are uncommitted. - Solution:
- Configure
obsidian-gitto use Merge instead of Rebase as its pull strategy. Merge commits preserve dirty working states and allow standard text conflict resolution. - Educate the team to keep local notes in
raw/personal/or separate scratchpad folders, minimizing overlapping file locks inwiki/.
- Configure
3. Human Adoption Friction for Non-Git Users
- Obstacle: Product managers, operations leads, or researchers who do not use terminal Git or Markdown IDEs may avoid contributing or reading the documentation.
- Solution:
- Git-Backed Web UI: Deploy a zero-friction Git-backed CMS (such as Decap CMS or TinaCMS) or publish the repository as a static internal site via VitePress, MkDocs, or Docusaurus.
- Chat-Driven Ingestion: Allow users to drop documents or transcripts into a dedicated Slack channel hooked to a webhook/n8n pipeline, which commits the raw file into
raw/on their behalf.
4. Model Hallucinations & Knowledge Drift
- Obstacle: When generating wiki pages, the LLM may synthesize assumptions not present in the source material, contaminating the corporate single source of truth.
- Solution:
- Strict Grounding Rule in
AGENTS.md: Require that every assertion inwiki/cite its source file path directly in the frontmattersources:array or via Markdown footnotes ([^raw/file.md]). - Review Gate for Ingestions: Configure the agent to submit non-trivial changes via PRs with a
needs-reviewtag, allowing team leads to scan diffs before merging.
- Strict Grounding Rule in
5. Repository Bloat from Large Artifacts
- Obstacle: Team members dropping meeting video recordings, large slide decks, or massive raw logs directly into
raw/will cause the Git repository size to balloon, slowing down cloning and agent file-reading. - Solution:
- Implement
.gitignorerules for binary assets (*.mp4,*.zip,*.pdf). - For transcripts or audio, mandate pre-processing through an automated speech-to-text pipeline, committing only the resulting plain-text Markdown transcript into
raw/.
- Implement
Referrences
- HTML instead of MD https://ndoto-g.github.io/doc.html/documents/the-wiki-shape.doc.html