Growth investors went through a tough stretch in 2022 that saw the Nasdaq Composite fall more than 35% at its low. That feels like the distant past after the technology-heavy index roared back in 2023 with 43% gains. It now trades just 2.5% from its all-time high.

History indicates investors could be in for more good times in 2024. The index has historically performed well following similarly large drawdowns throughout the past.

The excitement for artificial intelligence (AI) advancements helped give a turbo boost to the market's rally. And some leading AI stocks still have the growth potential and reasonable valuations to continue their strong momentum.

Here are three AI stocks to consider buying for continued gains.

1. Nvidia

The stock market's momentum has been carried by "The Magnificent Seven," a handful of megacap technology stocks leading the charge into AI with their dominant business models and deep pockets.

One of them is chip company Nvidia (NVDA 6.18%), one of Wall Street's best performers after surging 222% over the past 12 months. You shouldn't typically buy a stock after such a run, but Nvidia's accelerated growth from AI chip demand could be unprecedented.

How often does a company, already doing billions of dollars in sales, accelerate to a triple-digit growth rate? But that's precisely what Nvidia did.

More importantly, the momentum looks like it could continue. The company controls the lion's share of the AI chip market, which could grow to over $400 billion over the coming years.

Not only are Nvidia's H100 and H200 chips the go-to hardware for building AI computers, but the company is also aiming to go after the custom chip market, targeting companies that might design and build their own AI chips.

Analysts believe the business will grow earnings at over 42% annually, which means that paying a forward price-to-earnings (P/E) figure of 35 for the stock is very reasonable. Sure, investors who have already seen tremendous gains could take profits. Still, Nvidia's outlook makes any pullback a fantastic long-term buying opportunity.

The best strategy might be to buy a little at a time, since there's no telling how far a runaway stock with such strong fundamentals could rise before it does dip.

2. Super Micro Computer

Like Nvidia, Super Micro Computer (SMCI 8.89%) is undergoing a growth spurt that investors might struggle to wrap their heads around because shares have moved so quickly.

This stock is up 751% over the past year alone. But as you'll see in a moment, the unprecedented tailwinds of AI are justifying these gigantic gains. Super Micro Computer sells modular server systems, which means its customers buy turnkey state-of-the-art servers without having to design and build such systems themselves.

The company has been in business since 1993, and the migration to cloud computing -- and now AI -- is taking growth to new levels. It recently reported its earnings for the second quarter of fiscal 2024. Revenue grew 103% year over year to $3.66 billion, and 73% over the prior quarter.

This is exponential growth from a multibillion-dollar corporation, and management is guiding for over 200% year-over-year growth in the third quarter.

When revenue is multiplying like this, it shouldn't be jarring to see the stock doing the same thing. Analysts expect big things from Super Micro Computer, and they estimate earnings will grow at an average annual rate of 37%. At a forward P/E of just 34, that's a price/earnings-to-growth (PEG) ratio under 1, making this highflier a potential bargain if it continues to perform like this.

3. Meta Platforms

Another Magnificent Seven stock wraps up this list. Social media company Meta Platforms (META 0.43%) has soared 163% over the past year.

It also has a lot going on with AI, but Meta is more a story of redemption after its advertising struggles and excessive spending had it fall out of favor with Wall Street in 2022. Since then, Meta has bounced back, and cost-cutting has re-established it as a cash cow.

Meta, which owns social media apps Facebook, Instagram, and WhatsApp, continues to gain users. It grew its total audience to 3.98 billion monthly active users as of the fourth quarter, a 6% increase over 2022.

Revenue was 25% higher year over year, and management paid its first-ever dividend, a sign that the company is confident it can share more profits with investors while investing for long-term growth.

Since Meta came from such a low place in 2022, the stock's remarkable run still hasn't made shares too expensive. It trades at a forward P/E of 23, which is fair for a stellar business that analysts believe will grow earnings at nearly 20% annually over time. Meta Platforms stock looks like a buy-and-hold choice in 2024.