Skip to content

Journal / Food

My Software Designed My Meal Plan — What I Plan To Improve

I created an algorithm for thirty-plus nutrition targets. Twice the folate and vitamin K led me to plan better food choices, constraints, and review.

The optimizer hit the targets—and surprised me

I created the algorithm that built my meal plan against more than thirty nutrition targets. The result included roughly twice the recommended folate and twice the recommended vitamin K. My first reaction was that something must be wrong. The more useful question was what the numbers actually meant, where the nutrients came from, and what I had asked my software to optimize.

Those multiples are my reported output, not a verified dietary assessment. Without the full ingredient weights, database records, and source-specific nutrient totals, nobody should infer a diagnosis or declare the whole plan safe. But the apparent excess illustrates a real distinction: a recommended intake is not automatically a toxicity threshold.

Folate intake: food sources, DFE, and upper limits

The recommended dietary allowance for folate is 400 micrograms of dietary folate equivalents (DFE) per day for most adults. An intake of 800 micrograms DFE represents 200% of that reference. No tolerable upper intake level has been established for naturally occurring folate in food. The adult upper limit of 1,000 micrograms per day applies to folic acid from supplements and fortified foods, not natural food folate. High folic acid intake can correct the anemia associated with vitamin B12 deficiency without preventing its neurological damage, potentially delaying recognition of the deficiency. 1

DFE accounts for differences in absorption between natural food folate and folic acid; the two quantities are not interchangeable. Evaluating a meal plan therefore requires separate totals for natural folate, fortified ingredients, and supplements, expressed in consistent units. A result of twice the recommended intake does not, by itself, establish either excessive intake or safety: its interpretation depends on the folate source, the applicable upper limit, and individual health circumstances. 1

Twice the vitamin K is not automatically a problem

Vitamin K has an adequate intake (AI), rather than an RDA, of 120 micrograms per day for adult men and 90 for adult women. Twice those references is about 240 or 180 micrograms respectively. No tolerable upper intake level has been established because of its low observed toxicity. For many otherwise healthy adults eating ordinary foods, twice the AI is not inherently alarming. It also is not a target worth chasing just because more fits in the model. 2

The important exception is medication. With warfarin and related vitamin-K-antagonist treatment, intake should remain consistent and dietary changes need discussion with the treating clinician. “No established upper limit” does not mean unlimited intake is appropriate for every person. Individual health conditions and the rest of the diet still matter. 2

Feasible is not the same as sensible

If the model minimizes cost while requiring every nutrient to exceed a minimum, it has no reason to stop oversupplying a nutrient without a penalty or upper constraint. A small food catalogue makes this worse: one food may cover several difficult targets cheaply, so the optimizer leans on it repeatedly. That can produce enormous portions, monotonous meals, or totals that look impressive while ignoring taste and practicality.

Adding more food options can give the optimizer alternatives, but it does not guarantee a better plan. Bad database values or missing constraints remain bad regardless of catalogue size. I would check raw versus cooked weights, serving units, edible portions, and whether an omitted nutrient is genuinely zero or simply unknown.

What I plan to build next

My next iteration will add realistic portion caps, an energy range, appropriate protein and fiber targets, budget and preparation limits, and limits on repeated foods. I plan to model genuine nutrient upper limits where they exist, distinguishing supplements and fortification from natural food sources. For nutrients without an established upper limit, I want a preference penalty to discourage needless excess without inventing a medical safety ceiling.

Soft goals can reward variety and proximity to a sensible target; hard constraints can protect real limits. If the requirements cannot all be met, the software should explain which constraints conflict—not silently relax a safety bound or label an infeasible result optimal. A weekly view can reduce needless perfectionism, but should not hide large daily supplement doses or clinically important fluctuations.

I plan to expand the food catalogue, audit the nutrient units, and test those constraints against practical meals before relying on the next result. Human review will remain part of that process. These are improvements I intend to make—not features I am claiming are already finished. The goal is a plan that meets the nutritional brief and is something I actually want to cook and eat.

NutritionMeal Prep

Comments (1)

Demo discussion
  • Jeremy Holland

    Jeremy@orangeduck930

    The distinction between naturally occurring folate and folic acid changes how I read the twice-reference figure.

    Elsewhere in the notebook