YILING0013/AI_NovelGenerator
使用ai生成多章节的长篇小说,自动衔接上下文、伏笔
AI Novel Generator – What It Is
AI Novel Generator is a self‑hosted web application that helps writers plan and write fiction with the assistance of large language models. It combines a Next.js front‑end, a FastAPI back‑end, and MongoDB for storage. Users supply their own LLM API key (OpenAI, Gemini, Claude, DeepSeek, etc.) and the app builds prompts, sends them to the model, and returns generated text that can be edited, saved, and version‑controlled.
Core Features (as described in the README)
| Area | What the app does |
|---|---|
| Novel Management | Create a “bookshelf” of projects; store title, core idea, plot, world‑building, style, POV, length, and more. Fields can be edited manually or filled by AI. |
| Snowflake‑style Planning | Guides the writer from a high‑level story core down through volumes → arcs → scenes → chapter plans → prose. Each level has its own editable fields (objectives, beats, characters, etc.). |
| Chapter Editing | Integrated editor showing the chapter plan, manuscript, revision history, and a “chapter record” that checks character psychology, relationships, world rules, etc. |
| Entity & Relationship Management | Dedicated cards for characters, factions, locations, items, world rules, foreshadowing clues, and a visual relationship graph. |
| AI Workflow Designer | Node‑based canvas where each node can read data, prepare context, call an LLM, merge results, or output a candidate. Built‑in workflows cover novel creation, character generation, volume planning, scene/arc generation, prose drafting, and post‑chapter checks. Users can copy, edit, and chain nodes to build custom pipelines. |
| Model Integration | Adapters for OpenAI, DeepSeek, Gemini, Claude and compatible endpoints. Users configure API key, endpoint URL, model name, and generation parameters per node. |
| Responsive UI | Works on desktop and mobile, supports light/dark themes, and English/Chinese interfaces. |
How It Works (High‑level flow)
- Configure a model in Settings (provide API key, endpoint, model name).
- Create a novel project – enter a brief idea and target length.
- Run the built‑in Snowflake workflow – the app prompts the model to expand the core idea into a full set of planning layers (volumes, arcs, scenes, etc.).
- Edit/confirm entities (characters, factions, locations) at each planning level.
- Generate chapter prose using a chapter‑plan node; the model receives the plan, relevant context, and any constraints you set.
- Edit the manuscript, view revision history, and accept the generated text.
- Post‑chapter checks automatically verify that world rules and character states remain consistent.
- Repeat for subsequent chapters until the novel is complete.
Installation & Running (Summarised)
- Prerequisites: Python 3.13/3.14, Node 20+, MongoDB replica set (Docker compose provided), optional Docker for the DB.
- Steps:
- Clone repo, set up a Python virtual environment, install
requirements.txt. cd frontend && npm cito install the UI.- Start a single‑node MongoDB replica set via
docker compose -f compose.mongodb.yaml up -dand runrs.initiate(...). - Copy
backend/config/config_default.yamltoconfig.yamland fill in the MongoDB URL. - Launch services – on Windows double‑click
start.bat(desktop launcher) or runpython main.pyfor the backend andnpm run startfor the front‑end.
- Clone repo, set up a Python virtual environment, install
- Access: UI at
http://127.0.0.1:3300, API docs athttp://127.0.0.1:8200/docs.
Who Might Use It
- Writers who want AI‑assisted brainstorming and drafting while keeping all data local.
- Indie developers or hobbyists exploring LLM‑driven content generation pipelines.
- Researchers studying human‑AI co‑creative workflows for narrative creation.
License
- Distributed under the GNU Affero General Public License v3.0.
Bottom Line
AI Novel Generator is a full‑stack, locally hosted tool that lets you structure a novel using the Snowflake method, manage characters and world details, and generate or revise prose via configurable LLM workflows. It’s a concrete example of AI‑augmented creative writing software rather than a simple demo or tutorial collection.
Related
- Project
- Project
- Project
- Project
- Project