How yosrikhiari/versatile works
Versatile is an offline-first fiction-writing environment with local persistence and optional server sync. A writer edits and organizes a manuscript and story bible, queries story data, or starts an AI run that plans and drafts a novel. The documented pipeline proceeds from bible and network through structure, spine, prose, and consistency; generated scenes can be committed to the manuscript. The README documents additional writing, research, export, and collaboration capabilities. Some frontend subsystems are represented by documented enclosing directories because their individual source files were not in the supplied tree.
Main entry points: db-core.ts Local database · components Writing workspace · useStoryQueryStore.ts Story Query · generation Generation engine
Components 24
Writing workspace
- Writing workspace
src/components - Manuscript tools
backend/Versatile.Api/Controllers/ManuscriptController.cs - Flow sessions
backend/Versatile.Api/Controllers/FlowController.cs
AI generation
- Novel pipeline
src/composables/useNovelPipeline.ts - Generation engine
src/composables/generation - Bible stage
src/composables/generation - Network stage
src/composables/generation - Structure stage
src/composables/generation - Spine stage
src/composables/generation - Prose stage
src/composables/generation - Consistency stage
src/composables/generation - Run controller
src/composables/generation/useGenerationRunController.ts - Generation commit
src/composables/generation/commit
Story knowledge
- Story Query
src/stores/useStoryQueryStore.ts - Story Bible
backend/Versatile.Api/Controllers/EntityController.cs - Story Network
backend/Versatile.Api/Controllers/GraphEdgeController.cs - Research retrieval
src/composables/rag
Persistence and sync
- Local database
src/services/db-core.ts - Sync engine
src/services/sync-engine.ts - Optional API
backend/Versatile.Api/Program.cs
External services
- AI provider service
src/services/aiService.ts - Local model
- Cloud AI provider
Other components
- Writer
Connections 27
- Writer → Writing workspace: edits and runs
- Writing workspace → Manuscript tools: opens tools
- Writing workspace → Flow sessions: starts sessions
- Writing workspace → Story Query: queries story
- Story Query → Story Bible: reads and updates
- Story Query → Manuscript tools: reads and updates
- Writer → Novel pipeline: starts generation
- Novel pipeline → Generation engine: starts or resumes
- Generation engine → Bible stage: runs
- Bible stage → Network stage: feeds
- Network stage → Structure stage: feeds
- Structure stage → Spine stage: feeds
- Spine stage → Prose stage: feeds
- Prose stage → Consistency stage: feeds
- Generation engine → AI provider service: requests generation
- AI provider service → Local model: sends prompts
- AI provider service → Cloud AI provider: routes by opt-in
- Run controller → Generation engine: controls run
- Run controller → Generation commit: saves scenes
- Generation commit → Local database: persists
- Story Query → Local database: reads story data
- Story Bible → Local database: stores entities
- Story Network → Local database: stores graph data
- Research retrieval → AI provider service: rewrites queries
- Sync engine → Local database: reads and writes
- Sync engine → Optional API: syncs opted-in data
- Optional API → Cloud AI provider: requests embeddings