An AI book-writing machine.
Eight layers from voice capture to finished manuscript.
Filters fight each other. Later passes undo earlier fixes. Quality degrades with every iteration instead of improving.
"Just prompting" gets you 85% of the way there. The last 15% — voice fidelity, rhythm, the absence of AI tells — requires machinery.
Score-based reviewers optimize for numbers. Five competing score functions produce technically correct, spiritually dead prose.
Book2 identified 5 critical failure modes. Book3 solved them. BookFoundry generalizes those solutions into a reusable engine anyone can point at a project directory.
Each chapter proceeds through a strict sequence. Mechanical always has the last word.
Research check, graph context extraction, exemplar matching — selects 2-3 voice-matched samples for this chapter's content.
Single best-possible draft with the richest prompt: voice exemplars, style guide, chapter config, graph context, research data.
Paragraph-by-paragraph elaboration to hit word targets (nonfiction). Then a fact-check filter strips ~35% fabricated specifics by comparing against research YAML and first-draft snapshots.
Classify paragraphs (good/fixable/stubborn). Taste Advisor gives targeted advice. Author approves or overrides. Supervised filter pipeline with damage detection finishes — mechanical always last.
Voice acquisition runs before any content generation. Three paths, same output format.
Provide existing writing — essays, blog posts, prior books. The machine analyzes sentence structure, hedging patterns, signature moves, vocabulary range, and rhythm.
Limited material: interviews, conversations, a few short pieces. The machine distills what's detectable and flags areas of uncertainty.
Name a public writer, a website, or a reference book. The machine fetches available work, analyzes it, and distills a style guide.
Output is always the same: exemplars.yaml (annotated writing samples) + style-guide.md (distilled rules). The machine then generates project-specific rubrics from the analysis.
A supervised pipeline with damage detection — the ReAct pattern prevents filters from undoing each other.
Strict ordering: programmatic first, then LLM-guided, then gradient. After each stage, a damage check re-runs earlier filters if later ones reintroduced tells. This solved the book2 thrashing problem.
Drafter, editorial reviewer, taste advisor, triage router, voice analyzer, metrics analyst, and more
7 pipeline layers + voice acquisition + planning + assembly + full-book-cycle
Style distance, repetition, vocabulary, flow rhythm, perplexity, syntactic diversity
One rule: run the union of foundry + project components. Name collision = project wins. Blank file = disabled. No separate config, no enable/disable flags.
Nonfiction: thesis, sub-argument, evidence nodes with supports/contradicts/depends-on edges.
Fiction: character, scene, plot-thread nodes with causes/foreshadows/develops edges.
Electron + React + TypeScript frontend with a FastAPI Python sidecar. Watch the pipeline work in real time.
Project dashboard with chapter table, status icons, and pipeline state at a glance.
WebSocket-driven live progress. Start, pause, and approve pipeline stages with approval gates.
TipTap rich text with AI suggestion marks, metrics sidebar, version history with diffs.
Streaming chat sessions with pin/unpin ideas. Create new book projects directly from brainstorm output.
One command: voice acquisition, book planning, process all chapters, assembly, rendering. full-book-cycle.yaml is already scaffolded — the master recipe that produces a complete book.
EPUB and HTML require no external tools. Typst/PDF rendering is wired. Templates live in templates/render/ with project-level overrides.
Continuity graph vocabulary with character/scene/plot-thread nodes. Genre gates skip expansion and fact-check for fiction. Continuity tracking is the "killer app."
The sidecar API bridges the Amplifier CLI engine to the Electron UI. Real-time pipeline visualization, author review gates, and brainstorm-to-book flows.
The override system means specialized components — genre-specific filters, research agents, domain vocabularies — can be shared and composed without forking the engine.
Primary sources:
MACHINE-DESIGN.md — 262-line architecture document covering the 8-layer pipeline, voice acquisition, graph vocabularies, override system, and decision storebundle.md — Amplifier bundle definition with 10 agents, 18 recipes, 7 modesFACT-CHECK-PIPELINE-NOTE.md — expansion fabrication rates and fact-check filter designpyproject.toml — Python 3.11+, dependencies: PyYAML, NumPy, AnthropicGit data (bookfoundry):
git log --oneline --since="60 days ago" --no-merges | wc -l → 81 commitsbookfoundry/, 36 test files, 88 totalGit data (bookfoundry-desktop):
git log --oneline --since="60 days ago" --no-merges | wc -l → 41 commitsAll metrics derived from repository inspection. No fabricated data.