Plan Generation Engine
How MoPlan creates personalized workout programs.
Architecture Overview
┌─────────────────────────────────────────────────────────────────┐
│ PLAN GENERATION ENGINE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ EXERCISE │───▶│ CAPABILITY │ │
│ │ SELECTOR │ │ RECOMMENDER │ │
│ └─────────────────┘ └────────┬────────┘ │
│ │ │ │
│ │ Equipment, │ Rep ranges, │
│ │ Goals, Experience │ Sets, Load │
│ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ PERIODIZATION │◀───│ ADAPTIVE │ │
│ │ ENGINE │ │ LEARNING │ │
│ └─────────────────┘ └─────────────────┘ │
│ │ ▲ │
│ │ Phase structure, │ Performance │
│ │ Progressive overload │ feedback │
│ ▼ │ │
│ ┌─────────────────────────────────────────┐ │
│ │ GENERATED PLAN │ │
│ └─────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Component 1: Exercise Selector
Chooses exercises based on user constraints and goals.
Selection Factors
| Factor | Weight | Description |
|---|---|---|
| Equipment Match | High | Only selects exercises user can perform |
| Goal Alignment | High | Prioritizes exercises that match primary goal |
| Muscle Freshness | Medium | Avoids overworking recently trained muscles |
| User Preference | Medium | Respects liked/disliked exercises |
| Variation | Low | Introduces variety to prevent staleness |
| Injury Avoidance | Critical | Excludes exercises that aggravate injuries |
Selection Logic
1. Filter by equipment availability
2. Filter by injury/limitation exclusions
3. Score by goal alignment (compound vs isolation ratio)
4. Score by muscle freshness (48-72hr recovery)
5. Apply user preference modifiers
6. Select top candidates per muscle group
Component 2: Capability Recommender
Determines appropriate sets, reps, and load for each exercise.
Goal-Based Prescriptions
| Goal | Rep Range | Sets | Rest | Intensity (%1RM) |
|---|---|---|---|---|
| Strength | 1-5 | 4-6 | 3-5 min | 85-95% |
| Hypertrophy | 6-12 | 3-4 | 60-90 sec | 65-80% |
| Endurance | 12-20+ | 2-3 | 30-60 sec | 50-65% |
| Power | 1-5 | 3-5 | 2-3 min | 70-85% (explosive) |
Load Calculation
estimated_load = (estimated_1RM × intensity_percentage)
For new exercises without history:
- Use body weight ratios for compounds
- Start conservative (65% of expected) for first session
- Auto-adjust based on RIR (Reps in Reserve) feedback
Component 3: Periodization Engine
Structures training across weeks and phases.
Training Phases
| Phase | Duration | Volume | Intensity | Focus |
|---|---|---|---|---|
| Accumulation | 3-4 weeks | High | Moderate (65-75%) | Build work capacity |
| Intensification | 2-3 weeks | Moderate | High (75-85%) | Increase weight |
| Realization | 1-2 weeks | Low | Peak (85-95%) | Test PRs |
| Deload | 1 week | 50% | 50-60% | Recovery |
Progressive Overload Rules
IF completed_reps >= target_reps AND RIR <= 2:
next_session_weight += 2.5-5 lbs (upper) or 5-10 lbs (lower)
IF completed_reps < target_reps - 2:
maintain_weight OR reduce by 5%
IF missed_session OR low_energy:
maintain_weight, focus on execution
Component 4: Adaptive Learning
Continuously improves recommendations based on performance data.
Adjustment Signals
| Signal | Adjustment |
|---|---|
| Exceeded rep target | Increase weight next session |
| Failed to hit reps | Maintain or decrease weight |
| High fatigue rating | Suggest deload or reduce volume |
| Low fatigue + good performance | Consider adding volume |
| Consistent misses on exercise | Swap for variation or reduce load |
| PR achieved | Celebrate, recalculate 1RM estimates |
Muscle Freshness Tracking
Each muscle group has a recovery score (0-100):
- 0: Just trained, needs recovery
- 50: Partially recovered (24-36 hours)
- 75: Mostly recovered (36-48 hours)
- 100: Fully recovered (48-72+ hours)
Schedule workouts to target muscles at 75%+ freshness
Readiness System
Before each workout, assess user readiness to modify the session.
Readiness Factors
| Factor | Weight | Assessment |
|---|---|---|
| Sleep Quality | 30% | Hours slept, quality rating |
| Stress Level | 25% | Work, life stress indicators |
| Muscle Soreness | 20% | DOMS from previous sessions |
| Energy Level | 15% | Current perceived energy |
| Motivation | 10% | Mental readiness to train |
Readiness Score Actions
90-100%: Full workout as planned
70-89%: Reduce volume by 10-20% or intensity by 5-10%
50-69%: Light workout, focus on technique and movement
<50%: Suggest active recovery or rest day (Sage takes over)
Deload Detection
Automatic Triggers
DELOAD TRIGGERS:
├── Planned: Every 4-6 weeks based on periodization
├── Performance: 2+ sessions with declining performance
├── Fatigue: Consistently high fatigue ratings (7+/10)
├── Life stress: User reports high external stress
└── Request: User manually requests a lighter week
Deload Protocol
DELOAD PROTOCOL:
├── Volume: Reduce to 50-60% of normal
├── Intensity: Reduce to 50-70% of working weights
├── Focus: Technique, mobility, recovery
└── Duration: 1 week (3-5 light sessions)
Mini-PRs & Celebrations
Track and celebrate small wins to maintain motivation.
| Mini-PR Type | Description | Example |
|---|---|---|
| Weight PR | New max weight for any rep range | "New 8-rep max on bench!" |
| Volume PR | Most sets × reps × weight in session | "Most total volume on leg day!" |
| Streak PR | Consecutive workout completions | "10 workouts in a row!" |
| Consistency PR | Best weekly/monthly adherence | "100% adherence this month!" |
| Form PR | First time completing new movement | "Mastered the Romanian deadlift!" |