The one-two punch of decades-high inflation and rapidly rising interest rates weighed on the stock market in 2022, resulting in its worst performance in over a decade -- but things are looking up. After a precipitous drop of 35% in 2022, the Nasdaq Composite has bounded forward, gaining 44% in 2023.

Students who look to the past know the market probably has further upside potential. As far back as 1972 -- the first full year of trading for the tech-centric index -- in each year after a bear market rebound, the Nasdaq has returned 19%, on average, which suggests the current rally has room to run. To be clear, there are no guarantees in investing, but the potential for the current rally to continue has history on its side.

Furthermore, there's strong evidence that the catalyst for this year's rally has been the rebirth of investor interest in artificial intelligence (AI). Let's look at two stocks well-positioned to benefit from the growing number of applications and the surge of interest in AI.

A person examing stock charts across multiple computer monitors.

Image source: Getty Images.

AI Stock No. 1: Alphabet

There are plenty of reasons investors should consider adding Alphabet (GOOGL -2.95%) (GOOG -2.90%) to their portfolio. It's one of a rare group of companies that dominates more than one industry and is a strong contender in another.

First, there's the matter of internet search, and while rivals have tried to unseat Google for years, it has become the gold standard, controlling 92% of the market. The secret sauce that has powered the relevancy of its results is the AI algorithms Google has spent decades creating and refining, giving the company a seemingly insurmountable lead. Alphabet has plans to extend its dominance by juicing its flagship search with generative AI capabilities.

The genius in Alphabet's strategy is using its dominance in search as a funnel for digital advertising, which has put it atop the industry. Google accounted for 30% of global digital ad sales in 2022, according to data compiled by online industry publication Digiday -- and there's little question it will continue to lead the pack once the final figures are in for 2023. The company has gone further, providing a suite of generative AI tools that help online advertisers create more customized and effective marketing campaigns.

Alphabet is also a strong contender in the area of cloud computing, thanks to Google Cloud. Not only is the company one of the "Big Three" cloud infrastructure providers, but over the past few years it has also been the fastest-growing of the three. Furthermore, cloud computing offers arguably the perfect venue for providing AI services to customers.

Alphabet also has extensive reach in the consumer market, thanks to its portfolio products -- nine in all -- that have more than 1 billion users each. The list includes Search, Android, Chrome, Gmail, Google Drive, Maps, Google Play Store, YouTube, and Photos. Google is leveraging that reach by integrating AI into a broad cross-section of its offerings, with more on the way.

Taken together, Alphabet's extensive network of interconnected products and services provides a springboard for its AI ambitions, which is likely to pay dividends for years to come.

Last but certainly not least, Alphabet stock is historically cheap. At roughly 5 times next year's sales, it's selling at a historical discount to its five-year average price-to-sales ratio of 6. Considering the multiple catalysts that could push Alphabet stock higher, don't expect this discounted price to last.

AI stock No. 2: Amazon

Speaking of extensive reach, Amazon (AMZN 0.74%) is another company that caters to both consumer and business customers. Much like Alphabet, Amazon boasts two industry-leading offerings and is a strong contender in a third, giving the company a broad customer base that will benefit from its AI aspirations.

When it comes to e-commerce, Amazon is head and shoulders above the competition, generating roughly 38% of all online retail sales in the U.S. in 2022, more than its next 14 rivals combined, according to online data provider Statista.

While competitors have made headway over the past couple of years, Amazon is working to cement its dominance by offering generative AI tools that increase the relevance of its recommendations, improve the accuracy of product reviews, and help sellers write more compelling product descriptions.

As a pioneer in cloud computing, Amazon Web Services (AWS) maintains its lead in cloud infrastructure services, with a market share of roughly 31%, according to cloud data provider Canalys. This advantage gives the company a captive audience and target demographic for its AI services.

Another area that's becoming increasingly important to Amazon is digital advertising, which has generated roughly $44 billion in revenue over the trailing-12-month period, up 22%. This feat is particularly remarkable considering the economic headwinds and the industry-wide slowdown in the space.

Amazon is the third-largest digital advertiser, behind just Alphabet and Meta Platforms, and its ad revenue will get a boost this year from the "limited advertising" that will be the default for Prime Video beginning in early 2024.

Each of Amazon's three biggest businesses will benefit from its foray into AI, but perhaps none more than cloud computing. The company recently introduced Amazon Bedrock, which allows AWS customers to choose from a growing number of available AI models. The platform also helps cloud users customized generative AI applications from the ground up, by integrating proprietary user data, making the apps even more useful.

Yet for all this potential, Amazon is historically cheap, selling for just 2 times forward sales, a discount to its five-year average of 3.5. This situation gives shrewd investors the opportunity to buy shares on sale before Amazon's ongoing rally runs higher.

Why now is the time

AI made headlines in 2023, but most experts concur that there's likely to be much more to come, though the size of the opportunity is a matter of much debate.

Analysts at Morgan Stanley and Goldman Sachs provide two of the more conservative estimates, suggesting AI will generate incremental spending of $6 trillion and $7 trillion, respectively, by the end of the decade. Cathie Wood of Ark Investment Management believes those numbers are far to low, suggesting AI software alone will produce $14 trillion in spending by 2030.

Whatever the case may be, given their resources and history of capitalizing on AI, Amazon and Alphabet offer established, industry-leading businesses and all the potential upside AI has to offer.