← Back to Pipelines

Subagent Architecture

How Pipeline Agents and File Agents collaborate to produce the entire content tree

01

Two-Level Model

Content generation follows a two-tier architecture. At the upper level, Pipeline Agents manage the full depth path for an audience. At the lower level, File Agents produce individual HTML files per level.

Hierarchical Architecture

Orchestrator (Main Process)
Pipeline Agent: Developer
File Agent: L0
File Agent: L1-A
File Agent: L1-B
File Agent: L2-*
File Agent: L3-*
Pipeline Agent: Manager
File Agent: L0
File Agent: L1-*
File Agent: L2-*
🎯
Pipeline Agent
1 per audience. Manages the complete depth path: L0 → L1 → L2 → L3. Knows the curriculum, audience profile, and naming convention. Delegates file creation to File Agents.
1 : Audience
📄
File Agent
1 per HTML file. Receives all metadata from the Pipeline Agent and creates exactly one file. Knows only its own context — no sibling files, no full curriculum.
1 : File

Why two levels? A single agent creating all files for all audiences would exceed the context window. The two-tier architecture keeps context focused per agent: the Pipeline Agent thinks in structure, the File Agent thinks in content.

02

Pipeline Agent Prompt

A Pipeline Agent receives a structured prompt containing everything it needs — but nothing more. Here is the prompt template structure in detail.

## PIPELINE AGENT PROMPT TEMPLATE
## Generated by the orchestrator per audience

AUDIENCE:
  id:       "dev"
  label_de: "Entwickler"
  label_en: "Developer"
  icon:     "🔧"
  suffix:   "_dev"

CURRICULUM:
  L0:  "index_dev_{lang}.html"           # 1 file
  L1:  [ "pipelines", "design-system",    # 5 files
        "templates", "output-logic",
        "quality" ]
  L2:  [ { parent: "pipelines",          # 5 files each
          children: ["subagent-arch", ...] },
        ... ]
  L3:  [ { parent: "subagent-arch",      # only HS ≥ 8
          children: ["pipeline-prompts"] },
        ... ]

FOUNDATION_REF:
  "Use the CSS/JS foundation from the L0 file.
   All variables, classes, patterns are defined there."

NAMING_CONVENTION:
  "{topic}_{suffix}_{lang}.html"
  # Example: subagent-architecture_dev_en.html

EXECUTION_ORDER:
  1. Generate L0 (DE + EN)
  2. Generate all L1 (DE + EN per topic)
  3. Generate all L2 (DE + EN per topic)
  4. Generate L3 only for topics with HS ≥ 8

What the Pipeline Agent receives:

Audience Profile — ID, labels (DE/EN), emoji icon, and filename suffix. This tells the agent who it writes for and how files are named.

Curriculum — The complete topic structure across all four levels. Per level, the list of topics with parent-child relationships.

Foundation Reference — Points to the CSS/JS foundation from its own L0 file. No foreign pipelines.

Naming Convention — The pattern for filenames: topic_suffix_language.html

Execution Order — L0 first, then L1, L2, L3. Depth is only generated when HS score ≥ 8.

Important: The Pipeline Agent receives the foundation reference only for its own pipeline. It knows neither the CSS variables of other audiences nor their curriculum structure. Each pipeline is an isolated unit.

03

File Agent Prompt

The File Agent receives a precise assignment from the Pipeline Agent for exactly one file. Everything it needs is in the prompt — it makes no assumptions.

## FILE AGENT PROMPT TEMPLATE
## Generated by the Pipeline Agent per file

FILE:
  filename:    "subagent-architecture_dev_en.html"
  audience:    "dev"  # Developer
  language:    "en"
  level:       2
  theme:       "Subagent Architecture"
  hs_score:    9       # Has L3 deep dive

CONTENT_DESCRIPTION:
  "4 sections: Two-Level Model, Pipeline Agent Prompt,
   File Agent Prompt, Practical Recommendations. Hierarchy
   diagram in section 1. Code toggles in sections 2 and 3."

LINK_TARGETS:
  breadcrumb_l0:  "../index_en.html"
  breadcrumb_l1:  "../l1/pipelines_dev_en.html"
  lang_switch:    "subagent-architektur_dev_de.html"
  deep_dive_l3:   "../l3/pipeline-agent-prompts_dev_en.html"
  siblings:       [ "topic-01", "topic-02",
                     "topic-03 (CURRENT)",
                     "topic-04", "topic-05" ]

CONSTRAINTS:
  - WCAG AA contrast on all elements
  - No white on light backgrounds
  - No level labels in titles
  - CSS/JS foundation inline (no external imports)
  - min-height: 100dvh per module
  - Alternating backgrounds

What the File Agent receives:

File Metadata — Filename, audience, language, level, theme, and HS score. The HS score determines whether a deep-dive link to L3 is included (≥ 8).

Content Description — Summary of sections, visualization types, special patterns (code toggles, diagrams, tables).

Link Targets — All relative paths: breadcrumb targets, language switch, deep-dive target, sibling navigation. The File Agent doesn't need to compute paths.

Constraints — Non-negotiable rules: WCAG AA, no forbidden color combinations, module pattern compliance.

FieldTypeSource
filenameStringNaming convention + curriculum
audienceEnumAudience profile
language"de" | "en"Always paired: DE + EN
level0–3Position in curriculum
themeStringCurriculum entry
hs_score1–10Curriculum (computed)
link_targetsObjectPipeline Agent computes
constraintsArrayGlobal rules (fixed)
04

Practical Recommendations

The architecture describes the ideal model. In practice there are constraints — especially around parallelization. Here are the proven strategies.

Sequential
One File Agent after another. Most reliable. Recommended for first generation or when context issues arise.
Safe
🔄
Max 2 Parallel
DE+EN pair simultaneously. Works well because language variants mirror the same content. No context conflict.
Recommended
⚠️
Full Parallel
All File Agents simultaneously. Sounds fast but is unreliable: context limits, race conditions, inconsistent results.
Risky

Recommended flow for a pipeline

📄
L0 DE
📄
L0 EN
📄📄
L1 DE+EN
📄📄
L2 DE+EN
📄📄
L3 DE+EN

DE+EN pairs parallel, level transitions sequential

Why not full parallelization? Three practical reasons: (1) Each File Agent needs context capacity, which is limited. (2) With more than 2 parallel agents, the error rate increases significantly. (3) L2 files must reference L1 files — those need to exist first. The architecture describes what is possible. Practice determines how it is executed.

✏️ Quick Check

What does a Pipeline Agent NOT receive?

The audience profile with ID, labels, and suffix
The complete curriculum with L0–L3 structure
The CSS/JS foundation of other pipelines
The naming convention for filenames
Deep Dive → L3 Pipeline Agent Prompts in Detail