Last year was a total blowout for growth stocks. The Nasdaq Composite index delivered a mind-blowing 43.4% return.

Last year was a big one partly because the market was exiting a dismal 2022 in which the Nasdaq Composite index tanked. If you're looking at last year's big gain for growth stocks and assuming the market can't possibly do it again in 2024, you may be surprised at what history has to say.

Individual investor at home looking at stock charts.

Image source: Getty Images.

The current market recovery is the Nasdaq Composite index's 11th since folks began recording its activity in 1972. The index has recovered from negative years 11 times if you count the present recovery.

Every time the Nasdaq Composite dipped, the subsequent recovery lasted at least two years and the gains have been significant. The average gain in the second year of the previous 10 recoveries works out to 21.8%.

The emergence of ChatGPT and related generative artificial intelligence (AI) applications fueled the market's performance last year. Companies from every industry, not just tech, are eager to employ AI tools that make their employees more productive.

When it comes to profiting from the proliferation of AI applications, these two companies stand out from the pack. Read on to see why they could be great stocks to buy now and hold over the long run.

Nvidia

Shares of Nvidia (NVDA 6.18%) have more than tripled over the past 12 months and it's not hard to see why. Soaring demand for the company's AI chips drove revenue 206% higher year over year during the company's fiscal third quarter that ended on Oct. 31, 2023.

Nvidia's competitors, like Intel and Advanced Micro Devices, are capable of designing chips that can power generative AI applications, but they don't run Nvidia's proprietary CUDA platform that developers are already accustomed to. This competitive advantage gives Nvidia enormous pricing power as you can see in the company's results.

Despite operating in the highly cyclical semiconductor industry, Nvidia produces reliable profits. Its trailing-12-month operating margin briefly dipped below 20% last year for the first time since 2016.

Demand for generative AI applications drove revenue up to $44.9 billion over the past year but this could be just a sliver of the company's addressable market. Nvidia estimates its long-term market opportunity at $1 trillion annually.

Shares of Nvidia have been trading for 30.2 times forward-looking earnings estimates. That's not an unreasonable valuation for a company positioned to sell heaps of picks and shovels throughout the AI gold rush.

UiPath

Shares of UiPath (PATH 0.26%) are up around 50% over the past year. Investors responded well to the company's performance during its fiscal third quarter that ended Oct. 31, 2023.

UiPath markets an automation platform its clients use to automate away repetitive tasks. With software that can read documents and generate responses, hiring UiPath is a relatively easy way for companies in any industry to implement new AI applications that boost efficiency.

UiPath is already popular among small to midsize organizations and now it's taking its pitch to larger enterprises with significant success. At the end of last October, the number of customers contributing over $1 million in annualized revenue rose 31% year over year to 264.

Organizations eager to utilize new generative AI applications are signing up for UiPath subscriptions left and right. During its fiscal third quarter, revenue soared 24% year over year to an annualized $1.3 billion. This is just a drop in the bucket of UiPath's total addressable market, which the company estimates at more than $90 billion annually.

Once an organization gets used to using one company's software, switching to a new vendor becomes a pain that most office managers would rather avoid. UiPath's services appear even stickier than the average software vendor. The company reported a 97% dollar-based retention rate in its fiscal third quarter.

On the surface, UiPath's recent price of around 45 times forward earnings estimates seems too high to allow for satisfying returns. As the market leader in the rapidly expanding market for robotic process automation, though, there's a good chance that the business can outrun its lofty valuation and deliver market-beating gains over the long run.