How echo-smith/luminwrite-oss works
LuminWrite is a self-hosted Chinese-language AI writing workbench. A creator supplies a request and materials in the React app; the Go API runs a governed workflow from contract and executable plan through research or retrieval, drafting, and quality gates, then returns artifacts and run events for review. PostgreSQL-backed stores preserve documents, run state, evidence, and memory. The README also documents profile/style management, long-term memory, and WABench/red-team evaluation as major product branches. Runtime wiring is inferred only where the README or sampled source supports it; unsampled subsystem links are omitted where uncertain.
Main entry points: executor.go Plan executor · postgres.go PostgreSQL · orchestrator.go Runtime orchestrator · writing_api.go Writing handlers
Components 23
Writing experience
- React workbench
frontend/src/App.tsx - Writing composer
frontend/src/components/composer/writing-composer.tsx - Writing API
frontend/src/lib/writing-api.ts - Go API server
backend/internal/server/server.go - Writing handlers
backend/internal/server/writing_api.go
Governed writing
- Runtime orchestrator
backend/internal/writingruntime/orchestrator.go - Writing contract
backend/internal/writingkernel/contract.go - Plan compiler
backend/internal/writingplan/compiler.go - Plan executor
backend/internal/writingruntime/executor.go - Quality gates
backend/internal/writingquality/gates.go - Research workflow
backend/internal/writingruntime/research_discover.go
Shared capabilities
- Academic research
backend/internal/scholar/client.go - Knowledge retrieval
backend/internal/services/kb_manager.go - Layered memory
backend/internal/memory/service.go - Style profiles
backend/internal/profile/profile.go - LLM client factory
backend/internal/services/llm_service.go
Persistence
- Writing store
backend/internal/writingstore/store.go - PostgreSQL
backend/internal/database/postgres.go
Evaluation and administration
- WABench evaluation
backend/internal/services/wabench_evaluation.go - Admin services
backend/internal/server/handlers_admin.go
Other components
- Creator
- Document parser
- Model provider
Connections 26
- Creator → React workbench: uses
- React workbench → Writing composer: opens
- Writing composer → Writing API: submits request
- Writing API → Writing handlers: REST commands
- Writing handlers → Runtime orchestrator: starts runs
- Runtime orchestrator → Writing contract: validates contract
- Runtime orchestrator → Plan compiler: compiles plan
- Runtime orchestrator → Plan executor: dispatches execution
- Plan executor → Quality gates: runs gates
- Plan executor → Research workflow: dispatches research
- Research workflow → Academic research: fetches and reads
- Academic research → Document parser: parses documents
- Plan executor → Knowledge retrieval: retrieves materials
- Plan executor → Layered memory: uses memory
- Plan executor → Style profiles: resolves style
- Plan executor → LLM client factory: requests generation
- LLM client factory → Model provider: calls model API
- Runtime orchestrator → Writing store: persists run state
- Writing store → PostgreSQL: reads and writes
- Knowledge retrieval → PostgreSQL: indexes and searches
- Layered memory → PostgreSQL: stores memory
- Style profiles → PostgreSQL: loads profiles
- Writing handlers → Writing API: streams run events
- Creator → WABench evaluation: reviews candidates
- WABench evaluation → PostgreSQL: stores evaluations
- Admin services → PostgreSQL: manages configuration