Amazon didn’t acquire an iconic grocery store brand just for the quinoa: Whole Foods operates hundreds of retail data mines, and Amazon just married a world-class artificial intelligence team with one of the best sources of in-store consumer shopping data in the U.S.

There are lots of reasons, to be sure, why Amazon would want to spend $13.7 billion on Whole Foods. But the quintessential online retailer has been trying to establish a physical store presence for a few years now, and with one big check, it will now control more than 400 sources of prime data on consumer behavior.

Big-box grocery stores are easy sources of data on human purchasing behavior. Any modern retail outlet monitors activity such as customer flow through the aisles, brand affinity, and, of course, the customer loyalty cards that do as good a job of profiling a person as anything. After all, you are what you eat.

Amazon did not just buy Whole Foods grocery stores. It bought 431 upper-income, prime-location distribution nodes for everything it does. — Dennis K. Berman (@dkberman) June 16, 2017

Obviously, Amazon already collects a ton of data on consumer purchasing behavior, but it’s relatively new to groceries and brick-and-mortar retail in general. Whole Foods instantly gives Amazon a reliable source of the purchasing habits of well-off Americans, and that data can be used to train artificial intelligence models that will allow retailers to better predict demand and someday automate much of the labor involved in grocery retailing, no matter what the company said Friday about layoffs.

As Amazon’s Swami Sivasubramanian explained at our GeekWire Cloud Tech Summit last week, Amazon has “thousands of engineers focused on AI,” and a lot of that work goes toward making Amazon’s fulfilment centers more efficient and toward giving Amazon Web Services customers access to cutting-edge artificial intelligence models they’d never be able to build on their own.

Amazon just acquired a company that can improve its AI models on both of those counts. The logistics of shipping fresh food around the country are not easy, and that generates a ton of specialized data that Amazon can use to improve its own distribution strategies as well as build a cloud retail AI product for AWS customers.

Investing in “big data” products just isn’t enough any more for retailers. Artificial intelligence models are going to dictate how products are sold over the next decade, and there are only a few companies with the expertise and data sets necessary to build those models at scale.

A few years down the road, if you’re an established but aging grocery brand — say Safeway or Albertson’s or Publix (try the subs) — you’ll either watch Amazon and Whole Foods eat your lunch with improved efficiency and incredible reach, or you’ll become an AWS customer because you’ll need the retail AI products that could emerge from this deal to compete.