Morgan Stanley analysts estimate artificial intelligence (AI) spending across infrastructure and software will increase more than 600% by 2028. Buying stock in Nvidia and/or Palantir has been a popular way to capitalize on that trend, but investors should consider Meta Platforms (META 1.43%) and Pure Storage (PSTG -0.08%).

Most Wall Street analysts following the companies have favorable outlooks. Meta Platforms has a median target price of $875 per share, implying 19% upside from its current share price of $735. And Pure Storage has a median target price of $80 per share, implying 4% upside from the current share price of $77.

Here's why I think these AI stocks are brilliant long-term investments.

An artificial intelligence displays "AI" in glowing letters.

Image source: Getty Images.

1. Meta Platforms

Meta Platforms owns three of the four most popular social media networks as measured by monthly active users. That dominant competitive position affords the company insight into consumer tastes and preferences, which helps it target media content and advertising. In turn, Meta Platforms is the second largest ad tech company worldwide, and it's poised to gain market share, according to Morningstar.

The company has been investing aggressively in artificial intelligence (AI), including custom chips, Llama large language models, machine learning models to recommend content, and AI creative tools for advertisers. Those efforts are paying off. Users are spending more time on Facebook and Instagram, and ad conversion rates -- meaning the number of clicks and purchases -- are increasing across both social media properties.

Even more ambitious, Meta hopes to automate the entire ad creation process by next year. The Wall Street Journal recently reported, "Using the ad tools Meta is developing, a brand could present an image of the product it wants to promote along with a budgetary goal, and AI would create the entire ad, including imagery, video, and text."

Consequently, Meta has a great shot at delivering double-digit revenue growth for several years to come. I say that because ad tech spending is forecast to increase at 14% annually through 2032, so Meta would report even faster revenue growth during that period if it does indeed gain market share. And that doesn't even account for its substantial opportunity in the nascent smart glasses market.

Wall Street estimates earnings will increase at 17% annually over the next three years. That makes the current valuation of 27 times earnings look quite reasonable, especially when the two-year average is 28 times earnings. Patient investors should feel comfortable buying a few shares of this AI stock today.

2. Pure Storage

Pure Storage offers enterprise data storage hardware, software, and services. It specializes in all-flash arrays, storage systems that contain only flash memory rather than slower and less durable hard-disk drives. Its DirectFlash architecture offers two to three times the storage density and half the power consumption as the next closest product on the market.

Research company Gartner recently ranked Pure Storage as a leader in primary block storage platforms, as well as file and object storage platforms. The analysts commented that Pure Storage FlashBlade systems offer the highest density and lowest power consumption in the industry, qualities that make its products adept at supporting artificial intelligence workloads.

On that note, Pure Storage earlier this year announced its next-generation FlashBlade systems. CEO Charles Giancarlo said, "FlashBlade XL will be the industry's highest-performing storage platform for AI and high-performance computing when it is delivered."

In addition, Meta Platforms recently chose Pure Storage to power its data center storage infrastructure, and Giancarlo thinks its DirectFlash technology could become the industry standard for all hyperscalers because it offers "unparalleled performance and scalability while also reducing operating costs and power consumption."

Wall Street expects Pure Storage's adjusted earnings to grow at 27% annually through the fiscal year ending in January 2027. That makes the current valuation of 46 times adjusted look reasonable, especially when the company beat the consensus earnings estimate by an average of 14% during the last four quarters. Patient investors should buy a small position in this little-known AI stock today.