Record and track sleep patterns, evaluate sleep quality with PSQI/Epworth/ISI scales, identify sleep problems, and provide sleep hygiene recommendations. Use for insomnia tracking, sleep analysis, and sleep disorder screening.
Record sleep, evaluate sleep quality, identify sleep problems, and provide sleep hygiene recommendations.
The sleep assessment, problem identification, and recommendations provided by this system are for reference only and do not constitute medical diagnosis or treatment plans.
Cannot Do:
Can Do:
User Input → Identify Operation Type → [record] Parse Sleep Info → Save Record
↓
[history/stats] Read Data → Display Report
↓
[psqi/epworth/isi] Parse Assessment Results → Save → Display Interpretation
↓
[problem] Parse Problem → Assess Risk → Save
↓
[hygiene] Parse Habits → Assess → Provide Recommendations
↓
[recommendations] Generate Personalized Recommendations
| Input Keywords | Operation Type |
|---|---|
| record | record - Log sleep |
| history | history - View history records |
| stats | stats - Sleep statistical analysis |
| psqi, PSQI | psqi - PSQI assessment |
| epworth | epworth - Epworth Sleepiness Scale |
| isi, ISI | isi - ISI Insomnia Severity Assessment |
| problem | problem - Sleep problem identification |
| hygiene | hygiene - Sleep hygiene assessment |
| recommendations | recommendations - Get recommendations |
| Input | quality Value |
|---|---|
| excellent | excellent |
| very good | very good |
| good | good |
| fair | fair |
| poor | poor |
| very poor | very poor |
| Input | Factor |
|---|---|
| caffeine_after_2pm | Caffeine after 2 PM |
| alcohol | Alcohol consumption |
| exercise: morning/afternoon/evening | Exercise time |
| screen_time: 90 | Screen time 90 minutes before bed |
| stress: low/medium/high | Stress level |
{
"id": "sleep_20250620_001",
"date": "2025-06-20",
"sleep_times": {
"bedtime": "23:00",
"sleep_onset_time": "23:30",
"wake_time": "07:00",
"out_of_bed_time": "07:15"
},
"sleep_metrics": {
"sleep_duration_hours": 7.0,
"time_in_bed_hours": 8.25,
"sleep_latency_minutes": 30,
"sleep_efficiency": 84.8
},
"awakenings": {
"count": 2,
"total_duration_minutes": 15,
"causes": ["bathroom", "noise"]
},
"sleep_quality": {
"subjective_quality": "fair",
"quality_score": 5,
"rested_feeling": "somewhat",
"morning_mood": "neutral"
}
}
{
"date": "2025-06-20",
"components": {
"subjective_quality": 2,
"sleep_latency": 1,
"sleep_duration": 2,
"sleep_efficiency": 1,
"sleep_disturbances": 2,
"hypnotic_use": 0,
"daytime_dysfunction": 2
},
"total_score": 10,
"interpretation": "Fair sleep quality"
}
{
"date": "2025-06-20",
"responses": [
{"situation": "sitting_reading", "score": 0},
{"situation": "watching_tv", "score": 1},
{"situation": "public_sitting", "score": 0},
{"situation": "passenger_car", "score": 1},
{"situation": "lying_afternoon", "score": 2},
{"situation": "talking", "score": 0},
{"situation": "after_lunch", "score": 1},
{"situation": "traffic", "score": 0}
],
"total_score": 5,
"interpretation": "Normal"
}
data/sleep-tracker.json=11: Poor sleep quality
| Component | 0 points | 1 point | 2 points | 3 points |
|---|---|---|---|---|
| Subjective sleep quality | Very good | Fairly good | Fairly bad | Very bad |
| Sleep latency | <=15 min | 16-30 min | 31-60 min | >60 min |
| Sleep duration | >7 hours | 6-7 hours | 5-6 hours | <5 hours |
| Sleep efficiency | >85% | 75-84% | 65-74% | <65% |
| Sleep disturbances | No issues | <1/week | 1-2/week | >=3/week |
| Hypnotic use | None | <1/week | 1-2/week | >=3/week |
| Daytime dysfunction | None | <1/week | 1-2/week | >=3/week |
| Total Score | Result |
|---|---|
| 0-7 | Normal |
| 8-10 | Mild sleepiness |
| 11-15 | Moderate sleepiness |
| 16-24 | Severe sleepiness |
| Total Score | Result |
|---|---|
| 0-7 | No clinically significant insomnia |
| 8-14 | Mild insomnia |
| 15-21 | Moderate insomnia |
| 22-28 | Severe insomnia |
For more examples, see examples.md.