Skip to content

AI Doc GeneratorMulti-Agent Documentation System

Orchestrate AI agents to transform sources into professional LaTeX documents

System Architecture

The documentation generation system uses a hierarchical multi-agent architecture where Claude Opus serves as the orchestrator, delegating tasks to specialized Sonnet agents that work in parallel.

Workflow Overview

6
Workflow Phases
3+
Parallel Agents
3
External AI Tools
150+
Pages Output

Technology Stack

AI Development Tools

ToolRoleModel
Claude CodePrimary orchestration & writingOpus (orchestrator), Sonnet (agents)
OpenCodeAlternative multi-provider interfaceConfigurable

External AI Services

ServicePurposeOutput
NotebookLMSource document synthesisStructured summaries, cross-references
PerplexityCurrent statistics & trendsMarket data, recent developments
Scopus AIAcademic paper searchBibTeX citations, peer-reviewed sources

Output Stack

ComponentTechnology
Document FormatLaTeX with BibLaTeX
Build Systempdflatex + biber
Version ControlGit
DocumentationVitePress

Agent Hierarchy

Orchestrator

Model: Claude Opus

Role: Controls workflow, merges context, delegates tasks, makes decisions

Tasks:

  • Initial planning & structure
  • Context aggregation
  • Quality decisions
  • Final assembly

Worker Agents

Model: Claude Sonnet

Role: Execute parallel tasks efficiently

Tasks:

  • Source document reading
  • Chapter writing
  • Code examples
  • Table generation

Review Agents

Model: Claude Sonnet/Opus

Role: Quality assurance & feedback

Tasks:

  • Style compliance check
  • Technical accuracy
  • Citation verification
  • Improvement suggestions

Quick Start

bash
# Clone template
git clone https://github.com/your-repo/ai-doc-template.git
cd ai-doc-template

# Verify installation
./scripts/verify-setup.sh
bash
# Copy source documents
cp ~/research/*.pdf sources/

# Sources will be analyzed by parallel agents
bash
# Launch Claude Code with Opus
claude

# The orchestrator will guide the process
bash
# Compile LaTeX to PDF
./scripts/compile.sh

# Output: latex/document.pdf

Detailed Workflow

Phase 1: Source Collection

Collect all source documents into the sources/ directory. The system supports:

  • PDF documents (theses, reports, papers)
  • Word documents (DOCX)
  • Text files and notes

Phase 2: Parallel Source Analysis

The orchestrator spawns multiple Sonnet agents to read sources simultaneously:

Opus → spawn Agent1 → read sources/thesis1.pdf
     → spawn Agent2 → read sources/thesis2.pdf
     → spawn Agent3 → read sources/report.docx

[All agents work in parallel]

Agent1 → summary → Opus
Agent2 → summary → Opus  (Context Merge)
Agent3 → summary → Opus

Phase 3: External Research

Based on identified gaps, the orchestrator generates prompts for external AI tools:

ToolInputOutput
NotebookLMUploaded source PDFsCross-referenced synthesis
PerplexityGenerated research promptCurrent statistics, trends
Scopus AIAcademic search queriesBibTeX citations

Phase 4: Document Planning

With full context, Opus creates:

  • Document structure with chapter assignments
  • Page budgets per chapter
  • Source-to-chapter mapping
  • Style guidelines for consistency

Phase 5: Parallel Chapter Writing

Writer agents receive specific assignments and work simultaneously:

Chapter assignments:
├── Agent1 → 01-introduction.tex (4 pages)
├── Agent2 → 02-background.tex (8 pages)
├── Agent3 → 03-methodology.tex (10 pages)
├── Agent4 → 04-implementation.tex (12 pages)
└── Agent5 → 05-results.tex (8 pages)

Each agent receives:
- Relevant source excerpts
- Research data
- Style guidelines
- Page budget
- Chapter template

Phase 6: Review & Build

The review loop ensures quality:

Next Steps

Multi-Agent Documentation Generation System