KetoRing
Smart ring app for ketosis monitoring. Correlates Oura ring biometrics with Withings body metrics to surface real-time metabolic state estimates without blood testing.
The Problem
Monitoring ketosis — the metabolic state where your body burns fat for fuel instead of glucose — traditionally requires blood ketone meters, urine strips, or expensive breath analyzers. Blood meters are the most accurate but require daily finger pricks and $3-5 per strip. Casual keto practitioners don’t do this consistently.
The observation: people on keto who use Oura rings notice their biometrics shift noticeably when they’re in ketosis. HRV improves. Resting heart rate drops. Skin temperature changes. Body fat percentage trends down on Withings scales. None of these signals alone indicates ketosis, but the combination of them across time is a reliable proxy.
KetoRing makes that inference automatic.
The Approach
The app connects two data sources:
Oura Ring API — HRV (heart rate variability), resting heart rate, SpO2, skin temperature delta, readiness score, sleep stages. All of these have documented correlations with metabolic state. HRV in particular increases significantly in sustained ketosis for most users.
Withings Smart Scale API — Daily body weight, body fat percentage, and muscle mass. Ketosis accelerates fat loss. A sliding window correlation between the Oura biometrics and Withings body composition gives a stronger signal than either alone.
The iOS app (Swift, SwiftData) handles data sync from both APIs in the background, stores a local history, and surfaces a daily “metabolic estimate” — a qualitative assessment of whether you’re likely in ketosis based on your current biometric signature vs. your personal baseline.
The AI layer (OpenAI GPT-4o via function calling) takes the structured biometric data and generates natural language insights: “Your HRV has been 15% above your 30-day baseline for 4 days. Combined with 0.8kg weight drop and skin temp delta of +0.3°C, your pattern is consistent with sustained ketosis.” Concrete, personalized, referenced to your actual numbers.
Key Technical Decisions
Correlation over thresholds. The naive approach: “if HRV > X, you’re in ketosis.” This fails because baseline HRV varies massively between individuals. Instead, I compute Z-scores relative to each user’s 30-day rolling baseline. The signal isn’t absolute values — it’s deviations from personal normal.
Background BLE vs. foreground sync. Oura and Withings both offer REST APIs. I sync in the background using iOS background tasks rather than requiring the user to open the app. The ring data is there when you wake up, like a morning health report.
SwiftData for local persistence. The app stores 90 days of biometric history locally. No cloud backend. Health data is sensitive — keeping it local reduces trust surface and eliminates server costs. The AI analysis happens client-side by sending aggregated (not raw) biometric deltas to the OpenAI API.
Configurable sensitivity. Some users are strict keto (targeting deep ketosis). Others are carb-cycling or doing lazy keto. I exposed the baseline deviation thresholds as user settings. A strict keto practitioner might want alerts at 1.5 standard deviations above baseline HRV. A casual practitioner can set 1.0.
What I Learned
Wearable APIs are surprisingly good. Oura’s API documentation is thorough, the data is well-structured, and they expose metrics I didn’t expect (skin temperature delta vs. overnight baseline is particularly useful). The integration was faster than anticipated.
Correlation-based health inferences require honesty. This app estimates metabolic state — it doesn’t measure it. Blood ketone meters are the ground truth. I was explicit about this in the UI: “This is an estimate based on biometric patterns, not a medical measurement.” Getting the uncertainty communication right was as important as getting the correlation logic right.
GPT-4o’s function calling made structured health output reliable. Instead of parsing free-form LLM responses for biometric values, I defined output schemas and used function calling to enforce them. The AI produces consistently structured output that maps directly to UI components.