Skip to content
Mar 2023·9 minBuildingEN/DE

meal metrics ai

grandma's recipes don't come with nutrition labels. an api that structures any recipe and calculates macros.

the origin

it started with massimo bottura's tortellini in crema di parmigiano. i love cooking, not meal prep but the three-hours-on-one-dish kind where the process matters as much as the plate, and i also track everything i eat, not out of restriction but out of curiosity, because longevity is less about deprivation than about understanding what you actually put in your body. so there i was with this beautiful thing, hand-folded tortellini, an aged parmigiano cream, a whisper of nutmeg, wanting simply to log it, and i hit a wall. the recipe said "a generous handful of parmigiano." how much is generous, thirty grams or eighty? "reduce the cream until it coats the spoon," so how much cream is even left? the filling was mortadella, prosciutto and pork loin in ratios nobody had written down. i spent an hour reverse-engineering the macros of a dish i had just spent three hours perfecting. i could execute a michelin-level recipe and could not tell you its protein content within twenty grams, and that is not a one-time problem. it happens to anyone who refuses to choose between eating well and eating informed.

the numbers don't add up, literally

the frustration sent me down a rabbit hole, and the deeper i went the worse it got. half a billion people follow fitness content on instagram, there are billions of recipe videos across youtube, tiktok and instagram, and the USDA food database holds more than four hundred thousand entries, yet there is no standard way to connect any of it to anything else. the recipes themselves barely try. "a splash of olive oil" is anywhere from five to thirty milliliters, which is the difference between nothing and 240 calories; "season generously" is a shrug; "reduce until thick" hides a thirty-to-fifty-percent change in concentration. then comes the part most trackers ignore entirely, which is that the cooking method rewrites the numbers. work published in the korean journal for food science of animal resources found that boiling chicken instead of roasting it can cut the protein you actually eat by close to a quarter, because the protein leaches straight into the water. one choice at the stove, a double-digit swing in your macros.

nutrition is a graph problem, not a database problem

i come from design, so i tend to see the system before the screen, and the thing i kept seeing is that nutrition is not really a database problem at all. it is a graph problem. a calorie tracker thinks "100g chicken breast equals 31g protein" and calls it done, but that is not how food behaves. the USDA can tell me a hundred grams of parmigiano holds about thirty-six grams of protein; it cannot tell me how much parmigiano ends up in the pan when the recipe says "a generous handful," or what the cream becomes after it reduces, or how the pasta's weight shifts as it drinks water. a database stores facts in isolation. a graph stores relationships, between an ingredient, its preparation, the method that cooks it and the nutrition that comes out the other end. it is the difference between "what is chicken breast" and "what happens to chicken breast when i roast it rather than boil it, and how does that change if i marinate it first." the problem was never missing data. it was missing connections.

the chemistry underneath

the reason that gap matters is chemistry. protein starts denaturing around forty degrees, which can make it more digestible but can also, under long heat, cross-link and lose some bioavailability. the maillard reaction that browns a roast above a hundred and forty degrees tastes wonderful and quietly spends some of the amino acids it touches. water-soluble nutrients leach into whatever liquid surrounds them, which is exactly why boiled chicken comes out lighter on protein than roasted, holding roughly 77% against 100% when you are not also drinking the broth. fat-soluble vitamins run the opposite way, so a little oil in the pan makes the vitamins in your vegetables more available than eating them raw. all of which is why "100g chicken equals 31g protein" is not merely imprecise, it is the wrong shape of answer. the method is part of the equation.

the architecture

meal metrics turns arbitrary recipe content into structured nutrition in three moves. first it ingests the source, whether that is a blog post, a cookbook scan, an instagram caption or a cooking video, parsing text directly, running OCR over images and transcribing audio with whisper. then comes the hard middle step, ingredient resolution, where "a handful of spinach" has to become "thirty grams of raw spinach" with an honest confidence score attached, inferring from context that a smoothie means raw and packed while a pasta sauce means wilted, and learning that a cup is 240 milliliters to an american and 250 to everyone on the metric system. finally it queries a knowledge graph, built in neo4j across tens of thousands of ingredients and a couple hundred cooking methods, which holds nutrient-retention coefficients drawn from peer-reviewed work.

that last layer is where the whole thing earns its name, because it can answer a question a lookup table cannot. ask what happens if you roast the chicken instead of boiling it, and the graph does not guess, it calculates from published coefficients:

methodbreastwingleg
roasting100%94%100%
steaming98%95%96%
pan-frying95%89%93%
boiling77%83%77%

