Multi-Agent Content Generation System
Run the pipeline using:
python src/main.py
This repository implements a production-grade multi-agent content generation system that transforms structured product data into machine-readable JSON content pages.
This is not a content-writing or UI project. It is a systems engineering challenge focused on agent design, orchestration, validation, and execution integrity.
π― Problem Statement
Most AI-driven content systems rely on monolithic scripts or prompt-only pipelines that are:
Hard to extend
Difficult to audit
Prone to hidden hardcoding or fallback behavior
The goal of this project is to design a modular, agentic automation system that:
Operates via independent, single-responsibility agents
Communicates only through structured JSON
Produces validated, machine-readable outputs
Remains extensible, testable, and audit-proof
π§© Solution Overview
This project implements a multi-agent pipeline where:
Each agent performs exactly one responsibility
Agents never share global state
All inter-agent communication is explicit and structured
Content generation is driven by reusable logic blocks
Pages are assembled via a custom template engine
The pipeline is orchestrated as a typed DAG
Generated Outputs
π FAQ Page
π Product Description Page
π Comparison Page (vs fictional product)
All outputs are pure JSON and suitable for downstream automation.
ποΈ System Architecture π Execution Flow Raw Product Data β Product Parsing Agent β Question Generation Agent β Content Logic Block Agent β Template Engine Agent β Fictional Product Agent β Page Assembly Agent β Validated JSON Outputs β Documentation Agent
The pipeline is executed as a DAG, allowing independent agents to be parallelized where applicable.
π€ Agent Responsibilities 1οΈβ£ Product Parsing Agent
Normalizes raw input into a strict ProductModel
Enforces schema validation
Performs no content generation
2οΈβ£ Question Generation Agent
Generates 15+ categorized user questions
Categories include usage, safety, pricing, comparison, etc.
All questions are derived dynamically at runtime
Questions are answerable using only provided product data
3οΈβ£ Content Logic Block Agent
Defines reusable, atomic logic blocks such as:
extract_benefits
usage_instructions
safety_notes
ingredient_summary
price_context
comparison_logic
Logic blocks are deterministic and testable
No logic blocks generate free-form content independently
4οΈβ£ Template Engine Agent
Defines structured templates, not text blobs
Each template declares:
Required fields
Logic block dependencies
Schema constraints
Enforces validation and dependency resolution
Fails loudly on invalid or incomplete assemblies
5οΈβ£ Fictional Product Agent
Generates a fictional but comparable Product B
Uses the same ProductModel schema
Introduces no hidden advantages or external assumptions
6οΈβ£ Page Assembly Agent
Applies validated templates and logic blocks
Produces final JSON pages
Performs no schema enforcement (handled upstream)
7οΈβ£ Documentation Agent
Generates documentation dynamically from:
Agent definitions
Execution flow
Templates and logic blocks
No static or hardcoded documentation content
π Execution & Integrity Guarantees
This system enforces strict execution integrity:
β No hardcoded questions, FAQs, pages, or documentation
β No mock, wrapper, or fallback agents
β No deterministic placeholder outputs
β No silent degradation paths
All outputs are:
Generated dynamically by agent execution
Derived from runtime inputs
Validated against declared schemas
If any agent fails or required dependencies are unavailable, the pipeline fails loudly and produces no output artifacts.
π§ͺ Validation & Testing
The repository includes automated tests for:
Logic block correctness
Template schema enforcement
Question count and categorization constraints
End-to-end DAG execution
All final JSON artifacts are validated before being written to disk.
βοΈ Configuration & Orchestration
Model names, thresholds, and limits are centralized in configuration
Agents do not hardcode infrastructure or model choices
Pipeline state is typed and schema-validated
Execution is observable and debuggable via structured logging
π¦ Outputs
The system produces the following artifacts:
faq.json
product_page.json
comparison_page.json
docs/projectdocumentation.md
Each artifact is:
Schema-validated
Machine-readable
Generated via agent orchestration (not static files)
π« What This Project Is NOT
β Not a UI or frontend project
β Not a monolithic script
β Not prompt-only content generation
β Not dependent on external data or assumptions
This project emphasizes system correctness over superficial generation