Some months ago, I participated in a two-week experiment that involved using a smartphone app to track every morsel of food I ate, every beverage I drank and every medication I took, as well as how much I slept and exercised. I wore a sensor that monitored my blood-glucose levels, and I sent in a sample of my stool for an assessment of my gut microbiome. All of my data, amassed with similar input from more than a thousand other people, was analyzed by artificial intelligence to create a personalized diet algorithm. The point was to find out what kind of food I should be eating to live a longer and healthier life.

The results? In the sweets category: Cheesecake was given an A grade, but whole-wheat fig bars were a C -. In fruits: Strawberries were an A+ for me, but grapefruit a C. In legumes: Mixed nuts were an A+, but veggie burgers a C. Needless to say, it didn’t match what I thought I knew about healthy eating.

It turns out, despite decades of diet fads and government-issued food pyramids, we know surprisingly little about the science of nutrition. It is very hard to do high-quality randomized trials: They require people to adhere to a diet for years before there can be any assessment of significant health outcomes. The largest ever — which found that the “Mediterranean diet” lowered the risk for heart attacks and strokes — had to be retracted and republished with softened conclusions. Most studies are observational, relying on food diaries or the shaky memories of participants. There are many such studies, with over a hundred thousand people assessed for carbohydrate consumption, or fiber, salt or artificial sweeteners, and the best we can say is that there might be an association, not anything about cause and effect. Perhaps not surprisingly, these studies have serially contradicted one another. Meanwhile, the field has been undermined by the food industry, which tries to exert influence over the research it funds.

Now the central flaw in the whole premise is becoming clear: the idea that there is one optimal diet for all people.