|
|
8 месяцев назад | |
|---|---|---|
| packages | 8 месяцев назад | |
| .env.example | 8 месяцев назад | |
| .gitignore | 8 месяцев назад | |
| LICENSE | 8 месяцев назад | |
| README.md | 8 месяцев назад | |
| package.json | 8 месяцев назад | |
| pnpm-lock.yaml | 8 месяцев назад | |
| pnpm-workspace.yaml | 8 месяцев назад | |
| tsconfig.json | 8 месяцев назад |
Open-source multi-agent novel production system. AI agents autonomously write, audit, and revise novels --- with human review gates that keep you in control.
Inspired by a validated workflow from a linux.do community member who earned $10K+ in 3 months using AI-assisted novel writing (AI辅助网文写作).
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
platform scene + state files files (auto or manual)
trends beats
| 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 architect's plan + current world state |
| Continuity Auditor | Validates the draft against three canonical truth files (see below) |
| Reviser | Fixes issues found by the auditor --- auto-fixes critical problems, flags others for human review |
Every book maintains three files that act 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, radar, daemon, doctor
├── templates/ # Project scaffolding templates
└── (future) studio/ # Web UI for review and editing
TypeScript monorepo managed with pnpm workspaces. @inkos/core handles all agent logic; the inkos CLI package consumes it.
git clone https://github.com/user/inkos.git
cd inkos
pnpm install
pnpm build
cp .env.example .env
# .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=
# Initialize an InkOS project in the current directory
inkos init
# Create a new book with interactive prompts
inkos book create
# Write the next chapter (runs the full agent pipeline)
inkos write next
# Review the latest draft
inkos review
# Check project status
inkos 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 review |
Review and approve/reject the latest draft |
inkos status |
Show project and book status |
inkos radar |
Run the Radar agent to scan platform trends |
inkos config |
View or update project configuration |
inkos doctor |
Diagnose project setup issues |
inkos up |
Start daemon mode --- autonomous write cycles on a schedule |
inkos down |
Stop the daemon |
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 go out via Telegram, Feishu (飞书), or WeCom (企业微信) so you can review from your phone.
Early alpha. The core pipeline works, but expect breaking changes. The API surface, file formats, and CLI commands may all change before v1.
What works:
What's planned:
packages/studio --- web UI for review, editing, and book managementContributions welcome. This is early-stage software --- if you're interested in AI-assisted creative writing infrastructure, open an issue or PR.
pnpm install
pnpm dev # watch mode for all packages
pnpm test # run tests
pnpm typecheck # type-check without emitting