|
|
8 ay önce | |
|---|---|---|
| .github | 8 ay önce | |
| assets | 8 ay önce | |
| packages | 8 ay önce | |
| .env.example | 8 ay önce | |
| .gitignore | 8 ay önce | |
| LICENSE | 8 ay önce | |
| README.md | 8 ay önce | |
| README.zh-CN.md | 8 ay önce | |
| package.json | 8 ay önce | |
| pnpm-lock.yaml | 8 ay önce | |
| pnpm-workspace.yaml | 8 ay önce | |
| tsconfig.json | 8 ay önce |
Multi-Agent Novel Production System
English | 中文
Open-source multi-agent system that autonomously writes, audits, and revises novels — with human review gates that keep you in control.
Writing a novel with AI isn't just "prompt and paste." Long-form fiction breaks down fast: characters forget things, items appear from nowhere, the same adjectives repeat every paragraph, and plot threads silently die. InkOS treats these as engineering problems.
InkOS runs a multi-agent pipeline for each chapter:
Radar ──> Architect ──> Writer ──> Continuity Auditor ──> Reviser
│ │ │ │ │
Scans Plans Drafts Audits the Fixes issues
trending chapter prose from draft against flagged by
topics outline the outline canonical truth the auditor
| Agent | Responsibility |
|---|---|
| Radar | Scans platform trends and reader preferences to inform story direction |
| Architect | Plans chapter structure: outline, scene beats, pacing targets |
| Writer | Produces prose from the plan + current world state |
| Continuity Auditor | Validates the draft against three canonical truth files |
| Reviser | Fixes issues found by the auditor — auto-fixes critical problems, flags others for human review |
Every book maintains three files as the single source of truth:
| File | Purpose |
|---|---|
current_state.md |
World state: character locations, relationships, knowledge, emotional arcs |
particle_ledger.md |
Resource accounting: items, money, supplies with quantities and decay tracking |
pending_hooks.md |
Open plot threads: foreshadowing planted, promises to readers, unresolved conflicts |
The Continuity Auditor checks every draft against these files. If a character "remembers" something they never witnessed, or pulls a weapon they lost two chapters ago, the auditor catches it.
inkos/
├── packages/
│ ├── core/ # Agent runtime, pipeline, state management
│ │ ├── agents/ # architect, writer, continuity, reviser, radar
│ │ ├── pipeline/ # runner (write→audit→revise), scheduler (daemon)
│ │ ├── state/ # File-based state manager
│ │ ├── llm/ # OpenAI-compatible provider (streaming)
│ │ ├── notify/ # Telegram, Feishu, WeCom
│ │ ├── models/ # Zod schemas
│ │ └── prompts/ # Agent prompt templates
│ └── cli/ # Commander.js CLI
│ └── commands/ # init, book, write, review, status, export, etc.
├── templates/ # Project scaffolding templates
└── (future) studio/ # Web UI for review and editing
TypeScript monorepo managed with pnpm workspaces.
git clone https://github.com/Narcooo/inkos.git
cd inkos
pnpm install
pnpm build
cp .env.example .env
OPENAI_API_KEY=sk-your-key-here
OPENAI_BASE_URL=https://api.openai.com/v1 # or any compatible endpoint
OPENAI_MODEL=gpt-4o
# Optional: notifications
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
FEISHU_WEBHOOK_URL=
WECOM_WEBHOOK_URL=
inkos init # Initialize project
inkos book create # Create a new book (interactive)
inkos write next # Write next chapter (full agent pipeline)
inkos review # Review the latest draft
inkos status # Check project status
| Command | Description |
|---|---|
inkos init |
Initialize a new InkOS project |
inkos book create |
Create a new book (interactive) |
inkos write next |
Run the agent pipeline to produce the next chapter |
inkos write rewrite <n> |
Rewrite chapter N (restores state snapshot) |
inkos review |
Review and approve/reject the latest draft |
inkos review approve-all <id> |
Batch approve all pending chapters |
inkos status |
Show project and book status |
inkos export <id> |
Export book to txt/md |
inkos radar |
Run the Radar agent to scan platform trends |
inkos config |
View or update project configuration |
inkos doctor |
Diagnose setup issues |
inkos up |
Start daemon mode |
inkos down |
Stop the daemon |
Every chapter automatically creates a state snapshot. Use inkos write rewrite <n> to roll back and regenerate any chapter — world state, resource ledger, and plot hooks all restore to the pre-chapter state.
File-based locking prevents concurrent writes to the same book.
inkos up starts an autonomous loop that writes chapters on a schedule. The pipeline runs fully unattended for non-critical issues, but pauses for human review when the auditor flags problems it cannot auto-fix.
Notifications via Telegram, Feishu, or WeCom.
Early alpha. The core pipeline works, but expect breaking changes.
What works:
What's planned:
packages/studio — web UI for review, editing, and book managementContributions welcome. Open an issue or PR.
pnpm install
pnpm dev # watch mode for all packages
pnpm test # run tests
pnpm typecheck # type-check without emitting