DreamOS bridges the gap between your professional life and your biological needs. By analyzing your Google Calendar and sleep metrics, it identifies the root causes of insomnia and automatically schedules personalized Cognitive Behavioral Therapy for Insomnia (CBT-I) interventions directly into your daily schedule.
Zero Friction Architecture: Your calendar and sleep logs provide the data; DreamOS provides the clinical solutions.
DreamOS utilizes a multi-agent orchestration layer to transform raw data into actionable health interventions.
[ Data Input ]
Google Calendar (Workload, Meeting Density)
+
Sleep Logs (Efficiency, SOL, WASO, Duration)
|
v
[ LangGraph Agents ]
1. Sleep Analyst -> Computes clinical metrics via Python
2. Cause Detector -> Identifies insomnia phenotypes (via Groq LLM)
3. CBT-I Protocol -> Generates targeted interventions (via Groq LLM)
4. Schedule Optimizer -> Synchronizes interventions with GCal (via Groq LLM)
|
v
[ Final Output ]
Google Calendar Updates (Breathing, Journaling, Wind-down, Stimulus Control)
| Layer | Technology | Role |
|---|---|---|
| Backend | Python 3.11 + FastAPI | Core API and Logic |
| Orchestration | LangGraph | Agentic Workflow Management |
| Intelligence | Groq (Llama-3.3-70b-versatile) | Inference and Decision Making |
| Frontend | React 18 + Vite + Tailwind | Dashboard and Visualizations |
| Data Viz | Recharts | Sleep Metric Analytics |
| Integration | Google Calendar API v3 | Bi-directional Schedule Sync |
Navigate to the backend directory and set up the environment:
cd dreamos/backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env: Add GROQ_API_KEY and GOOGLE_CREDENTIALS_PATH
Google Calendar Integration (Optional for Live Mode):
- Create a project in the Google Cloud Console.
- Enable the Google Calendar API.
- Download the
credentials.json(OAuth 2.0 Desktop client). - Update your
.env:GOOGLE_CREDENTIALS_PATH=./credentials.json.
Navigate to the frontend directory and install dependencies:
cd dreamos/frontend
npm install
npm run dev
The application will be available at http://localhost:5173.
Retrieves the main intelligence overview.
-
Parameters:
-
profile(ana | mihai | progress) - Default:ana -
live(true | false) - Default:false -
Response:
DashboardResponsecontaining sleep scores, cause profiling, and the CBT-I protocol.
Analyzes the user's workload and schedule density.
- Response: Metrics on meeting frequency, free slots, and "fragmentation scores" that impact sleep.
Writes the generated interventions to the user's calendar.
- Body: JSON array of event objects (summary, description, start, end).
- Note: Set
?live=trueto write to a real Google Calendar; otherwise, it operates in mock mode.
| Profile | Primary Cause | Sleep Score | Context |
|---|---|---|---|
| Ana | Hyperarousal | 73 | High workload (8+ meetings/day), zero breaks, SE=68% |
| Mihai | Circadian Rhythm | 62 | Irregular schedule, late-night meetings, SE=72% |
| Progress | Recovering | 85 | 7-day positive trend, SE improved from 62% to 81% |
DreamOS focuses on Active Interventions, not just passive tracking.
| Intervention | Mechanism | Clinical Goal |
|---|---|---|
| 4-7-8 Breathing | Parasympathetic Activation | Cortisol reduction before high-stress tasks |
| Light Exposure | Circadian Reset | Melatonin regulation through morning sunlight |
| Worry Journaling | Cognitive Externalization | Anti-rumination strategy for bedtime |
| Digital Sunset | Blue Light Mitigation | Protecting natural melatonin production |
| Sleep Restriction | Homeostatic Pressure | Consolidating sleep into a continuous block |
| Stimulus Control | Classical Conditioning | Re-associating the bed with sleep, not wakefulness |
Run both services simultaneously to get started:
# Terminal 1: Backend
cd dreamos/backend && uvicorn main:app --reload --port 8000
# Terminal 2: Frontend
cd dreamos/frontend && npm run dev
The system is designed to work fully offline using mock data for demonstration purposes if no API keys are provided.