How Dossi's Algorithm Learns and Adapts

A deep dive into Bayesian learning, ISF adaptation, 5-layer safety validation, and personalized insulin delivery.

The Dosing Formula

Dossi calculates insulin in three components based on current physiology and glucose prediction.

Every insulin recommendation is calculated from three independent components:

Carb Component

Estimated carbs ÷ Insulin-to-Carb Ratio (ICR)

Based on grams of carbohydrates you log or estimate.

Correction Component

(Current Glucose − Target) ÷ Insulin Sensitivity Factor (ISF)

Brings high glucose down or avoids low glucose.

IOB Subtraction

Insulin on Board already working in your body

  • Up to 50% offsets carb component
  • Fully offsets correction component

Safety Rounding

Recommendation rounded to nearest 0.05 units

Matches Omnipod precision. Then validated through 5 safety layers.

How Adaptation Works

Your ICR and ISF don't stay static. Dossi learns from your glucose outcomes and adjusts these factors automatically. After you manually enter insulin and see how your glucose actually responds, Dossi records the pattern and learns whether you need more or less sensitivity in that context.

5-Layer Safety Chain

Before any insulin is delivered, the dose passes through rigorous validation layers. At ANY point, if conditions fail, Dossi blocks or warns.

Layer 1: CGM Data Quality

  • Blocks all dosing if glucose data is unavailable
  • Rejects data older than 30 minutes
  • Suspends during sensor warmup
  • Stops all delivery if signal is lost >30 min

Layer 2: Hard Physical Limits

  • Max single bolus: 25 units
  • Won't deliver if glucose < 70 mg/dL
  • Blocks if glucose falling faster than -3 mg/dL/min
  • FDA-equivalent safety bounds

Layer 3: Daily Accumulation Limits

  • Warning at 1.5× estimated daily dose
  • Hard block at 3× estimated daily (max 200 units)
  • Prevents stacking of multiple boluses
  • Personalized to your typical usage

Layer 4: Rapid Fall Detection

  • Monitors glucose trend across readings
  • Adds warnings if glucose is dropping fast
  • Reduces confidence if hypo risk detected
  • Requires 2+ reading confirmation before escalation

Layer 5: Predictive Safety (When Available)

If prediction data is available, Dossi analyzes whether the proposed dose risks low glucose in the next 2 hours. May automatically reduce dose if hypo risk is high. Uses prediction uncertainty to stay conservative.

TOCTOU Protection: Before delivering insulin, the system immediately re-validates with fresh glucose data. This prevents the case where glucose changed between recommendation and delivery—a critical "time-of-check to time-of-use" safety pattern.

8 Core Contextual Factors

Dossi learns how each factor affects your insulin needs and adjusts your ISF and ICR automatically.

1. Sleep Quality

Poor sleep increases insulin resistance.

  • Learns from hours slept + efficiency
  • Tracks 7-day accumulated sleep debt
  • Adjusts ISF coefficient based on sleep patterns

2. Time of Day (Dawn Phenomenon)

Insulin sensitivity varies predictably throughout your day.

  • Detects dawn phenomenon (4–8 AM, peak ~6 AM)
  • Tracks pre-dawn dips (2–5 AM)
  • Learns only when fasted to avoid meal confusion

3. Infusion Site Age

Absorption slows as your infusion site gets older.

  • Tracks hours since Omnipod activation
  • Learns site-specific absorption curves
  • Adjusts carb timing predictions for older sites

4. Infusion Site Location

Different body locations absorb insulin at different rates.

  • Distinguishes abdomen vs. arm/leg/other
  • Learns location-specific sensitivity coefficients
  • Optional tracking for Omnipod placement

5. Exercise Effects

Workouts increase insulin sensitivity immediately and for hours afterward.

  • Learns per-activity-type (running, cycling, strength, etc.)
  • Learns per-intensity (light, moderate, vigorous)
  • Tracks 5 time windows: 0–2h, 2–6h, 6–12h, 12–24h, 24–48h

6. Menstrual Cycle Phase

Hormonal cycles change insulin sensitivity significantly.

  • Learns from Apple Health cycle data (optional)
  • Tracks 4 phases: menstrual, follicular, ovulation, luteal
  • Applies phase-specific ISF adjustments

7. Meal Macronutrient Patterns

Fat and protein slow glucose absorption compared to carbs alone.

  • High fat (>35%): extends absorption window
  • High protein (>30%): slower peak time
  • High fiber (>10g): dampens glucose spike

8. Caffeine (Isolated)

Caffeine consumed without food can affect glucose stability.

  • Learned from isolated caffeine consumption (<5g carbs)
  • Promoted to active dosing after confidence threshold reached
  • Stores long-term pattern insights for user education

What Dossi Tracks But Doesn't Use for Dosing

Observable factors: Fat intake, fiber intake, and illness type are logged and analyzed for insights, but don't directly adjust your ISF/ICR. Prediction confidence only: Seasonal patterns and circadian regimes affect prediction uncertainty bounds, helping Dossi know when to be more conservative with recommendations.

How Dossi Learns

After every meal, Dossi compares its prediction to reality and refines your personal model.

The Learning Loop:

1. Predict

Model your expected glucose 2–4 hours out.

2. Observe

Track your actual glucose outcome.

3. Attribute

Determine which active factors explain the difference.

4. Update

Refine your personal ISF/ICR model.

Learning Conditions

Learning only applies when: (1) you've accumulated 10+ observations of a pattern, (2) pattern shows 50%+ confidence, (3) you have 14+ days historical data, and (4) Smart Mode is enabled. Paused during post-low recovery, illness, and sensor warmup.

Learned Adjustment Bounds: All learning is capped. Adjustments can only modify your base settings by ±30%. Final ISF can only vary between 0.6× and 1.6× your entered value. This prevents runaway learning from corrupting dosing even if data quality degrades.

Confidence Levels

Dossi shows you how confident it is in each recommendation.

High Confidence

Good CGM signal, stable context, no conflicting factors. Trust the recommendation.

Medium Confidence

Some contextual noise or adjustments being applied. Use judgment.

Low Confidence

Poor CGM data, unusual context, or insufficient historical data. Consider manual adjustment.

Always Your Decision

You make the final bolus decision. Biometric auth required. Dossi recommends; you decide.

Design Principles

Conservative by Default

When in doubt, Dossi suggests less insulin, not more.

Learning is Optional

Works in Calibration Mode with just your pump settings—no learning required.

Auditable Safety

Every dosing decision is logged with full reasoning for review.

Physiologically Grounded

Based on published diabetes research, ADA guidelines, and Loop literature.

No Silent Overrides

If learning would break bounds, it's clamped visibly—never silently modified.

User Controlled

Open-source code. You decide what gets deployed to your device.