roasted chicken keeps more protein than boiled, which runs straight against the folk wisdom that boiling is the "healthy" option. if you are not drinking the broth, you are quietly losing close to a quarter of the protein you thought you ate. the extraction that feeds the graph runs on claude, with the fast parsing on haiku 4.5 and the ambiguous interpretation on sonnet 4.6, and it leans on schema-constrained structured outputs so the JSON it returns is valid by construction rather than by hopeful retry. every value carries a confidence score, because a system that guesses should at least be honest that it is guessing.

where it stands

built in public, partly built. ingredient parsing currently lands the core fields, name, quantity and unit, correctly about 84% of the time, and the missing sixteen percent is not random: it clusters in ambiguous brand references like "protein powder" with no spec, regional terms like aubergine against eggplant, genuinely new ingredients like cauliflower rice and zoodles, and unclear prep states like "cooked chicken" that never says boiled or roasted. the deepest open problem is not storage, it is meaning, the leap from "add garlic to taste" to an actual number, which depends on the cuisine and the rest of the dish and really wants a probabilistic layer sitting on top of the graph. the long tail of cooking methods, sous vide and pressure cooking and fermentation, simply lacks systematic published data. and the system is english-only, which is less a translation problem than a cultural one, since german "quark" has no clean english equivalent and forcing one would be its own kind of error.

the limits

i would rather name the hard parts than let them surface later. 84% is fine for tracking dinner and not fine for medical nutrition therapy, where a renal or diabetic diet needs clinical-grade numbers this system does not pretend to give, which is why it states its uncertainty instead of hiding it. it works on population averages, while real absorption bends with gut microbiome, genetics and medication. and there is an ethical edge that weighs more than the technical ones: research has tied calorie-tracking apps to disordered eating, with one study finding that a majority of users who had an eating disorder felt the app contributed to it. that shapes the design directly. no streaks, no badges, no red-and-green moral scoring of a meal, no framing food as good or bad by its numbers, and clear off-ramps when the pattern of use starts to look concerning. a tool that influences what people eat carries responsibility, and pretending it does not would be the real failure.

the point

nutrition was never really a data problem, it is a relationships problem, and we have spent years storing the facts while throwing away the connections between them. the comprehensive databases exist, the bioavailability research exists, the billions of recipe videos exist, and none of them know the others are there. meal metrics is the connective tissue, a graph that reads food the way cooking actually behaves, ingredient to preparation to method to outcome, rather than as a flat table of numbers. it lands the core fields about 84% of the time today and stays honest about the rest, and the road ahead is real research: the ambiguity of measurement, the long tail of cooking methods, an ontology supple enough to call tofu a protein or a vegetable depending on who is asking, and more languages. i loved the dish that started all this. i only wanted to know what was in it, and that turned out to be the harder recipe.

references

  1. USDA Agricultural Research Service. (2024). FoodData Central.
  2. Oz, F., Aksu, M.I. & Turan, M. (2017). A Comparison of the Essential Amino Acid Content and the Retention Rate by Chicken Part according to Different Cooking Methods. Korean Journal for Food Science of Animal Resources, 37(5), 739-749.
  3. Deng, Y. et al. (2022). Applications of knowledge graphs for food science and industry. Patterns, 3(5), 100484.
  4. Haussmann, S. et al. (2019). FoodKG: A Semantics-Driven Knowledge Graph for Food Recommendation. ISWC 2019.
  5. FoodOn Consortium. (2024). FoodOn: A farm-to-fork ontology.
  6. Anthropic. (2026). Structured Outputs Documentation.
  7. Anthropic. (2026). Claude Model Cards.
  8. Radford, A. et al. (2023). Robust Speech Recognition via Large-Scale Weak Supervision (Whisper). ICML 2023.
  9. Chia, Y.K. et al. (2022). Enhancing Food Ingredient Named-Entity Recognition with a Recurrent Network-Based Ensemble (RNE) Model. Applied Sciences, 12(20), 10310.
  10. Palermo, M. et al. (2014). The effect of cooking on the nutritional quality of vegetables and legumes. International Journal of Gastronomy and Food Science, 3, 2-11.
  11. Rinaldi, M. et al. (2022). Cooking at home to retain nutritional quality and minimise nutrient losses. Trends in Food Science & Technology, 126, 227-241.
  12. Levinson, C.A. et al. (2017). My Fitness Pal calorie tracker usage in the eating disorders. Eating Behaviors, 27, 14-16.
  13. Neo4j, Inc. (2024). Neo4j Graph Database Documentation.
  14. Bai, Y. et al. (2022). Constitutional AI: Harmlessness from AI Feedback. arXiv:2212.08073.

last updated: Jun 2026