graph TD
A[User Input: Title, Vague Sections, Keywords] --> B{Research Agent: ResearchConductor}
B --> C[#181 - Research Topic Or Keyword Deeply]
C --> D[#185 - Brainstorm Most Relevant Domains/Websites]
D --> E[Select Top 3 URLs for Each Keyword]
E --> F[Crawl Content from Selected URLs using BeautifulSoup]
F --> G[Summarize Crawled Content using Text Summarization API or Library]
G --> H[Store Search Queries, Selected URLs, Crawled Content, and Summaries in JSON Object]
H --> I{Content Structuring Agent: ContentStructurer}
I --> J[#238 - Code Interpreter: Analyze Summaries, Decide on 10 Specific Sections, Create Structured Outline]
J --> K[Store Section Titles and Structured Outline in JSON Object]
K --> L{Content Generation Agent: ContentCreator}
L --> M[#177 - Write Text Or Copy From Researched Text for Each Section]
M --> N[#169 - Create Dalle Image Rectangle for Each Section]
N --> O[Store Generated Content for Each Section in Plain Text Files]
O --> P[Store Generated Images with Respective Section Titles]
P --> Q{PDF Generation Agent: PDFGenerator}
Q --> R[#227 - Format Up To 4000 Characters Of Text Into Pretty HTML for Each Section, Incorporate Images]
R --> S[Create Title Page and Table of Contents in HTML Format]
S --> T[Concatenate Formatted Content, Title Page, and Table of Contents into Single HTML File]
T --> U[#203 - Convert HTML URL To PDF]
U --> V[Apply Necessary Styling for Visually Appealing and Professional-Looking Ebook]
V --> W[Save Final PDF File]