由 Hermes Agent 实现的自主小说写作流程
An autonomous pipeline for writing, revising, typesetting, illustrating, and narrating a complete novel. From a seed concept to a print-ready PDF, ePub, audiobook, and landing page — all generated by AI agents.
Inspired by karpathy/autoresearch: the same modify-evaluate-keep/discard loop, applied to fiction.
First novel produced: The Second Son of the House of Bells —
19 chapters, 79,456 words.
See the autonovel/bells branch.
# Clone and setup
git clone <repo-url> && cd autonovel
cp .env.example .env # Add your API keys
# Install dependencies
uv sync
# Generate a seed concept (or write your own in seed.txt)
uv run python seed.py
# Run the full pipeline
uv run python run_pipeline.py --from-scratch
Build the world, characters, outline, voice, and canon from a seed concept.
Loop until foundation_score > 7.5.
Write chapters sequentially. Evaluate each one. Keep if score > 6.0,
retry if not. Forward progress over perfection.
Adversarial editing → apply cuts → reader panel → generate briefs → rewrite chapters. Plateau detection stops the loop when scores stabilize.
Send the full manuscript to Claude Opus for dual-persona review (literary critic + professor of fiction). Parse actionable items. Fix the top issues. Repeat until the reviewer runs out of major items.
Rebuild docs, typeset in LaTeX, generate art, produce audiobook scripts, build ePub, create landing page.
See PIPELINE.md for the full technical specification.
| Tool | Purpose |
|---|---|
seed.py |
Generate seed concepts |
gen_world.py |
Seed → world bible |
gen_characters.py |
Seed + world → character registry |
gen_outline.py |
Outline with beats and foreshadowing |
gen_outline_part2.py |
Foreshadowing ledger |
gen_canon.py |
Cross-reference hard facts |
voice_fingerprint.py |
Voice analysis and discovery |
| Tool | Purpose |
|---|---|
draft_chapter.py |
Write a single chapter with anti-pattern rules |
run_drafts.py |
Batch sequential chapter drafter |
| Tool | Purpose |
|---|---|
evaluate.py |
Mechanical slop scorer + LLM judge |
adversarial_edit.py |
"Cut 500 words" analysis → classified cuts |
compare_chapters.py |
Head-to-head Elo tournament |
reader_panel.py |
4-persona novel-level evaluation |
review.py |
Opus dual-persona review with stopping conditions |
| Tool | Purpose |
|---|---|
gen_brief.py |
Auto-generate revision briefs from feedback |
gen_revision.py |
Rewrite a chapter from a revision brief |
apply_cuts.py |
Batch adversarial cut applicator |
| Tool | Purpose |
|---|---|
gen_art.py |
Art pipeline: style, curate, ornaments, vectorize |
gen_art_directions.py |
Generate diverse art directions for curation |
gen_cover_composite.py |
Text overlay on cover art |
gen_cover_print.py |
Print-ready full-wrap cover (Lulu/KDP specs) |
| Tool | Purpose |
|---|---|
gen_audiobook_script.py |
Parse chapters into speaker-attributed scripts |
gen_audiobook.py |
Generate multi-voice audio via ElevenLabs |
| Tool | Purpose |
|---|---|
run_pipeline.py |
Full pipeline orchestrator (seed → finished novel) |
build_arc_summary.py |
Regenerate arc summary from chapters |
build_outline.py |
Regenerate outline from chapters |
…
The novel is five co-evolving layers:
Layer 5: voice.md — HOW we write
Layer 4: world.md — WHAT exists
Layer 3: characters.md — WHO acts
Layer 2: outline.md — WHAT HAPPENS
Layer 1: chapters/ch_NN.md — THE ACTUAL PROSE
Cross-cutting: canon.md — WHAT IS TRUE
Changes propagate both down (lore change → outline change → chapter
revision) and up (writing reveals a gap → update lore → check
downstream). The pipeline tracks propagation debts in state.json.
Mechanical (evaluate.py, no LLM): regex scans for banned words,
fiction clichés, show-don't-tell violations, sentence uniformity.
LLM Judge (evaluate.py, separate model): scores prose quality,
voice adherence, character distinctiveness, beat coverage.
After automated revision cycles, the full manuscript goes to Claude Opus with this prompt:
"Read the below novel. Review it first as a literary critic and then as a professor of fiction. Give specific, actionable suggestions for any defects you find. Be fair but honest. You don't have to find defects."
The dual-persona review catches what automated tools can't: prose-level repetition, character thinness, ethical gaps, structural monotony. The loop continues until the reviewer's items are mostly qualified hedges rather than real problems.
The pipeline uses three external services:
| Service | Key | Used for |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
Writing, evaluation, review (Sonnet + Opus) |
| fal.ai | FAL_KEY |
Cover art and ornament generation (Nano Banana 2) |
| ElevenLabs | ELEVENLABS_API_KEY |
Multi-voice audiobook generation |
Copy .env.example to .env and fill in your keys. Only the Anthropic
key is required for the core pipeline. Art and audiobook are optional.
The first novel, The Second Son of the House of Bells, was produced through this pipeline:
暂无开放 Issues,或尚未同步最近议题。