How plantingflowersrabbit/shuyi-agent works
ShuYi Agent is a Chinese-novel audiobook dubbing workbench. The principal workflow runs from project and text intake through chapter selection, role and utterance preparation, voice assignment, audio generation, review, and delivery export. The frontend drives the API; the API coordinates domain services and persisted state. README-documented planner, memory, tool-calling, and trace capabilities are included, though their detailed wiring is not established by the sampled excerpts.
Main entry points: app.py HTTP API · dubbing_workflow.py Dubbing workflow · App.tsx Web workbench · audio.py Audio jobs
Components 22
Workbench
- Web workbench
frontend/src/App.tsx - Workflow state
frontend/src/features/agent-workflow/workflowMachine.ts
Dubbing production
- Novel and chapters
backend/app/domain/novel.py - Dubbing workflow
backend/app/domain/dubbing_workflow.py - Utterance segmentation
backend/app/domain/segmentation.py - Roles and voices
backend/app/domain/roles.py - Voice resources
backend/app/domain/voices.py - Audio jobs
backend/app/domain/audio.py - Audio and export
backend/app/domain/novel_files.py
Agent services
- Chapter parsing
backend/app/domain/ai_chapter_agent.py - Role analysis
backend/app/domain/ai_segmentation_agent.py - Tool registry
backend/app/domain/tool_registry.py - Agent traces
backend/app/domain/agent_trace.py
Project services
- Project workspace
backend/app/domain/project_workspace.py - Production planning
backend/app/domain/production_planner.py - Story memory
backend/app/domain/story_memory.py
Runtime and storage
- HTTP API
backend/app/api/app.py - SQLite repository
backend/app/repositories/sqlite.py - Runtime state
backend/app/application/runtime_state.py
Other components
- Producer
- Qwen3 TTS service
backend/tts/qwen3_tts_server.py - Text model provider
Connections 22
- Producer → Web workbench: operates
- Web workbench → Workflow state: updates state
- Web workbench → HTTP API: sends requests
- HTTP API → Project workspace: manages projects
- HTTP API → Novel and chapters: loads text
- HTTP API → Chapter parsing: requests parsing
- Chapter parsing → Text model provider: requests completion
- HTTP API → Dubbing workflow: runs workflow
- Dubbing workflow → Role analysis: analyzes roles
- Dubbing workflow → Utterance segmentation: segments utterances
- Dubbing workflow → Roles and voices: matches roles
- HTTP API → Voice resources: manages voices
- HTTP API → Audio jobs: generates audio
- Audio jobs → Qwen3 TTS service: requests speech
- HTTP API → Audio and export: exports package
- HTTP API → Production planning: plans and reviews
- HTTP API → Story memory: indexes and searches
- HTTP API → Tool registry: executes tools
- HTTP API → Agent traces: records runs
- HTTP API → Runtime state: restores and saves
- Runtime state → SQLite repository: persists snapshot
- HTTP API → SQLite repository: reads and writes