Write novels like a professional author β with an entire editorial team at your command.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β "The difference between an amateur and a professional β
β writer is a systematic process." β
β β
β β Novel OS Philosophy β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Novel OS is a complete editorial infrastructure for producing professional-quality novels using multiple specialized AI agents working in concert β with any LLM you choose (Claude, GPT, Gemini, Llama, Kimi, local models, anything OpenAI-compatible).
Traditional AI writing generates one response and forgets everything. Novel OS is different:
- π§ Persistent memory β agent outputs are parsed and merged into a central state file. Characters, locations, plot threads, foreshadowing, and quality scores accumulate chapter by chapter.
- π€ Agents collaborate β Architect β Scribe β Editor β Guardian β Curator, each handing off to the next with full context.
- π‘οΈ Deterministic + LLM validation β a free local continuity engine catches dormant threads, unresolved foreshadowing, and timeline drift before the LLM Guardian runs.
- π Provider-agnostic β Anthropic, OpenAI, Azure, Gemini, NVIDIA NIM, Kimi, Groq, Together, OpenRouter, DeepSeek, Mistral, Fireworks, Ollama, LM Studio, or any OpenAI-compatible endpoint.
Think of it as hiring a full-time editorial team β story architect, prose craftsman, line editor, fact-checker, voice coach β all working on your novel around the clock, on infrastructure that actually remembers what happened in chapter 3.
graph TB
subgraph Agents["The Five Agents"]
A["ποΈ Architect<br/>Planner"]
B["βοΈ Scribe<br/>Drafter"]
E["π Editor<br/>Refiner"]
G["π‘οΈ Guardian<br/>Validator"]
S["π¨ Curator<br/>Voice"]
end
subgraph Memory["Persistent State"]
SM["π§ StoryState<br/>(JSON)"]
SP["π₯ State Parser"]
CE["π¬ Continuity Engine<br/>(deterministic)"]
end
subgraph LLM["Provider Layer"]
LC["π LLMClient<br/>(13+ providers)"]
end
A & B & E & G & S --> LC
LC -.outputs.-> SP
SP --> SM
CE --> SM
CE -.findings.-> G
style A fill:#1e3a5f,stroke:#4a9eff,color:#fff
style B fill:#1a4731,stroke:#4ade80,color:#fff
style E fill:#3b1f5e,stroke:#a78bfa,color:#fff
style G fill:#5e1f1f,stroke:#f87171,color:#fff
style S fill:#4a1f4a,stroke:#e879f9,color:#fff
style SM fill:#1f3a4f,stroke:#fbbf24,color:#fff
style SP fill:#1f3a4f,stroke:#fbbf24,color:#fff
style CE fill:#1f3a4f,stroke:#fbbf24,color:#fff
style LC fill:#2a3441,stroke:#06b6d4,color:#fff
| # | Agent | Role | Outputs |
|---|---|---|---|
| 1 | ποΈ Architect | Story planner β designs 3-act structure, character arcs, beats | outline.json, expanded chapter_NNN_outline.md |
| 2 | βοΈ Scribe | Prose drafter β writes the chapter in deep POV | chapter_NNN_draft.md + [SCRIBE_STATE_UPDATE] block |
| 3 | π Editor | Line surgeon β 5 modes: line / developmental / pacing / dialogue / tension | chapter_NNN_revised.md + [EDITOR_STATE_UPDATE] with before/after scores |
| 4 | π‘οΈ Guardian | Forensic fact-checker β character, timeline, world, plot continuity | chapter_NNN_continuity_report.md with Status: PASS/WARNING/FAIL |
| 5 | π¨ Curator | Voice stylist β locks tone, prose rhythm, genre conventions | [STYLE_STATE_UPDATE] with consistency / genre / voice scores |
Every agent prompt now includes a strict OUTPUT CONTRACT that forces the LLM to emit machine-parseable update blocks β verified working with frontier models (Claude, GPT) and open-weight models (Llama 3.3 70B).
flowchart LR
P["ποΈ PLAN<br/>Architect"] --> D["βοΈ DRAFT<br/>Scribe"]
D --> Px1["π₯ Parse +<br/>persist"]
Px1 --> Ed["π EDIT<br/>Editor"]
Ed --> Px2["π₯ Parse +<br/>persist"]
Px2 --> CE["π¬ PRE-CHECK<br/>Continuity Engine"]
CE --> V["π‘οΈ VALIDATE<br/>Guardian"]
V --> Px3["π₯ Parse +<br/>persist"]
Px3 --> Ap["β
APPROVE<br/>(gates FAIL)"]
Ap -->|"Next βΊ"| P
style P fill:#1e3a5f,stroke:#4a9eff,color:#fff
style D fill:#1a4731,stroke:#4ade80,color:#fff
style Ed fill:#3b1f5e,stroke:#a78bfa,color:#fff
style CE fill:#1f3a4f,stroke:#fbbf24,color:#fff
style V fill:#5e1f1f,stroke:#f87171,color:#fff
style Ap fill:#1a4731,stroke:#22c55e,color:#fff
style Px1 fill:#2a3441,stroke:#06b6d4,color:#fff
style Px2 fill:#2a3441,stroke:#06b6d4,color:#fff
style Px3 fill:#2a3441,stroke:#06b6d4,color:#fff
Quality gates β a chapter cannot be approved while Status: FAIL is on file. Resolve the issue and re-validate.
The defining feature: every agent's structured output is parsed and merged into a central JSON state, so subsequent agents see what came before.
sequenceDiagram
participant U as You
participant O as Orchestrator
participant L as LLMClient
participant P as State Parser
participant S as StoryState (JSON)
U->>O: write --chapter 1
O->>L: Scribe prompt + context from S
L-->>O: chapter prose + [SCRIBE_STATE_UPDATE]
O->>P: parse(output)
P->>S: update characters.location<br/>update characters.emotional_state<br/>append plot_advances<br/>append foreshadowing_planted
S-->>O: persisted
O-->>U: β
+ change log
Captured per chapter: character locations, emotional states, last-appearance index, key events, foreshadowing planted/resolved, new information revealed, editor quality scores (before/after), continuity status & issues, style scores.
Deterministic, free, instant β runs before the LLM Guardian on every validate, and on demand via check.
| Check | Severity | Catches |
|---|---|---|
dormant_thread |
warning | Active plot threads idle >3 chapters |
overdue_thread |
critical | Threads past their target_resolution_chapter still active |
unresolved_foreshadowing |
warning | Planted seeds with no matching resolved entry |
absent_character |
warning | Main characters silent >5 chapters |
never_appeared |
warning | Protagonists/antagonists who never showed up |
dead_character_state |
warning | Flagged-dead characters with active state |
missing_chapter_file |
critical | Chapter marked complete but no manuscript file |
status_drift |
info | Draft exists but status still planned |
thin_character |
info | Main characters with no internal_desire set |
python core/orchestrator.py check # check whole project
python core/orchestrator.py check --chapter 12 # check as-of a specific chapterFindings are also injected into the LLM Guardian's prompt as context β the Guardian gets a head start instead of rediscovering obvious issues, and you don't spend tokens on them.
Pick any of these β auto-detected from whichever API key is present:
| Provider | NOVEL_OS_LLM_PROVIDER |
Key env var |
|---|---|---|
| Anthropic Claude | anthropic |
ANTHROPIC_API_KEY |
| OpenAI | openai |
OPENAI_API_KEY |
| Azure OpenAI | azure |
AZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINT |
| Google Gemini | gemini |
GEMINI_API_KEY |
| NVIDIA NIM | nvidia |
NVIDIA_API_KEY |
| Kimi / Moonshot | kimi |
KIMI_API_KEY |
| Groq | groq |
GROQ_API_KEY |
| Together AI | together |
TOGETHER_API_KEY |
| OpenRouter | openrouter |
OPENROUTER_API_KEY |
| DeepSeek | deepseek |
DEEPSEEK_API_KEY |
| Mistral | mistral |
MISTRAL_API_KEY |
| Fireworks | fireworks |
FIREWORKS_API_KEY |
| Ollama (local) | ollama |
β |
| LM Studio (local) | lmstudio |
β |
| Any OpenAI-compatible endpoint | openai_compatible |
NOVEL_OS_API_KEY + NOVEL_OS_BASE_URL |
graph LR
A[Architect] & B[Scribe] & E[Editor] & G[Guardian] & S[Curator] --> LC{π LLMClient}
LC --> P1[Anthropic]
LC --> P2[OpenAI]
LC --> P3[Azure]
LC --> P4[Gemini]
LC --> P5[NVIDIA NIM]
LC --> P6[Kimi]
LC --> P7[Groq Β· Together Β·<br/>OpenRouter Β· DeepSeek Β·<br/>Mistral Β· Fireworks]
LC --> P8[Ollama Β· LM Studio<br/>local servers]
LC --> P9[Any OpenAI-compatible<br/>endpoint]
style LC fill:#06b6d4,stroke:#0e7490,color:#000
git clone https://github.com/mrigankad/Novel-OS.git
cd Novel-OS
pip install -r requirements.txt # install only the SDKs you need
cp .env.example .env # add your API key(s)python core/orchestrator.py init --title "The Last Signal" --genre "Sci-Fi Thriller"python core/orchestrator.py character add --name "Lena Vasquez" --role protagonist
python core/orchestrator.py character add --name "Director Malk" --role antagonistpython core/orchestrator.py plan outline --chapters 32
python core/orchestrator.py plan chapter --number 1 --pov "Lena Vasquez"python core/orchestrator.py write --chapter 1 # Scribe drafts
python core/orchestrator.py edit --chapter 1 --mode line # Editor polishes
python core/orchestrator.py check --chapter 1 # free pre-check
python core/orchestrator.py validate --chapter 1 # Guardian validates
python core/orchestrator.py approve --chapter 1 # gates on FAILEvery phase command also accepts --dry-run to emit the prompt without calling the LLM β useful for hand-running in a chat UI.
python core/orchestrator.py status
python core/orchestrator.py export --format markdown| Command | Purpose |
|---|---|
init --title --genre [--author] |
Bootstrap a new project |
character add --name --role |
Add a character (protagonist/antagonist/supporting/minor) |
character list |
List all characters with arc state |
plot add --name --description [--type --priority] |
Register a plot thread |
plot list |
List threads by priority and status |
plan outline --chapters --words |
Generate act structure |
plan chapter --number [--pov --summary] [--dry-run] |
Architect expands the chapter |
write --chapter [--draft-file --dry-run] |
Scribe drafts (or accept a file) |
edit --chapter --mode [--dry-run] |
Editor revises in one of 5 modes |
validate --chapter [--dry-run] |
Pre-check + LLM Guardian validates |
check [--chapter N] |
Deterministic engine only (no LLM) |
approve --chapter |
Mark complete (blocked while Status: FAIL) |
status |
Project dashboard |
export --format markdown |
Compile approved chapters |
novel-os/
βββ π README.md β you are here
βββ π AGENTS.md β full agent specs
βββ π SYSTEM_OVERVIEW.md β architecture deep-dive
βββ π requirements.txt
βββ π .env.example β provider configuration
β
βββ π core/
β βββ orchestrator.py β CLI + workflow
β βββ state_manager.py β persistent JSON state
β βββ llm_client.py β 13+ provider abstraction
β βββ state_parser.py β agent output β state mutations
β βββ continuity_engine.py β deterministic checks
β
βββ π€ agents/ β each has prompt.md with OUTPUT CONTRACT
β βββ architect/
β βββ scribe/
β βββ editor/
β βββ continuity_guardian/
β βββ style_curator/
β
βββ π templates/ β story bible / character / outline starters
βββ π docs/ β WORKFLOWS.md, API.md
βββ π¬ examples/ β demo project + recent smoke run
βββ π¨ assets/ β mascot + optional generated imagery
β
βββ π€ outputs/ β (per project, gitignored)
βββ state/story_state.json
βββ manuscript/
βββ feedback/
Great novels are not written β they are engineered. Professional authors use editors, fact-checkers, and style guides. They maintain character bibles, plot trackers, and timelines. Novel OS gives every writer that infrastructure, automated and systematic, with state that actually accumulates rather than dissolving between sessions.
| β Without Novel OS | β With Novel OS |
|---|---|
| Characters forget their backstory | Persistent character database with location, emotion, knowledge |
| Plot holes emerge 200 pages in | Continuity engine catches dormant threads & overdue resolutions |
| Style drifts between chapters | Curator scores and flags voice drift per chapter |
| Foreshadowing dropped silently | Planted/resolved tracked; orphans surfaced |
| Tension collapses in act two | Architect beats + Editor tension mode enforce escalation |
| Vendor lock-in to one LLM | 13+ providers, swap with one env var |
| Document | What's inside |
|---|---|
| AGENTS.md | Full system prompts and OUTPUT CONTRACT for each of 5 agents |
| SYSTEM_OVERVIEW.md | Architecture deep-dive and design rationale |
| docs/WORKFLOWS.md | Step-by-step writing workflows |
| docs/API.md | Programmatic API for custom integrations |
Novel OS β Write novels like a professional author, with an entire editorial team at your command.
v1.1 | Production-Ready Fiction Framework | MIT License


