Skip to main content

NovelScribe

CI PyPI version Python versions License

An AI-powered autonomous novel generation agent. Give it a concept, pick a genre, and it writes a full novel — outline, characters, world-building, chapters, and all.

v8.0 (Pipeline-to-Frontend Port): the Python scribe CLI and TUI have been removed (cutover shipped in Phase 11, code-side removal in Phase 12). Novel generation now runs in NovelScribe Studio — the Flutter app under frontend/. The Python pipeline is also available as a library (pip install novelscribe) for programmatic use; the thin cross-device sync service lives in novel_harness/sync_backend/ (FastAPI, port 8001).

Language / 语言 / 語言: English | 简体中文 | 繁體中文


What runs where

Component Path Run as
NovelScribe Studio (Flutter app) frontend/ cd frontend && flutter run -d chrome
sync_backend (thin FastAPI sync) novel_harness/sync_backend/ make start-sync-backend (port 8001)
Python pipeline (library) novel_harness/agents/, workflows/, core/ pip install novelscribe

Install and configuration: Quick Start.

The Flutter app talks to the pipeline locally via RuntimeKernel (BYOK keys configured in-app). sync_backend is the cross-device mirror for projects, chapters, reading state, and the knowledge-base catalogs. The agent/workflow catalog is not mirrored — Studio runs the corpus bundled in the app (ADR-0015).

What NovelScribe does

Nineteen specialised AI agents — 15 pipeline roles plus 4 background monitors — wired into an autonomous pipeline:

new novel → world-building → characters → outline → chapter-planning → writing → continuity → verification

Each agent is a Markdown file with a system prompt and model config. The orchestrator runs them step-by-step through YAML-defined workflows, with verification loops that auto-fix issues until quality passes.

Pipeline capabilities (library-level)

  • 19 specialised agents — writer, editor, character designer, world-builder, continuity checker, plus 4 ambient monitors (style/tone, character, plot thread, world bible)
  • Verification loops — auto-detect and fix plot holes, inconsistencies, and quality issues
  • Hook lifecycle framework — YAML-declared hooks with required vs optional semantics and strict guardrails
  • Resilience — step retry/timeout, DAG parallel execution with rollback, exponential+jitter backoff, trigger API
  • Quality gates — Bronze / Silver / Gold / Platinum tiers with metrics and benchmarks
  • Parallel execution — runs independent agents concurrently for 2-4x speedup
  • LLM streaming — real-time token streaming across all providers
  • Circuit breakers — automatic failover between LLM providers
  • Run logging — structured JSONL logs per project
  • Knowledge graph — entity relationships (characters, locations, events) with consistency checking
  • Schema versioning — forward-compatible agent/workflow definitions with migration support
  • Scales to 3M words — hierarchical summaries, memory optimization, chapter pagination, phase-level caching
  • Multi-language — English, 简体中文, 繁體中文 (with fallback)
  • 8 LLM providers — OpenAI, Claude, Gemini, Ollama, LM Studio, MiniMax, ZhipuAI (z.ai), Moonshot (Kimi) — all configurable via BYOK in the Studio

Library use

Install the Python package:

pipx install novelscribe        # isolated env
# or
pip install --user novelscribe

Use the Pipeline programmatically:

from pathlib import Path

from novelscribe import GenerationRequest, Pipeline, PipelineSettings

pipeline = Pipeline(
    PipelineSettings(
        provider="openai",
        model="gpt-5",
        project_root=Path("./novels"),
    )
)

result = pipeline.generate(
    GenerationRequest(
        project_name="the-lighthouse",
        concept="An engineer discovers the lighthouse is sending impossible signals.",
        genre="mystery",
        chapter_count=24,
    )
)

print(result.status)
print(result.project_path)

Pipeline.generate() creates a new project and never overwrites existing state. Use Pipeline.resume(project_name) to continue an interrupted project. Pipeline.run_workflow() is the secondary escape hatch for one named Workflow.

Generation is unattended by default. For checkpoint approval, inject an ApprovalHandler; the Library never reads terminal input. A custom LLMAdapter can replace the built-in provider adapters.

Set provider keys via environment (only needed for direct library use; the Studio manages BYOK itself):

export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GOOGLE_API_KEY=...

sync_backend (cross-device sync)

A thin FastAPI service that stores projects, chapters, reading state, and the knowledge-base catalogs for cross-device use. Studio reads from it and writes a limited set of records back; the agent/workflow catalog is not mirrored.

make start-sync-backend    # http://0.0.0.0:8001

Endpoints live under /api/v1/... and are documented in openapi.json. The Flutter Studio is the primary client.

Deploying it? make sync-backend-env generates both variables (SCRIBE_SYNC_API_TOKEN — static bearer token gating every request — and SCRIBE_SYNC_CORS_ORIGINS); the token is persisted at .scribe/api_token so redeploys keep it. Full details: sync_backend/README.md and ADR-0021.

Development

git clone https://github.com/huangjien/wst.git
cd wst/novel_harness
uv sync --all-extras

# Run quality checks
make check

# Individual
make format      # ruff format
make lint        # ruff check --fix
make type-check  # mypy
make test        # pytest with coverage
make build       # uv build → dist/

License

MIT — the full text ships with the installed package (novelscribe-*.dist-info/licenses/LICENSE).

Metadata

Release files for novelscribe 9.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novelscribe 9.1.5
File Size Uploaded Provenance Actions
novelscribe-9.1.5.tar.gz 1.7 MB With provenance Details for novelscribe-9.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for novelscribe 9.1.5
File Interpreter ABI Platform Actions
novelscribe-9.1.5-py3-none-any.whl Python 3 none any Details for novelscribe-9.1.5-py3-none-any.whl

Total release size: 4.0 MB

Release files / novelscribe-9.1.5.tar.gz

Download URL novelscribe-9.1.5.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
ca3aab3eb36d230e9ff4ee36a75d6865bf78c20fc9e400482808acb26f80354d
BLAKE2b-256 checksum
How to use checksums
bd6b52ad7e4dcdd4c77c5fe1f44c83234739fb1e05559c58131d84cdbaab6560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / novelscribe-9.1.5-py3-none-any.whl

Download URL novelscribe-9.1.5-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b122662fa6e8332f086de18f43f057ae6e2bdebe3292682059db1ef051e371c5
BLAKE2b-256 checksum
How to use checksums
d8892866e36154d1bed011f2d85f95eae910d6817cb7329da7559c3aa9502371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for novelscribe 9.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for novelscribe-9.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

9.1.5 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page