NovelForge AI is a multi-agent long-form fiction production system. The repository includes a FastAPI backend, a Next.js frontend, and an engineered workflow for planning, chapter generation, scheduling, and style guidance.
中文文档请见 README_CN.md.
NovelForge AI focuses on turning long-form fiction production into a structured, repeatable workflow for planning, drafting, reviewing, and style adaptation.
- Production-oriented multi-agent writing workflow
- Author template and style guidance workflow
- Open-source-safe repository boundaries for data, models, and secrets
- Create, list, export, and delete novel projects.
- Create chapters, run scheduling workflows, track status, and retry or roll back work.
- Maintain an author style template library and recommendation flow.
- Provide chapter QA checks, graph views, and progress tracking.
- Support DashScope cloud models.
- Backend: FastAPI, Pydantic, Loguru
- Frontend: Next.js 16, React 19, TypeScript
- LLM: DashScope (required)
- Retrieval and style indexing: txtai, sentence-transformers (optional)
.
├── src/ # FastAPI services, scheduler, and core business logic
├── frontend/ # Next.js frontend
├── scripts/ # Startup helpers, public sample data, and utility scripts
├── tests/ # Python tests
├── data/ # Local data directory (public release should only keep safe examples)
├── requirements.txt # Python dependencies and optional enhancement notes
└── .env.example # Backend environment template
- Python 3.11+
- Node.js 20+
- npm 10+
- DashScope API key
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtIf you want style indexing enhancements, install the optional packages:
pip install txtai sentence-transformerscd frontend
npm ci
cd ..Copy the root template and fill in your own secrets:
cp .env.example .envThe root .env file is read by the backend and supports the following settings:
DASHSCOPE_API_KEY: requiredDASHSCOPE_MODEL: optional, defaultqwen3-maxDASHSCOPE_ENABLE_THINKING: optional thinking mode toggleWRITING_ENV: optional runtime profile (dev,prod, ortest)BACKEND_HOST/BACKEND_PORT/BACKEND_RELOAD: backend bind and reload settingsFRONTEND_HOST/FRONTEND_PORT: used by local helpers and default inferenceCORS_ALLOW_ORIGINS: comma-separated backend CORS allow list The frontend supports the following optional environment variables infrontend/.env.local:
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_API_CANDIDATES=http://127.0.0.1:8000,http://localhost:8001
NEXT_PUBLIC_API_DISCOVERY=true
NEXT_PUBLIC_API_DISCOVERY_PORTS=8000,8001source .venv/bin/activate
python -m uvicorn src.main:app --host 127.0.0.1 --port 8000 --reloadAfter startup, you can access:
- API root:
http://localhost:8000/ - OpenAPI docs:
http://localhost:8000/docs
cd frontend
npm run dev -- -p 3000Open http://localhost:3000 in your browser.
The repository includes scripts/start_services.sh. By default it only checks for occupied ports and prints guidance. It does not kill existing processes unless KILL_EXISTING_SERVICES=true is explicitly set.
Example:
BACKEND_HOST=127.0.0.1 FRONTEND_HOST=127.0.0.1 ./scripts/start_services.shIf you hit a port conflict, you can switch ports directly:
BACKEND_PORT=8010 FRONTEND_PORT=3010 ./scripts/start_services.shrequirements.txt is structured as core runtime dependencies plus optional enhancement notes.
- Core runtime dependencies: enough to start the FastAPI service, call DashScope, and use the standard API flow.
- Optional enhancements: only needed for vector indexing and style retrieval workflows.
- Test dependencies: used by contributors running
pytest.
At minimum, run:
source .venv/bin/activate
pytestFor a smoke-style API verification run:
python src/smoke_test.pyNote: src/smoke_test.py starts services and hits generation endpoints, so it requires valid model settings and credentials.
For the public release, keep the following boundaries:
- Do not commit real
.envfiles, cloud credentials, or account secrets. - Do not commit private corpora, copyrighted source text, or runtime business data.
- Do not commit local model weights, index caches, or training artifacts.
- Keep only minimal public-safe sample data. All private data should be prepared locally by the user.
If you need private reference text, style DNA files, indexes, or local models, place them locally and ensure they stay ignored by Git.
This open-source edition no longer provides any external-site novel crawling capability. Reference text should come from user-managed local data or the public-safe sample generated by scripts/download_reference_novel.py.
Check that the root .env exists and contains a valid DASHSCOPE_API_KEY.
Check the following first:
- Whether the backend is actually running on
8000or8001 - Whether
NEXT_PUBLIC_API_BASE_URLis explicitly set infrontend/.env.local - Whether the browser can open
http://localhost:8000/openapi.json
Contributions via Issues and Pull Requests are welcome. Please read CONTRIBUTING.md before submitting changes.
This project is released under the MIT License. See LICENSE for details.