Loading...
Loading...
Analyze nutrition data, identify nutrition patterns, assess nutritional status, and provide personalized nutrition recommendations. Supports correlation analysis with exercise, sleep, and chronic disease data.
npx skill4agent add huifer/wellally-health nutrition-analyzerdata-example/nutrition-tracker.jsondata-example/nutrition-logs/YYYY-MM/YYYY-MM-DD.jsondata-example/profile.jsondata-example/fitness-tracker.jsondata-example/sleep-tracker.jsondata-example/hypertension-tracker.jsondata-example/diabetes-tracker.jsonrda_achievement = (actual_intake / rda_value) * 100
status_classification:
- < 50%: Severe deficiency
- 50-75%: Insufficient
- 75-100%: Approaching target
- 100-150%: Adequate (ideal range)
- > 150%: Excess (note safety upper limit UL)nutrient_density_score = (
(vitamins_achieved / total_vitamins) * 40 +
(minerals_achieved / total_minerals) * 30 +
(fiber_achieved / fiber_rda) * 30
)# Nutrient Intake Trend Analysis Report
## Analysis Period
March 20, 2025 to June 20, 2025 (3 months, 90 days of records)
## Macronutrient Trends
### Calorie Intake
- **Trend**: ⬇️ Declining
- **Start**: Average 2100 calories/day
- **Current**: Average 1950 calories/day
- **Change**: -150 calories/day (-7.1%)
- **Interpretation**: Moderate reduction in calorie intake, consistent with weight loss goals
**Trend Line**:
### Protein
- **Trend**: ➡️ Stable
- **Average**: 82g/day (range: 70-95g)
- **Target**: 80g/day
- **Achievement Rate**: 93% (84/90 days met target)
- **Interpretation**: Stable protein intake, basically meets target
### Dietary Fiber
- **Trend**: ⬆️ Improving
- **Start**: Average 18g/day
- **Current**: Average 22g/day
- **Change**: +4g/day (+22%)
- **Target**: 30g/day
- **Interpretation**: Significant increase in fiber intake, but continued effort is needed
### Fat
- **Trend**: ⬇️ Declining
- **Start**: Average 75g/day
- **Current**: Average 68g/day
- **Change**: -7g/day (-9.3%)
- **Target**: ≤65g/day
- **Interpretation**: Reduced fat intake, close to target
**Fat Type Distribution Changes**:
| Fat Type | Start | Current | Target | Trend |
|---------|------|------|------|------|
| Saturated Fat | 25g | 20g | <20g | ⬇️ Improving |
| Monounsaturated | 30g | 32g | >35g | ⬆️ Slightly increased |
| Polyunsaturated | 15g | 12g | 15-20g | ⬇️ Need to increase |
| Trans Fat | 2g | 0.5g | 0g | ⬇️ Improving |
## Vitamin Status Trends
### Vitamin D
- **Intake Trend**: ⬆️ Increased (supplement started)
- **Start**: Average 2μg/day (dietary sources)
- **Current**: Average 52μg/day (including 2000IU supplement)
- **RDA**: 15μg/day
- **Serum Level Changes**:
- Baseline (May 2025): 18 ng/mL
- Current (June 2025): 22 ng/mL
- Target: 30-100 ng/mL
- **Interpretation**: ✅ Supplement is effective, but continued monitoring is needed
### Vitamin C
- **Trend**: ⬆️ Improving
- **Start**: Average 65mg/day
- **Current**: Average 85mg/day
- **RDA**: 100mg/day
- **Achievement Rate**: From 65% → 85%
- **Suggestion**: Increase citrus fruits, kiwis, strawberries, etc.
### B Vitamins
- **Vitamin B12**: ✅ Adequate (average 2.5μg, RDA 2.4μg)
- **Folate**: ⚠️ Insufficient (average 320μg, RDA 400μg)
- **B6**: ✅ Adequate (average 1.5mg, RDA 1.3mg)
## Mineral Trends
### Calcium
- **Trend**: ➡️ Stable
- **Average**: 850mg/day
- **RDA**: 1000mg/day
- **Achievement Rate**: 85%
- **Main Sources**: Dairy 40%, Tofu 25%, Leafy greens 20%
### Iron
- **Trend**: ✅ Adequate
- **Average**: 12mg/day
- **RDA**: 8mg/day (male)
- **Achievement Rate**: 150%
- **Main Sources**: Meat, eggs, beans, leafy greens
### Sodium
- **Trend**: ⬇️ Improving
- **Start**: Average 2800mg/day
- **Current**: Average 2100mg/day
- **Target**: <2300mg/day (ideal <1500mg)
- **Interpretation**: ✅ Meets general target, ⚠️ Still need to work towards ideal target
### Potassium
- **Trend**: ⬆️ Improving
- **Start**: Average 2800mg/day
- **Current**: Average 3200mg/day
- **Target**: 3500-4700mg/day
- **Potassium/Sodium Ratio**: From 1.0 → 1.5 (target >2)
- **Suggestion**: Continue to increase fruits and vegetables
## Special Nutrient Trends
### Omega-3
- **Trend**: ⬆️ Increased (fish oil supplement)
- **Start**: Average 150mg/day
- **Current**: Average 850mg/day (including supplement)
- **Recommended Amount**: 500-1000mg/day
- **Status**: ✅ Meets target
### Choline
- **Trend**: ➡️ Stable
- **Average**: 350mg/day
- **AI (Adequate Intake)**: 425mg/day
- **Achievement Rate**: 82%
- **Main Sources**: Eggs (60%), Meat (25%), Beans (15%)
## Diet Pattern Analysis
### Food Category Distribution
| Food Category | Proportion | Change | Evaluation |
|---------|------|------|------|
| Vegetables and Fruits | 35% | +8% | ✅ Increased |
| Whole Grains | 20% | +5% | ✅ Improved |
| Refined Grains | 15% | -7% | ✅ Reduced |
| Protein Sources | 20% | Stable | ✅ Adequate |
| Added Fats | 8% | -3% | ✅ Reduced |
| Added Sugars | 2% | -2% | ✅ Reduced |
### Meal Time Pattern
- **Average Eating Window**: 12.5 hours (07:30 - 20:00)
- **Eating Frequency**: Average 4.2 times/day
- **Most Common Meal Times**:
- Breakfast: 07:30 (90% of days)
- Lunch: 12:15 (95% of days)
- Dinner: 18:45 (98% of days)
- Snack: 15:30 (60% of days)
### Diet Quality Score
- **Nutrient Density Score**: 7.2/10 (up from 6.5)
- **Food Diversity Score**: 6.8/10
- **Balanced Diet Score**: 7.5/10
- **Overall Score**: 7.2/10 → **Good**
## Insights and Recommendations
### Key Insights
1. **Dietary fiber continues to improve but is still insufficient**
- Increased from 18g to 22g, but still below the target of 30g
- Impacts: satiety, gut health, blood glucose control
- Suggestion: Include at least 5g of fiber per meal
2. **Fat quality improved**
- Reduced saturated fat, almost eliminated trans fat
- Slightly low polyunsaturated fat, need to increase Omega-3 foods
- Suggestion: Increase deep-sea fish, nuts, flaxseeds
3. **Sodium intake improved but potassium/sodium ratio is still low**
- Sodium reduced by 33%, potassium increased by 14%
- Potassium/sodium ratio rose from 1.0 to 1.5, still below target of 2.0
- Suggestion: Continue to increase high-potassium foods (bananas, oranges, potatoes, spinach)
4. **Vitamin D supplement is effective**
- Serum level increased from 18 to 22 ng/mL (+4ng in 4 weeks)
- Expected to reach target range in 3-4 months
- Suggestion: Continue supplementation and monitor regularly
### Priority Action Plan
#### Priority 1: Increase dietary fiber to 30g/day (2 weeks)
**Specific Actions**:
1. Breakfast: Whole grains (oatmeal/whole wheat bread) + fruit (9g)
2. Lunch: Brown rice/whole wheat noodles + 2 servings of vegetables (8g)
3. Dinner: Sweet potato/mixed grains + 2 servings of vegetables (8g)
4. Snack: Fruit + nuts (5g)
**Total**: 30g ✅
#### Priority 2: Optimize potassium/sodium ratio to 2.0 (4 weeks)
**Specific Actions**:
1. Reduce processed foods (main sodium source)
2. 2-3 servings of high-potassium fruits per day (bananas, oranges, kiwis)
3. Choose vegetables like spinach, potatoes, mushrooms, tomatoes
4. Use spices instead of salt for seasoning
#### Priority 3: Maintain vitamin D supplementation (long-term)
**Monitoring Plan**:
- Recheck serum level after 3 months
- Target: 40-60 ng/mL
- Adjust dosage based on results
## Nutrition Target Progress
| Target | Start | Current | Target Value | Progress | Status |
|------|------|------|--------|------|------|
| Calories | 2100 | 1950 | 1800-2000 | 100% | ✅ Met |
| Protein | 75g | 82g | 80g | 100% | ✅ Met |
| Dietary Fiber | 18g | 22g | 30g | 73% | ⚠️ In progress |
| Vitamin D | 18 ng/mL | 22 ng/mL | 30-100 | 20% | ⚠️ Improving |
| Sodium Intake | 2800mg | 2100mg | <2300 | 100% | ✅ Met |
| Omega-3 | 150mg | 850mg | 500-1000mg | 100% | ✅ Met |
---
**Report Generation Time**: June 20, 2025
**Analysis Period**: March 20, 2025 to June 20, 2025 (90 days)
**Number of Data Records**: 90 days
**Nutrition Analyzer Version**: v1.0{
"date": "2025-06-20",
"meals": [
{
"type": "breakfast",
"time": "07:30",
"foods": ["egg", "milk", "whole wheat bread"],
"calories": 450,
"macronutrients": {
"protein_g": 20,
"carbs_g": 55,
"fat_g": 15,
"fiber_g": 5,
"saturated_fat_g": 5,
"monounsaturated_fat_g": 6,
"polyunsaturated_fat_g": 3,
"trans_fat_g": 0.1
},
"micronutrients": {
"vitamin_a_mcg": 150,
"vitamin_c_mg": 5,
"vitamin_d_mcg": 1.5,
"vitamin_e_mg": 1,
"vitamin_k_mcg": 5,
"thiamine_mg": 0.3,
"riboflavin_mg": 0.4,
"niacin_mg": 4,
"vitamin_b6_mg": 0.1,
"folate_mcg": 30,
"vitamin_b12_mcg": 0.6,
"calcium_mg": 250,
"iron_mg": 2,
"magnesium_mg": 40,
"phosphorus_mg": 200,
"zinc_mg": 2,
"selenium_mcg": 10,
"potassium_mg": 350,
"sodium_mg": 300
},
"special_nutrients": {
"omega_3_g": 0.1,
"choline_mg": 150
}
}
],
"daily_summary": {
"total_calories": 2000,
"total_macronutrients": {
"protein_g": 80,
"carbs_g": 250,
"fat_g": 65,
"fiber_g": 30
},
"rda_achievement": {
"protein": 100,
"vitamin_c": 85,
"vitamin_d": 35,
"calcium": 90,
"iron": 75
},
"goal_achieved": true
}
}def calculate_rda_achievement(actual_intake, rda_value, ul_value=None):
"""
Calculate RDA achievement rate and status
Parameters:
- actual_intake: Actual intake amount
- rda_value: Recommended Dietary Allowance
- ul_value: Tolerable Upper Intake Level (optional)
Returns:
- achievement_rate: Achievement rate percentage
- status: Status label
"""
achievement_rate = (actual_intake / rda_value) * 100
if ul_value and actual_intake > ul_value:
status = "exceeds_ul"
category = "Excess (Dangerous)"
elif achievement_rate < 50:
status = "severe_deficiency"
category = "Severe Deficiency"
elif achievement_rate < 75:
status = "insufficient"
category = "Insufficient"
elif achievement_rate < 100:
status = "approaching_target"
category = "Approaching Target"
elif achievement_rate <= 150:
status = "adequate"
category = "Adequate"
else:
status = "high_intake"
category = "High"
return {
'achievement_rate': round(achievement_rate, 1),
'status': status,
'category': category
}def calculate_nutrient_density_score(meal_data):
"""
Calculate food nutrient density score (0-10 points)
Factor Weights:
- Vitamin achievement rate: 40%
- Mineral achievement rate: 30%
- Dietary fiber: 20%
- Restrictive nutrients (saturated fat, sodium, added sugar): 10%
"""
score = 0
# Vitamin score
vitamin_achievements = [
meal_data['micronutrients'][v] / RDA[v]
for v in ['vitamin_a', 'vitamin_c', 'vitamin_d', 'vitamin_e', 'vitamin_k']
]
vitamin_score = min(sum(vitamin_achievements) / len(vitamin_achievements), 1.5) * 10
score += min(vitamin_score, 10) * 0.40
# Mineral score
mineral_achievements = [
meal_data['micronutrients'][m] / RDA[m]
for m in ['calcium', 'iron', 'magnesium', 'zinc']
]
mineral_score = min(sum(mineral_achievements) / len(mineral_achievements), 1.5) * 10
score += min(mineral_score, 10) * 0.30
# Dietary fiber score
fiber_score = min(meal_data['macronutrients']['fiber_g'] / 5, 2) * 10
score += min(fiber_score, 10) * 0.20
# Restrictive nutrient penalty
penalty = 0
if meal_data['macronutrients']['saturated_fat_g'] > 10:
penalty += 2
if meal_data['micronutrients']['sodium_mg'] > 600:
penalty += 2
if meal_data.get('added_sugars_g', 0) > 10:
penalty += 2
score = max(0, score - penalty * 0.10)
return round(score, 1)def calculate_healthy_eating_index(daily_data):
"""
Calculate Healthy Eating Index (adapted from HEI-2015)
Score range: 0-100 points
"""
score = 0
# Adequacy components (50 points total)
# 1. Fruits (5 points)
fruit_servings = daily_data['fruit_servings']
score += min(fruit_servings, 2.5) * 2
# 2. Vegetables (5 points)
veg_servings = daily_data['vegetable_servings']
score += min(veg_servings, 3) * 1.67
# 3. Whole Grains (10 points)
whole_grains_oz = daily_data['whole_grains_oz']
score += min(whole_grains_oz, 3) * 3.33
# 4. Dairy (10 points)
dairy_servings = daily_data['dairy_servings']
score += min(dairy_servings, 3) * 3.33
# 5. Protein (5 points)
protein_oz = daily_data['protein_oz']
score += min(protein_oz, 5) * 1
# 6. Seafood/Plant Protein (5 points)
plant_protein_oz = daily_data['plant_protein_oz']
score += min(plant_protein_oz, 2) * 2.5
# 7. Fatty Acid Ratio (10 points)
fat_ratio = daily_data['unsaturated_fat_g'] / max(daily_data['saturated_fat_g'], 1)
score += min(fat_ratio, 2.5) * 4
# Moderation components (40 points total, reverse scoring)
# 8. Refined Grains (10 points, less is better)
refined_grains_oz = daily_data['refined_grains_oz']
score += max(10 - refined_grains_oz * 2, 0)
# 9. Sodium (10 points, less is better)
sodium_g = daily_data['sodium_mg'] / 1000
score += max(10 - sodium_g * 2, 0)
# 10. Added Sugars (10 points, less is better)
added_sugars_pct = daily_data['added_sugars_g'] / (daily_data['total_calories'] / 100)
score += max(10 - added_sugars_pct * 10, 0)
# 11. Saturated Fat (10 points, less is better)
saturated_fat_pct = daily_data['saturated_fat_g'] / (daily_data['total_calories'] / 100)
score += max(10 - saturated_fat_pct * 10, 0)
return round(score, 1)