How alexeygrigorev/ai-book-generator works
AI Book Generator turns a user’s topic and feedback into a structured book plan, generates book content through either section-based or chapter-based execution, and supports audio and publishing outputs. The graph includes README-documented EPUB, KDP, and audio-conversion capabilities even though those implementations were not sampled; their links reflect documented responsibilities, not inspected call details.
Main entry points: books Book files · streamlit_app.py Planning UI · book_generator/plan.py Section planner · chapter_based/plan.py Chapter planner
Components 20
Planning
- Planning UI
ui/streamlit_app.py - Section planner
book_generator/plan.py - Chapter planner
chapter_based/plan.py - Plan models
book_generator/models.py - Chapter models
chapter_based/models.py
Book generation
- Book files
books - Section writer
book_generator/execute.py - Chapter writer
chapter_based/execute.py - AI client and costs
book_generator/utils.py
Audio
- Audio runner
scripts/run_tts.py - Speech generation
book_generator/tts.py - Batch speech
book_generator/tts_batch.py - AWS S3
- WAV to MP3
scripts/convert_wav_to_mp3.py - Local WAV files
Publishing
- EPUB export
scripts/convert_to_ebook.py - KDP interior
scripts/create_kdp_interior.py - KDP cover
scripts/create_kdp_cover.py
Other components
- Book author
- Gemini API
Connections 26
- Book author → Planning UI: configures topic
- Planning UI → Section planner: streams and refines
- Planning UI → Gemini API: requests plans
- Planning UI → Book files: saves structured plan
- Section planner → Gemini API: generates plan
- Section planner → Plan models: structures plan
- Section planner → Book files: writes YAML plan
- Chapter planner → Gemini API: generates plan
- Chapter planner → Chapter models: structures plan
- Chapter planner → Book files: writes YAML plan
- Section writer → Book files: reads plan and writes content
- Section writer → AI client and costs: tracks generation cost
- Chapter writer → Book files: reads plan and writes content
- Chapter writer → AI client and costs: tracks generation cost
- AI client and costs → Gemini API: creates AI client
- Audio runner → Speech generation: runs speech generation
- Audio runner → Book files: reads book markdown
- Speech generation → Gemini API: generates audio
- Speech generation → AWS S3: checks and uploads audio
- Batch speech → Book files: reads book markdown
- Batch speech → Gemini API: submits batch requests
- Batch speech → Local WAV files: writes local WAV files
- WAV to MP3 → AWS S3: converts stored audio
- EPUB export → Book files: reads book content
- KDP interior → Book files: reads book content
- KDP cover → Book files: reads cover inputs