voocel/ainovel-cli
✨多agent实现全自动AI小说生成
What it solves
ainovel-cli is an automated engine for writing long-form novels. It eliminates the need for constant manual intervention by coordinating multiple AI agents to handle everything from initial premise and outlining to drafting and editing, ensuring consistency and narrative flow across hundreds of chapters.
How it works
The system uses a "deterministic engine + multi-agent collaboration" architecture. A central Engine manages the state and routes tasks to specialized agents based on a decision table, while an Arbiter handles semantic judgments.
Agents:
- Architect: Creates the premise, outline, character profiles, and world rules.
- Writer: Handles the conceptualization, drafting, and self-review of individual chapters.
- Writer's Workflow: Each chapter follows a strict sequence: loading context, reading previous text, planning the chapter, drafting, checking consistency, and committing the final version.
- Editor: Reviews chapters based on seven quality dimensions (e.g., consistency, pacing, narrative coherence) and provides evidence-based feedback.
- Arbiter: A lightweight function for structured decision-making (e.g., selecting a planner or handling user interventions).
Long-form Management: To avoid "hollow" outlines in very long novels, it uses "Compass" (long-term direction) and "Rolling Planning" (expanding detailed chapters only for current and near-future arcs).
Context Management: It employs a three-level summary system (Volume $\rightarrow$ Arc $\rightarrow$ Chapter) and an adaptive compression pipeline to maintain continuity over 500+ chapters.
User Intervention: Users can inject modification requests in real-time without pausing the system; the engine evaluates the impact and rewrites affected chapters.
Who it’s for
Authors and creators who want to automate the production of long-form fiction, particularly in genres like web novels, and those who want a high degree of control over style and consistency without manually prompting every chapter.
Highlights
- Deterministic State Machine: The main loop is handled by code, not LLMs, making the behavior predictable and testable.
- Rolling Planning: Prevents narrative drift by expanding the story arc by arc rather than planning everything upfront.
- ** uma-level Checkpoints**: Supports precise recovery from crashes at the step level (plan/draft/check/commit).
- Anti-AI Tone: Includes a built-in baseline to avoid common AI clichés and allows users to add custom rules in plain language.
- Semantic Import: Can "compile" existing novels into the system to continue writing them.
- Multi-LLM Support: Compatible with various providers including OpenRouter, Anthropic, Gemini, OpenAI, and local Ollama instances.