The trade that defined the last two years of the stock market may be losing its grip.

CNBC's Jim Cramer says Wall Street is "fleeing" the AI trade, according to a report carried by MSN, with investors pulling money out of AI infrastructure stocks and pushing it into software and retail names instead. Those two groups, the report notes, have seen an upswing as the AI pullback plays out.

The timing lines up with a broader question hanging over the market. Yahoo Finance, in a piece surfaced via Google News, asks how the S&P 500 will react as AI spending slows down — a signal that the enormous capital outlays behind the AI boom may be cooling.

It helps to separate the two halves of the AI trade. "AI infrastructure" is the picks-and-shovels layer: the chips, servers, data centers and power needed to train and run large models. That layer is capital-intensive, and its stock prices have largely been priced off expectations of ever-rising spending. Software, by contrast, is the layer that uses AI rather than builds it — and it benefits if the underlying compute gets cheaper or more abundant. Retail is a different bet entirely, tied to consumers rather than to AI at all.

So a rotation from infrastructure into software and retail isn't necessarily a verdict that AI has failed. It can just as easily be a bet that the spending phase is maturing and the payoff phase is arriving — or a defensive move into sectors with less exposure to a single, crowded theme.

Neither source quantifies how large the rotation is or how long it has been underway, and Cramer's characterization is his read on the market, not a measured statistic.

Why it matters: AI infrastructure stocks have carried an outsized share of index gains, so if the money genuinely rotates out, it affects nearly anyone with a retirement account tracking the S&P 500 — not just people who deliberately bet on AI.