autonovel OFFICIAL

An autonomous novel writing pipeline, by Hermes Agent

β˜… 568 Python Nous Research Updated 3/20/2026
View on GitHub β†’

autonovel

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.


Quick Start

# 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

The Pipeline

Phase 1: Foundation

Build the world, characters, outline, voice, and canon from a seed concept. Loop until foundation_score > 7.5.

Phase 2: First Draft

Write chapters sequentially. Evaluate each one. Keep if score > 6.0, retry if not. Forward progress over perfection.

Phase 3a: Automated Revision

Adversarial editing β†’ apply cuts β†’ reader panel β†’ generate briefs β†’ rewrite chapters. Plateau detection stops the loop when scores stabilize.

Phase 3b: Opus Review Loop

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.

Phase 4: Export

Rebuild docs, typeset in LaTeX, generate art, produce audiobook scripts, build ePub, create landing page.

See PIPELINE.md for the full technical specification.


Tools (27 Python scripts)

Foundation

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

Drafting

Tool Purpose
draft_chapter.py Write a single chapter with anti-pattern rules
run_drafts.py Batch sequential chapter drafter

Evaluation

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

Revision

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

Art & Cover

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)

Audiobook

Tool Purpose
gen_audiobook_script.py Parse chapters into speaker-attributed scripts
gen_audiobook.py Generate multi-voice audio via ElevenLabs

Orchestration

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

File Structure

FRAMEWORK (reusable, on master):
  program.md             β€” Agent instructions per phase
  CRAFT.md               β€” Craft education (plot, character, world, prose)
  ANTI-SLOP.md           β€” Word-level AI tell detection
  ANTI-PATTERNS.md       β€” Structural AI pattern detection
  PIPELINE.md            β€” Full automation specification
  WORKFLOW.md            β€” Step-by-step human guide

TEMPLATES (filled per-novel on a branch):
  voice.md               β€” Part 1: guardrails. Part 2: discovered per novel
  world.md               β€” World bible template
  characters.md          β€” Character registry template
  outline.md             β€” Chapter outline template
  canon.md               β€” Hard facts database
  MYSTERY.md             β€” Central mystery (author-only)
  state.json             β€” Pipeline state tracker

TYPESETTING:
  typeset/novel.tex      β€” LaTeX template (EB Garamond, trade paperback)
  typeset/build_tex.py   β€” Chapters β†’ LaTeX with vector ornaments
  typeset/epub_*          β€” ePub metadata, CSS, and front matter

ART:
  audiobook_voices.json  β€” Character β†’ ElevenLabs voice mapping
  landing/index.html     β€” Responsive landing page template

CONFIG:
  .env.example           β€” API keys (Anthropic, fal.ai, ElevenLabs)
  pyproject.toml         β€” Python dependencies

How It Works

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.

Two Immune Systems

  1. Mechanical (evaluate.py, no LLM): regex scans for banned words, fiction clichΓ©s, show-don't-tell violations, sentence uniformity.

  2. LLM Judge (evaluate.py, separate model): scores prose quality, voice adherence, character distinctiveness, beat coverage.

The Opus Review Loop

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.


API Keys

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.


Production History

The first novel, The Second Son of the House of Bells, was produced through this pipeline:


Inspiration