I'm sure there are companies who'd love to develop something like this. And collect that information about exactly what groceries you currently have and statistics of how you consume them, so they can sell it to advertisers. Not advertisers that sell these groceries, of course - for these the AI company could just make the AI buy them from suppliers that pay them.
They already exist and have been doing this for a long time, they are just using dumber versions of deep learning than what we have right now.
Less about giving your personal information to an advertiser though and more about using aggregate data trends to guide marketing efforts.
Like if you know buns and hotdogs sell like crazy the week before July 4th merchandizing bundles of both that override brand purchase intent on favor of convenience and discount.
An example of this kind of market research in action would be a clothes store that knows 20% of its sales were to people who shopped the day before they came back to buy offering 48hr exit coupons that would be valid the next day for a limited time.
The personalized data is used in house at these aggregators to market to you directly, such as the war and peace length personalized coupons on receipts where they've been contracted by the retailers.
Not just advertisers, it would also get sold to food manufacturers and product developers. This is not so bad though cause it helps new products come out that might be in line with what you want