How sonihet50/orion---world-state-engine works
Orion is a world-state engine for writers: users organize worlds and manuscripts, submit chapter material for extraction, then inspect and manage the resulting entities, relationships, events, timelines, and contradictions. The frontend route map and backend API router establish the major product surfaces; sampled services and extraction code show how extracted data is resolved into world state. The README contains only the project title, so some feature links and processing integrations are not documented there or visible in sampled call sites; those connections are omitted or marked unverified.
Main entry points: App.tsx Route application · models World records · world_state_service.py World-state service · extractor.py Chapter extractor
Components 25
Writer workspace
- Route application
Frontend/src/App.tsx - Sign-in
Frontend/src/pages/SignIn.tsx - Worlds
Frontend/src/pages/Worlds.tsx - Manuscripts
Frontend/src/pages/Manuscripts.tsx - Writing room
Frontend/src/pages/WritingRoom.tsx - Entity ledger
Frontend/src/pages/EntityLedger.tsx - World graph
Frontend/src/pages/WorldGraph.tsx - World timeline
Frontend/src/pages/WorldTimeline.tsx - Contradictions
Frontend/src/pages/Contradictions.tsx - World assistant
Frontend/src/pages/WorldAssistant.tsx - Authentication state
Frontend/src/store/useAuthStore.ts - API client
Frontend/src/api/client.ts
API and domain
- Versioned API
backend/app/api/v1/router.py - Product endpoints
backend/app/api/v1/routes
Extraction pipeline
- Text preprocessing
backend/app/preprocessing - Chapter extractor
backend/app/pipeline/extractor.py - Extraction stages
extractor/extractor
World state storage
- World-state service
backend/app/services/world_state_service.py - Graph service
backend/app/services/graph_service.py - Consistency checks
backend/app/services/consistency_service.py - Domain repositories
backend/app/repositories - World records
backend/app/models - Relational database
backend/app/core/database.py
Other components
- Writer
- Ollama LLM
Connections 26
- Writer → Route application: uses
Frontend/src/App.tsx - Route application → Sign-in: routes to
Frontend/src/App.tsx - Route application → Worlds: routes to
Frontend/src/App.tsx - Route application → Manuscripts: routes to
Frontend/src/App.tsx - Route application → Writing room: routes to
Frontend/src/App.tsx - Route application → Entity ledger: routes to
Frontend/src/App.tsx - Route application → World graph: routes to
Frontend/src/App.tsx - Route application → World timeline: routes to
Frontend/src/App.tsx - Route application → Contradictions: routes to
Frontend/src/App.tsx - Route application → World assistant: routes to
Frontend/src/App.tsx - Route application → Authentication state: checks auth
Frontend/src/App.tsx - Authentication state → API client: requests through
Frontend/src/store/useAuthStore.ts - World timeline → API client: requests through
Frontend/src/pages/WorldTimeline.tsx - API client → Versioned API: sends HTTP
- Versioned API → Product endpoints: registers
backend/app/api/v1/router.py - World-state service → Domain repositories: uses
backend/app/services/world_state_service.py - World-state service → Consistency checks: uses
backend/app/services/world_state_service.py - World-state service → World records: updates
backend/app/services/world_state_service.py - Graph service → World records: reads
backend/app/services/graph_service.py - Graph service → Domain repositories: queries
backend/app/services/graph_service.py - Domain repositories → World records: accesses
backend/app/repositories/entity_repo.py - Relational database → World records: initializes
backend/app/core/database.py - Text preprocessing → Chapter extractor: prepares text for
backend/app/pipeline/extractor.py - Chapter extractor → Text preprocessing: imports
backend/app/pipeline/extractor.py - Chapter extractor → Extraction stages: runs stages
extractor/extractor/pipeline.py - Extraction stages → Ollama LLM: requests extraction
extractor/extractor/relations.py