As complex as it might be, the "intelligence" would probably be the easy part. Aggregating that data in a way that didn't become a burden for the user--either because its tedious, or because they don't trust you--would be quite a trick.
Then another trick will be surviving the attempts of stores and food manufactures to screw with this system as it becomes popular, because individuals empowered to make good choices for themselves hurt everyone's bottom line.
“Burden for the user” - why not make this a burden for the AI instead? Have the AI do some web-crawling.
Because it would have to crawl into my refrigerator to see when my milk expires and into... I don't know where... to know that I didn't eat enough vitamin A yesterday. Data that's not on the web.