Investing trends come and go. In recent years, investors piled on companies' stocks merely because they grew cannabis or became meme stocks.

The latest trend revolves around stocks involved with artificial intelligence (AI). While some will eventually lose their luster, others hold the potential to outlast trends as they report rising revenue and profits. Investors seeking positions in this space may want to consider three AI stocks.

1. Nvidia

Nvidia (NVDA -0.95%) may look like a meme stock from a certain point of view. It has risen nearly 250% over the last year and almost 2,000% in the previous five years amid its dominance in AI-ready semiconductors. Also, with a price-to-sales (P/S) ratio of 37, many perceive it as overpriced.

However, thanks to high-gross margins, Nvidia has become tremendously profitable. At a price-to-earnings (P/E) ratio of around 75, it may look like a bargain, considering that its net income rose 769% in fiscal 2024 (ended Jan. 31).

The increases should continue for the foreseeable future. According to MarketDigits, analysts forecast a compound annual growth rate (CAGR) for the AI chip market of 38% through 2030. With Nvidia having at least 80% of this market, according to analysts, it will probably claim the lion's share of that benefit.

Admittedly, that market share will probably fall over time. AMD, Intel, Qualcomm, and others have begun to release AI-ready chips, which could compress Nvidia's gross margins over time.

Nonetheless, AI is likely here to stay, and as long as Nvidia retains its leadership position, the stock should continue driving significant returns even when AI is no longer trendy.

2. Palantir

Palantir (PLTR 0.76%) has long been recognized for its ability to analyze data and recommend courses of action. Its capabilities have stood out in the national defense and, more recently, the commercial realms. Mastery of AI has been critical to this success.

Still, the company appears to have taken AI to the next level with the release of its artificial intelligence platform (AIP). AIP applies generative AI to its capabilities, and prospective customers have reported eye-popping productivity gains.

One prospective customer boasted of accomplishing more in one day than a hyperscaler had in four months. Another reported accomplishing 10 times as much with three-times fewer resources. Such productivity gains will likely make Palantir AIP essential to numerous companies, giving the company tremendous market power.

Admittedly, Palantir's market cap of about $50 billion makes it a fraction of the size of many tech giants promoting AI. However, the company has remained profitable since the final quarter of 2022, dramatically reducing the need for outside funding.

Also, since it only became profitable recently, its P/E ratio is above 250, though on a forward basis, it sells at a forward P/E ratio of 71. Even though that still makes the stock expensive, Palantir's productivity gains and the potential growth that comes with those gains are likely too rewarding to ignore.

3. Alphabet

Google parent Alphabet (GOOGL -3.74%) (GOOG -3.59%) may be seen as a counterintuitive pick in today's AI market. But it has used AI in some form since 2001 and declared itself an "AI first" company in 2016.

However, a ChatGPT release in early 2023 appeared to have caught Alphabet off guard. As Microsoft's Bing began using ChatGPT, investors saw a meaningful threat to the dominance of Google search for the first time in years.

Still, Alphabet has responded with the release of Gemini, its own generative AI platform. Moreover, investors should not forget that Alphabet infuses AI into every product, and it recently combined its research efforts into Google DeepMind to help stay on the leading edge of AI technology.

Additionally, the company holds around $111 billion in cash and equivalents, an amount of liquidity matched by few companies. Thus, if it cannot develop the needed technology in-house, it can probably gain it through acquisition.

After recent struggles, the company has returned to profit growth, and with a P/E ratio of 26, it has the lowest earnings multiple of any stock in the "Magnificent Seven." That factor could draw investors into Alphabet stock as it continues to innovate in the AI space.