In Ayurveda & Asana Yoga, the meal-planning tools in the Generate workspace (`DeterministicMealPlanSolver` and `USDAWeeklyMealPlanner`) are built to assemble structured daily and weekly meal plans from the app's local catalog of foods, dravyas, and 1,511 recipes.
Inspecting the native architecture shows why its numbers behave consistently: candidate selection, exclusion screening (`AyurvedaRecommendationGate`), and gram-weight macro adjustments (`PlannerMacroGoalAdjuster`) are performed deterministically in Swift code rather than by free-form text guessing, while a separate narrator (`MP6MealPlanNarrator`) generates concise meal slot titles with an automatic template fallback.
This guide explains how each stage of the planner works and the five manual checks you should always run before shopping or cooking.
How the Deterministic Solver, Macro Goal Adjuster, and Recommendation Gate Work
When assembling meals, the planner first screens candidates through `AyurvedaRecommendationGate`, which excludes any food or linked dravya profile marked `engineExcluded`. Next, `PlannerMacroGoalAdjuster` evaluates macro constraints (`protein`, `fat`, `carbohydrates` with `exactly`, `lessThan`, or `moreThan` targets) using each item's USDA nutrient density per gram—adjusting items whose nutrient density exceeds `5 g per 100 g` while enforcing a `20 g` minimum adjusted portion floor.
Crucially, as documented in `MP5FeatureFlags` inside `DeterministicMealPlanSolver.swift`, the experimental `aiDraft` Ayurvedic scoring objective (`MP5AyurvedicSolverEnabled`) is deliberately turned **off by default** in standard runs so that unreviewed `aiDraft` scores do not override structural nutritional assembly. Finally, `MP6MealPlanNarrator` generates readable meal titles using on-device `FoundationModels` when running on supported iOS 26+ hardware (within an 8-second wall-clock budget), or falls back immediately to deterministic `MP6TemplateNarrator` titles on older iOS versions or unsupported devices.
- Deterministic Macro Math (`PlannerMacroGoalAdjuster`): Scales portion grams using actual per-gram protein, fat, and carbohydrate densities (with a 20 g minimum portion floor).
- Exclusion Gate (`AyurvedaRecommendationGate`): Blocks `engineExcluded` catalog profiles and aliases from automated recommendations.
- Template Narration Fallback (`MP6TemplateNarrator`): Meal generation works even when on-device `FoundationModels` (iOS 26+) is unavailable.
5 Essential Human Checks Before You Shop or Cook
Because all 704 dravyas and 1,511 recipes in the catalog are marked as `aiDraft` educational records, any generated meal plan should be treated as a structured kitchen draft rather than a clinical prescription.
Before transferring a generated plan to your Shopping List or Calendar, spend three minutes verifying five practical details.
- 1. Strict Food Allergy & Celiac Check: Always read the full ingredient list of every suggested recipe and packaged food for the 9 major U.S. allergens (milk/ghee, wheat/hing, sesame, peanuts, tree nuts, soy, egg, fish, shellfish) and gluten.
- 2. Realistic Weekday Prep Time: Check `prepMinutes` and `cookMinutes`—swap a long-fermented batter for a 25-minute mung dal or kitchari on busy worknights.
- 3. Leftover Batching: Cook 4 servings of a dinner dal or vegetable curry once and schedule the leftover portions for the next day's lunch.
- 4. Key Vegetarian Micronutrients: Verify that your weekly plan includes reliable sources of vitamin B12, calcium, iron (paired with vitamin C), and zinc.
- 5. Medical Conditions: Pregnancy, lactation, diabetes, kidney disease, and digestive disorders require individualized guidance from a physician or registered dietitian.
How to Customize a Generated Plan into a Practical Routine
Use the generator to overcome decision fatigue, then adjust portion weights or swap vegetables freely to match what is already in your refrigerator Storage.
Reviewing the resulting week in Analytics lets you see how your customized plan averages out across multiple days.
- Generate a baseline meal plan and inspect the individual food items and gram weights in each meal slot.
- Swap any unfamiliar or time-intensive dish for a familiar household staple with similar protein and fiber.
- Cross-check your existing batches in Storage before adding the remaining items to your Shopping List.
Sources & Classical References
- USDA FoodData Central — Documentation — Documentation on USDA nutrient profiles underlying food and recipe meal-planning calculations.
- U.S. FDA — Food Allergies: What You Need to Know — FDA safety guidance on verifying major food allergens on ingredient labels.
- Linus Pauling Institute Micronutrient Information Center — Micronutrient Inadequacies Overview — Academic reference on planning nutrient-dense diets across the week.





