AI-Assisted Novel Creation Engine – A structured, step-by-step tool for long-form novel writing
- 🎯 Cost-efficient & high performance: A structured creative workflow avoids redundant generation and significantly reduces AI costs
- 📚 Multi-project management: Create multiple novels simultaneously with completely isolated data
- 🎨 Personalized configuration: Independent AI prompts per project; sci-fi, romance, and mystery each have their own style
- 🔄 Progressive creation: From a single-sentence idea to a complete novel through 7 clear steps
- 🌍 Complete world-building: Unified management of characters, locations, and items ensures narrative consistency
- 🤖 Intelligent experience: AI automatically analyzes themes, recommends genres, and generates multiple versions to choose from
git clone https://github.com/hahagood/MetaNovel-Engine.git
cd MetaNovel-Engine
pip install -r requirements.txtCopy .env.example to .env and enter your OpenRouter API key:
cp .env.example .env
# Edit .env and add: OPENROUTER_API_KEY=your_api_key_herepython meta_novel_cli.pyAfter launching, choose “Create New Project” and follow the 7-step workflow to begin your novel!
- Python 3.8 or higher (Python 3.11+ recommended for better httpx/asyncio performance)
- Virtual environment recommended:
python -m venv venv && source venv/bin/activateor. bin/activate - Dependencies installed via
pip install -r requirements.txt, includingopenai,httpx, andrich - Communicates with the OpenRouter API; ensure access to
https://openrouter.ai - Console-based UI only; no browser or GUI required
| Step | Feature | Purpose |
|---|---|---|
| 1️⃣ | Set Theme | Define the core one-sentence idea |
| 2️⃣ | Intelligent Theme Expansion | AI analyzes and recommends genres, generating multiple versions |
| 3️⃣ | World Building | Create characters, locations, and items |
| 4️⃣ | Story Outline | Write a 500–800 word story framework |
| 5️⃣ | Chapter Breakdown | Divide into 5–10 chapter outlines |
| 6️⃣ | Chapter Summaries | 300–500 word detailed summary per chapter |
| 7️⃣ | Generate Main Text | Generate 2,000–4,000 words per chapter |
Each step supports viewing, editing, and regeneration to ensure quality.
- Unlimited novel projects with complete data isolation
- Quickly switch between projects and continue writing
- Automatic backups to prevent data loss
- Independent prompt configuration per project
- Adjustable AI writing styles for different genres
- Support for custom AI models and parameters
- Smart theme analysis: AI recommends the most suitable genre
- Multi-version generation: Generates three different story concepts at once
- Forced user participation: Requires user intent to align AI output with expectations
- Modular architecture: Independent service modules for easy extension and maintenance
- Export single chapters, chapter ranges, or full novels
- Standardized metadata including title, export time, chapter info, and word count
- Flexible range input formats (e.g., 1-3, 1,3, 1 3)
- Accurate word counts with automatic cleanup of AI metadata
- Clean output containing only story content
- Clear, user-friendly interface
- AI model switching
- Network proxy configuration
- Intelligent retry settings
meta_novel_cli.py: CLI entry point and main navigationworkflow_ui.py: Business logic and UI for the 7-step workflowproject_manager.py/project_data_manager.py: Multi-project management and persistencedata_manager.py: Unified JSON read/write and caching layerllm_service.py: OpenRouter API interaction and retry logicentity_manager.py,theme_paragraph_service.py: Entity management and theme enhancement
.env: Stores API key, proxy, and default model settings- Global config stored in system app data directory
- Project data stored in
<project>/meta/with backups inmeta_backup/ prompts.jsonsupports per-project overrides- Exports written to
exports/by default
- Unified retry logic with exponential backoff and jitter
- Multi-layer JSON fallback parsing
- Automatic fallback when Canon Bible generation fails
- Auto-completion of required config fields
- Entity name consistency enforcement
- Activate virtual environment:
. bin/activate - Run single test:
python -m pytest tests/test_entity_manager.py - Run full test suite:
python -m pytest tests
Q: What API key do I need?
A: An OpenRouter API key. Register at OpenRouter and add it to .env.
Q: How do I switch AI models?
A: Main menu → System Settings → AI Model Management.
Q: How do I configure a proxy?
A: Edit .env and set HTTP_PROXY and HTTPS_PROXY.
Q: Can I customize AI prompts?
A: Yes, via Prompts Template Management in system settings.
Q: How do I export my novel?
A: Use Export Novel in the content generation menu.
This project is released under the MIT License.
Let AI become your best creative partner! ✨