The AutoGen Book Generator is an advanced AI-powered system that creates complete, structured books through collaborative AI agents. Designed for authors, educators, and content creators, it streamlines the book creation process while maintaining high-quality output.

- Multi-agent collaborative writing system
- Automated chapter generation with consistent formatting
- Intelligent world-building and setting management
- Context-aware character development
- Built-in validation and error handling
- Customizable templates for various genres
- Fiction Writing: Generate novels, short stories, and series
- Educational Content: Create textbooks and study guides
- Technical Documentation: Produce comprehensive manuals
- Content Marketing: Develop ebooks and whitepapers
- Personal Projects: Write memoirs, journals, or creative works
- Clone the repository:
git clone https://github.com/yourusername/autogen-book-generator.git
cd autogen-book-generator- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Start the generator using the quickstart script:
./quickstart.sh- The program will:
- List all available genres
- Prompt you to select a genre
- Display the selected configuration:
=== Book Generation Configuration ===
Selected Genre: [Your Selected Genre]
LLM Model: [Selected Model]- Follow the prompts to configure your book:
- Provide initial concepts or themes
- Set chapter count and length
- Press Enter to start generation
The system supports exporting books in different genres using the BOOK_GENRE environment variable. Here's how to use it:
- Set the BOOK_GENRE environment variable before running the generator:
export BOOK_GENRE=literary_fiction
python main.py- Available genre templates:
- fantasy_scifi
- historical_fiction
- literary_fiction
- romance
- thriller_mystery
- young_adult
- To list all available genres:
ls config_templates/genre/ | sed 's/.py//g'-
The system will automatically load the appropriate genre configuration and apply it to the book generation process.
-
You can verify the active genre in the startup output:
=== Book Generation Configuration ===
Selected Genre: literary_fiction
Writing Style: Standard
Narrative Style: Third PersonThe system uses multiple specialized agents:
- Story Planner: Creates high-level story arcs
- World Builder: Establishes consistent settings
- Memory Keeper: Tracks continuity and context
- Writer: Generates the actual prosea
- Editor: Reviews and improves content
- Outline Creator: Creates detailed chapter outlines
Customize the system through config.py:
- Set output directory
- Configure LLM parameters
- Adjust generation settings
- Enable/disable features
The system includes pre-configured genre templates located in config_templates/genre/.
To see all available genre templates:
- Navigate to the genre templates directory:
cd config_templates/genre/- List the files:
lsTo export a genre configuration for use:
- Open
config.py - Set the
genre_templateparameter to the desired genre file:
genre_template = "config_templates/genre/fantasy_scifi.py"- The system will automatically export this configuration when you run:
python main.pyTo change genres:
- Open
config.py - Update the
genre_templatepath to point to your desired genre - Save the file
- Restart the application:
python main.pyWhen you start the application, the console will display:
=== Book Generation Configuration ===
Selected Genre: [Genre Name]
Writing Style: [Style]
Narrative Style: [Narrative Style]Available genre templates:
- fantasy_scifi.py
- historical_fiction.py
- literary_fiction.py
- romance.py
- thriller_mystery.py
- young_adult.py
If the genre isn't being recognized:
- Ensure the path in
genre_templateis correct and points to an existing file - Verify the file has proper Python syntax and configuration
- Check for any errors in the console output
- Make sure you're running the latest version of the code
To create a custom genre template:
- Copy an existing template from
config_templates/genre/ - Modify the template parameters
- Save it with a new name in the same directory
- Update
config.pyto point to your new template
To contribute:
- Fork the repository
- Create a feature branch
- Install dev dependencies:
pip install -r requirements.txt- Make your changes
- Run tests:
pytest- Submit a pull request
The project includes:
- Unit tests
- Integration tests
- Monitoring tests
- Code coverage reporting
Run tests with:
pytest tests/ --cov=./ --cov-report=htmlMIT License - See LICENSE for details
- Built using Microsoft's AutoGen framework
- Inspired by collaborative writing systems