How huangleijiana/novel-agent works
Novel Agent is a web-controlled, multi-agent novel-writing system. A user submits a project through the frontend; the API runs a LangGraph workflow that pauses for human confirmation between major phases and resumes chapter work through review and revision. The workflow delegates creative and quality tasks to specialized agents, backed by configurable LLM providers, structured project state, and workspace persistence. The README documents the pipeline and capabilities; sampled source confirms the graph/phase-executor and persistence roles, but not every agent call or integration, so uncertain links are omitted.
Main entry points: orchestrator.py Agent Orchestrator · workflow.py LangGraph Workflow · nodes.py Phase Nodes · scheduler.py Model Scheduler
Components 24
User Interface
- Web Control Panel
src/frontend/js/app.js - FastAPI Routes
src/api/routes.py - Progress WebSocket
src/api/websocket.py
Workflow Control
- LangGraph Workflow
src/graph/workflow.py - Phase Nodes
src/graph/nodes.py - Phase Executors
src/api/phase_executor.py - Workflow State
src/models/state.py
Planning & Writing
- Agent Orchestrator
src/agents/orchestrator.py - Topic Research
src/agents/topic_scout.py - World Building
src/agents/architect.py - Character Planning
src/agents/character_manager.py - Plot Planning
src/agents/plot_planner.py - Chapter Writing
src/agents/writer.py
Review & Memory
- Editorial Review
src/agents/editor.py - Continuity Checks
src/agents/continuity_checker.py - Reader Simulation
src/agents/reader_simulator.py - Adversarial Review
src/agents/reviewer.py - Chapter Refinement
src/agents/refiner.py - Story Memory
src/agents/memory_manager.py
Runtime Services
- Workspace Files
src/storage/file_manager.py - Model Scheduler
src/llm/scheduler.py - LLM Providers
src/llm/providers.py - App Settings
src/config/settings.py
Other components
- Novel Author
Connections 24
- Novel Author → Web Control Panel: submits project
README.md - Web Control Panel → FastAPI Routes: calls API
README.md - FastAPI Routes → LangGraph Workflow: invokes workflow
README.md - LangGraph Workflow → Phase Nodes: routes phases
src/graph/workflow.py - LangGraph Workflow → Workflow State: flows state
src/graph/workflow.py - Phase Nodes → Phase Executors: executes phases
src/graph/nodes.py - Phase Nodes → Progress WebSocket: broadcasts progress
src/graph/nodes.py - Phase Executors → Agent Orchestrator: delegates phase work
src/api/phase_executor.py - Agent Orchestrator → Topic Research: runs research
src/agents/orchestrator.py - Agent Orchestrator → World Building: builds world
src/agents/orchestrator.py - Agent Orchestrator → Character Planning: plans characters
src/agents/orchestrator.py - Agent Orchestrator → Plot Planning: plans chapters
src/agents/orchestrator.py - Agent Orchestrator → Chapter Writing: writes chapters
README.md - Agent Orchestrator → Editorial Review: reviews drafts
README.md - Agent Orchestrator → Continuity Checks: checks continuity
README.md - Agent Orchestrator → Reader Simulation: simulates readers
README.md - Agent Orchestrator → Adversarial Review: adversarial review
README.md - Agent Orchestrator → Chapter Refinement: applies revisions
README.md - Agent Orchestrator → Story Memory: updates memory
README.md - LangGraph Workflow → Workspace Files: resumes artifacts
README.md - Phase Nodes → Workspace Files: persists artifacts
src/graph/nodes.py - Agent Orchestrator → Model Scheduler: uses models
src/agents/orchestrator.py - Model Scheduler → App Settings: loads assignments
src/llm/scheduler.py - Model Scheduler → LLM Providers: dispatches requests
src/llm/scheduler.py