How raghuram1811/psychetrajectory works
PsycheTrajectory combines an interactive wellbeing-pattern concept app with a Python research backend for simulated observations and exploratory trajectory modeling. The backend workflow generates or ingests observations, validates and aggregates them into daily features, trains an encoder, filters latent trajectories, and can evaluate or replay outputs. The README also describes shared human reflection and uncertainty as product goals; sampled app source confirms a front-end prototype, but not its internal UI stages. The app has no configured D1 tables. Backend relationships shown here are limited to caller references in the SOURCE INDEX and sampled excerpts.
Main entry points: cli.py Research CLI · pipeline.py Training and replay · schema.py Data contracts · heads.py Symptom heads
Components 20
Concept app
- Interactive simulator
app/page.tsx - App shell
app/layout.tsx - ChatGPT auth
app/chatgpt-auth.ts - D1 access helper
db/index.ts - Empty app schema
db/schema.ts
Observation pipeline
- Synthetic signals
backend/src/psychetrajectory/synthetic.py - Observation I/O
backend/src/psychetrajectory/io.py - Data contracts
backend/src/psychetrajectory/schema.py - Daily features
backend/src/psychetrajectory/preprocessing.py
Trajectory modeling
- Masked encoder
backend/src/psychetrajectory/encoder.py - Trend filter
backend/src/psychetrajectory/kalman.py - Window inference
backend/src/psychetrajectory/inference.py - Symptom heads
backend/src/psychetrajectory/heads.py - Inference API
backend/src/psychetrajectory/api.py
Research workflows
- Research CLI
backend/src/psychetrajectory/cli.py - Subject splits
backend/src/psychetrajectory/splits.py - Training and replay
backend/src/psychetrajectory/pipeline.py - Diagnostics
backend/src/psychetrajectory/diagnostics.py
Other components
- Person or clinician
- Cloudflare D1
Connections 24
- Person or clinician → Interactive simulator: explores patterns
README.md - App shell → Interactive simulator: renders
- Research CLI → Synthetic signals: generates data
backend/src/psychetrajectory/cli.py - Research CLI → Observation I/O: reads and writes
backend/src/psychetrajectory/cli.py - Research CLI → Training and replay: trains or replays
backend/src/psychetrajectory/cli.py - Research CLI → Daily features: preprocesses
backend/src/psychetrajectory/cli.py - Research CLI → Diagnostics: evaluates
backend/src/psychetrajectory/cli.py - Research CLI → Symptom heads: trains heads
backend/src/psychetrajectory/cli.py - Observation I/O → Data contracts: uses types
backend/src/psychetrajectory/io.py - Synthetic signals → Data contracts: creates observations
backend/src/psychetrajectory/synthetic.py - Daily features → Data contracts: uses types
backend/src/psychetrajectory/preprocessing.py - Training and replay → Daily features: aggregates features
backend/src/psychetrajectory/pipeline.py - Training and replay → Subject splits: splits subjects
backend/src/psychetrajectory/pipeline.py - Training and replay → Masked encoder: trains and embeds
backend/src/psychetrajectory/pipeline.py - Training and replay → Symptom heads: uses heads
backend/src/psychetrajectory/pipeline.py - Training and replay → Trend filter: filters latents
backend/src/psychetrajectory/pipeline.py - Symptom heads → Data contracts: uses labels
backend/src/psychetrajectory/heads.py - Symptom heads → Subject splits: splits subjects
backend/src/psychetrajectory/heads.py - Window inference → Trend filter: updates state
backend/src/psychetrajectory/inference.py - Window inference → Data contracts: returns result
backend/src/psychetrajectory/inference.py - Inference API → Trend filter: uses filter
backend/src/psychetrajectory/api.py - Inference API → Data contracts: uses contracts
backend/src/psychetrajectory/api.py - D1 access helper → Cloudflare D1: connects to
db/index.ts - D1 access helper → Empty app schema: configures ORM
db/index.ts