Patient

Apple Health Anomaly Detection β€” Your Agent Caught the Fever Before You Felt It

4-16h early warning before symptom onsetHealth & Medical4 min read

Key Takeaway

Health Guardian integrates with Apple Health to monitor 39 metrics hourly β€” heart rate, HRV, sleep stages, temperature, SpO2. It learns YOUR personal baselines, then alerts you when something deviates. It caught a developing fever 4 hours before the user felt symptoms.

The Problem

Your Apple Watch collects extraordinary health data every day. Heart rate every 5 minutes. HRV overnight. Sleep stages. Blood oxygen. Wrist temperature. Steps. Exercise intensity.

Nobody looks at it.

The Health app on your iPhone shows you charts you don't understand. Trends you don't notice. Gradual changes that would alarm a doctor but look like noise to you.

The problem isn't data collection β€” it's data interpretation. Your watch knows your resting heart rate climbed 8 BPM over three days. Your HRV dropped 15ms. Your wrist temperature rose 0.4Β°C. These are early signs of illness, overtraining, or stress. But the Health app won't tell you that. It just... stores data.

The Solution

Health Guardian turns your AI agent into a proactive health monitor. It imports Apple Health data via Health Auto Export (iCloud sync), builds personal baselines over 14 days, and runs anomaly detection on every import.

When your data deviates from YOUR normal β€” not population averages β€” it alerts you through Telegram with specific observations and recommended actions.

The Process

Setup (one time):

  1. Install Health Auto Export on iPhone
  2. Configure: JSON format, iCloud Drive sync, hourly export
  3. Set environment in MrChief:
jsonShow code
{
  "human_name": "Bilal",
  "data_source": "~/Library/Mobile Documents/com~apple~CloudDocs/Health Auto Export",
  "import_interval": "hourly",
  "alert_channel": "telegram",
  "thresholds": {
    "temperature_high": 100.4,
    "heart_rate_high": 120,
    "heart_rate_low": 45,
    "hrv_drop_percent": 25,
    "spo2_low": 94
  },
  "baseline_period_days": 14
}
  1. Set up hourly cron:
jsonShow code
{
  "name": "Health Import",
  "schedule": { "kind": "cron", "expr": "0 * * * *" },
  "payload": {
    "kind": "systemEvent",
    "text": "Run health import and check for anomalies"
  }
}

Day 1-14: Baseline Learning The agent imports data every hour and builds YOUR personal baselines:

View details
Personal Baseline (14-day rolling):
β”œβ”€β”€ Resting HR: 58 Β± 4 BPM
β”œβ”€β”€ HRV (SDNN): 52 Β± 8 ms
β”œβ”€β”€ Sleep duration: 7.2 Β± 0.6 hours
β”œβ”€β”€ Deep sleep: 1.4 Β± 0.3 hours
β”œβ”€β”€ Wrist temperature delta: 0.0 Β± 0.2Β°C
β”œβ”€β”€ SpO2: 97 Β± 1%
β”œβ”€β”€ Steps: 8,400 Β± 2,100
└── Active calories: 520 Β± 140

Day 17: Anomaly Detection Fires

Tuesday, 2 PM. You feel fine. You're in a meeting. Your agent sends:

View details
πŸ”” Health Alert β€” Multiple Deviations Detected

⚠️ RESTING HEART RATE
Current: 71 BPM (baseline: 58 Β± 4)
+13 BPM above your normal β€” 3.2 standard deviations
Trend: rising for 18 hours (58 β†’ 63 β†’ 67 β†’ 71)

⚠️ HRV
Current: 34 ms (baseline: 52 Β± 8)
-35% below your normal β€” 2.3 standard deviations
Consistent with autonomic stress response

⚠️ WRIST TEMPERATURE
Current: +0.6Β°C above baseline
Trend: rising steadily for 12 hours

βœ… NORMAL: SpO2 (97%), sleep last night (7.1h),
steps on track

πŸ“Š PATTERN MATCH:
This combination (elevated HR + low HRV + rising
temperature) has historically preceded illness onset
in your data. Last occurrence: January 15 β€” you
developed a cold the following day.

πŸ’‘ RECOMMENDED:
- Monitor temperature every 2 hours
- Prioritize rest tonight β€” skip gym if planned
- Increase fluids
- Consider canceling non-essential meetings tomorrow
- If temperature exceeds 100.4Β°F / 38Β°C, consult
  your doctor

I'll continue monitoring hourly and alert you if
the pattern worsens.

Day 17, 6 PM: You start feeling slightly off. Scratchy throat.

Day 18, 8 AM: Full cold symptoms. The agent detected it 16 hours before you felt it.

The Results

MetricApple Health AppHealth Guardian
Anomaly detectionNone (passive storage)Real-time, personalized
Baseline learningPopulation averagesYOUR personal normals
Proactive alertsNoneTelegram notifications
Pattern matchingNoneCross-metric correlation
Historical comparisonManual chart scrollingAutomatic
Early warning0 hours4-16 hours before symptoms
Chronic condition supportBasicPurpose-built

What It Monitors (39 metrics)

Heart rate (resting, walking, workout), HRV, blood pressure, SpO2, wrist temperature, respiratory rate, sleep duration, sleep stages (REM, deep, light, awake), steps, distance, flights climbed, active calories, exercise minutes, stand hours, walking heart rate recovery, cardio fitness (VO2 max estimate), blood glucose (if CGM connected), menstrual cycle data, headphone audio levels, environmental sound levels.

Setup on MrChief

yamlShow code
skills:
  - health-guardian
  - apple-health-skill  # Additional query layer
Apple-Healthanomaly-detectionwearablesHRVhealth-monitoring

Want results like these?

Start free with your own AI team. No credit card required.

Apple Health Anomaly Detection β€” Your Agent Caught the Fever Before You Felt It β€” Mr.Chief