How skyswordsaint26/orion---world-state-engine works
Orion is a world-state engine for writers: users create worlds, manage manuscripts and chapters, and inspect extracted entities, timelines, relationships, and contradictions. The visible UI routes those activities; the frontend API client communicates with a FastAPI backend. The backend models world state and includes consistency checking, chat, graph, and timeline capabilities. A separate extractor runs staged story analysis, including mention/coreference, event, temporal, and relationship/fact extraction. The README is only a title, so some backend service and job wiring cannot be verified from the supplied excerpts.
Main entry points: App.tsx Route application · pipeline.py Extraction pipeline · routes Feature routes · world_state_service.py World state service
Components 30
Writer interface
- Route application
Frontend/src/App.tsx - Sign-in
Frontend/src/pages/SignIn.tsx - World pages
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 - World state store
Frontend/src/store/useWorldStore.ts - API client
Frontend/src/api/client.ts
Backend API
- FastAPI application
backend/app/main.py - API router
backend/app/api/v1/router.py - Feature routes
backend/app/api/v1/routes - Extraction jobs
backend/app/workers/tasks
World state
- World state service
backend/app/services/world_state_service.py - Consistency checks
backend/app/services/consistency_service.py - World chat
backend/app/services/chat_service.py - World data models
backend/app/models - SQL database
backend/app/core/database.py - Backend LLM client
backend/app/pipeline/llm_client.py
Story extraction
- Extraction pipeline
extractor/extractor/pipeline.py - Mention extraction
extractor/extractor/mentions.py - Coreference
extractor/extractor/coref.py - Event extraction
extractor/extractor/events.py - Temporal extraction
extractor/extractor/temporal.py - Facts and relations
extractor/extractor/relations.py
Other components
- Writer
- Ollama service
Connections 34
- Writer → Route application: uses
Frontend/src/App.tsx - Route application → Sign-in: routes
Frontend/src/App.tsx - Route application → World pages: routes
Frontend/src/App.tsx - Route application → Manuscripts: routes
Frontend/src/App.tsx - Route application → Writing room: routes
Frontend/src/App.tsx - Route application → Entity ledger: routes
Frontend/src/App.tsx - Route application → World graph: routes
Frontend/src/App.tsx - Route application → World timeline: routes
Frontend/src/App.tsx - Route application → Contradictions: routes
Frontend/src/App.tsx - Route application → World assistant: routes
Frontend/src/App.tsx - Writing room → World state store: uses
Frontend/src/pages/WritingRoom.tsx - Writing room → API client: calls
Frontend/src/pages/WritingRoom.tsx - World graph → World state store: uses
Frontend/src/pages/WorldGraph.tsx - World graph → API client: calls
Frontend/src/pages/WorldGraph.tsx - World state store → API client: fetches through
Frontend/src/store/useWorldStore.ts - API client → FastAPI application: HTTP requests
Frontend/src/api/client.ts - FastAPI application → API router: mounts
backend/app/main.py - API router → Feature routes: registers
backend/app/api/v1/router.py - World state service → World data models: uses
backend/app/services/world_state_service.py - World state service → Consistency checks: checks with
backend/app/services/world_state_service.py - World state service → SQL database: persists via
- FastAPI application → SQL database: initializes
backend/app/main.py - Feature routes → World state service: dispatches to
- Feature routes → World chat: dispatches to
- Feature routes → Extraction jobs: dispatches jobs
- Extraction jobs → Extraction pipeline: runs
- Extraction pipeline → Mention extraction: runs stage
extractor/extractor/pipeline.py - Extraction pipeline → Coreference: runs stage
extractor/extractor/pipeline.py - Extraction pipeline → Event extraction: runs stage
extractor/extractor/pipeline.py - Extraction pipeline → Temporal extraction: runs stage
extractor/extractor/pipeline.py - Extraction pipeline → Facts and relations: runs stage
extractor/extractor/pipeline.py - Facts and relations → Ollama service: generates with
- Backend LLM client → Ollama service: requests chat
backend/app/pipeline/llm_client.py - World chat → Backend LLM client: calls
backend/app/services/chat_service.py