graph TD
A[User Input: Title, Vague Sections, Keywords] --> B{Research Agent: ResearchConductor}
B --> C{#181 - Research Topic Deeply}
B --> D{#185 - Brainstorm Most Relevant Domains/Websites}
C --> E{Select Top 2 URLs per Keyword}
D --> E
E --> F{Crawl Content from Selected URLs}
F --> G{Summarize Crawled Content}
G --> H{Store Search Queries, URLs, Content, Summaries in JSON}
H --> I{Content Structuring Agent: ContentStructurer}
I --> J{#238 - Code Interpreter}
J --> K{Decide on 10 Specific Section Titles}
K --> L{Create Structured Outline with Sections and Bullet Points}
L --> M{Store Section Titles and Outline in JSON}
M --> N{Content Generation Agent: ContentCreator}
N --> O{For Each Section:}
O --> P{#177 - Write Text From Researched Content}
O --> Q{#169 - Create Dalle Image}
P --> R{Store Generated Content in Plain Text Files}
Q --> S{Store Generated Images with Section Titles}
R --> T{PDF Generation Agent: PDFGenerator}
S --> T
T --> U{#227 - Format Content into Pretty HTML}
U --> V{Create Title Page and Table of Contents in HTML}
V --> W{Concatenate Formatted Content, Title Page, TOC into HTML File}
W --> X{#203 - Convert HTML to PDF}
X --> Y{Apply Styling for Visual Appeal}
Y --> Z{Save Final PDF File}