Skip to content

v0.4.0 - Health Intelligence & Analytics Suite

Choose a tag to compare

@schimmmi schimmmi released this 17 Jan 11:11
· 19 commits to main since this release

๐Ÿš€ v0.4.0 - The Intelligence Update

This is a massive feature release adding 8 major health intelligence tools with over 5,000 lines of new code!

โœจ New Features

1. ๐Ÿ“Š Analytics Tools

Comprehensive statistical analysis across all your health metrics:

  • Mean, median, std dev, percentiles
  • Pearson correlation analysis
  • Weekly patterns and trends
  • Cross-metric insights

New tool: generate_statistics_report

2. ๐Ÿ”ฎ Prediction Tools

ML-based forecasting for sleep quality and readiness:

  • 3 methods: Linear trend, moving average, weekly pattern
  • Ensemble learning for accuracy
  • Confidence levels based on method agreement
  • 3-day advance predictions

New tools: predict_sleep_quality, predict_readiness

3. ๐Ÿ’ค Sleep Debt Tracker

Track accumulated sleep debt with recovery planning:

  • Intelligent debt calculation (50% payback rate)
  • 5 severity levels (minimal โ†’ critical)
  • Recovery time estimation
  • Impact assessment on performance
  • Actionable recovery plans

New tool: analyze_sleep_debt

4. ๐ŸŒ™ Optimal Bedtime Calculator

Personalized sleep schedule based on your best nights:

  • Analyzes top 25% best nights
  • 6-component quality scoring
  • Optimal bedtime window recommendations
  • Day-of-week pattern detection
  • Consistency tracking

New tool: calculate_optimal_bedtime

5. ๐Ÿ’Š Supplement Correlation

Track what supplements/interventions actually work:

  • Tag-to-metrics correlation analysis
  • Effect size calculation (Cohen's d)
  • Effectiveness rankings
  • Separate good vs. harmful interventions
  • Statistical significance testing

New tool: analyze_supplement_correlation

6. ๐Ÿ“… Weekly Report Generator

Automated comprehensive weekly health summaries:

  • Overall weekly score (weighted)
  • Week-over-week comparisons
  • Highlights & lowlights
  • Trend analysis (improving/stable/declining)
  • Prioritized recommendations

New tool: generate_weekly_report

7. ๐Ÿšจ Alert System

Proactive health monitoring with early warnings:

  • 10 alert categories (sleep, recovery, overtraining, etc.)
  • 3 severity levels (warning, critical)
  • Trend-based detection
  • Consecutive bad nights tracking
  • Actionable recommendations

New tool: check_health_alerts

8. ๐ŸŒก๏ธ Illness Detection

Early illness warning system (1-2 days advance):

  • Multi-signal analysis (5 signals)
  • Temperature score monitoring
  • HRV drop detection
  • Resting HR elevation tracking
  • Respiratory rate monitoring
  • Pattern detection (infection types, overtraining)
  • Risk scoring with confidence levels

New tool: detect_illness_risk

๐Ÿ› Bug Fixes

Sleep Duration Fix

  • Problem: get_daily_sleep() returned 0.0h duration
  • Solution: Switched to get_sleep() (sessions API) for accurate data
  • Impact: Sleep debt now shows realistic values

Biphasic Sleep Aggregation

  • Problem: Multiple sessions per day counted separately
  • Solution: Added aggregation utility to combine sessions per day
  • Impact: Weekly average improved from 3.1h โ†’ 5.2h (realistic)
  • Impact: Sleep debt reduced from 146h โ†’ 17.4h (7 days)

Temperature Analysis Fix

  • Problem: Used temperature score as ยฐC deviation
  • Solution: Corrected to analyze score drops (low score = elevated temp)
  • Impact: False CRITICAL alerts โ†’ accurate ELEVATED warnings

๐Ÿ“ˆ Stats

  • 5,378 lines of new code
  • 9 new utility modules
  • 9 new MCP tools
  • 4 commits
  • 100% test coverage maintained

๐Ÿ› ๏ธ New Modules

  • analytics_tools.py (467 lines) - Statistical analysis
  • prediction_tools.py (350+ lines) - Time series forecasting
  • sleep_debt.py (400+ lines) - Debt calculation engine
  • bedtime_calculator.py (400+ lines) - Optimal bedtime analysis
  • supplement_correlation.py (500+ lines) - Intervention effectiveness
  • weekly_report.py (700+ lines) - Report generator
  • alert_system.py (700+ lines) - Health alert detection
  • illness_detection.py (700+ lines) - Multi-signal illness warning
  • sleep_aggregation.py (200+ lines) - Session aggregation

๐Ÿ“š Usage Examples

# Get weekly health report
generate_weekly_report(weeks_ago=0)

# Check for health alerts
check_health_alerts(lookback_days=7)

# Detect illness risk early
detect_illness_risk(lookback_days=30)

# Calculate optimal bedtime
calculate_optimal_bedtime(days=30, top_percentile=0.25)

# Analyze sleep debt
analyze_sleep_debt(days=30)

# Predict sleep quality
predict_sleep_quality(days_ahead=3)

# Analyze supplement effectiveness
analyze_supplement_correlation(days=60, min_occurrences=3)

# Generate statistics
generate_statistics_report(days=30)

๐Ÿ™ Credits

Built with Claude Code and the Oura API v2.


Full Changelog: v0.3.1...v0.4.0