One of the big themes of 2023 -- perhaps the theme of the investing year -- was artificial intelligence (AI). Every company, small and large, seems to be investing in AI following the revolutionary developments from OpenAI and its ChatGPT product.

One company that initially felt threatened by these AI developments was Alphabet (GOOG 1.85%), the parent company of Google. Microsoft invested over $10 billion in OpenAI, hoping to take advantage of the latest version of ChatGPT and steal market share from the dominant search engine provider (as well as the tens of billions in profits that search engine generates each year for Alphabet).

Alphabet stock started 2023 in the dumps. But after posting strong earnings, releasing competitive AI products, and proving it could retain its market share despite new competition from Microsoft and OpenAI, Alphabet stock shot up like a rocketship in 2023. Over the last 12 months, the stock is up 55.6%, crushing the returns of the S&P 500 index.

Don't think the party with Alphabet is over, though. It may be just getting started. Here's why Alphabet is one Magnificent Seven stock I would buy in 2024.

AI search? No problem

Many investors were worried that ChatGPT and these new AI conversational tools were leaving Google in the dust. However, Google showed it still has a few tricks up its sleeve.

Almost immediately after ChatGPT went viral, Google released a copycat product, Google Bard, that anyone can use for free. From my seat, this shows that Google has been investing in conversational AI tools for quite some time and wasn't scared by the growth of ChatGPT. This shouldn't be surprising as the company did invent the transformer technology behind all these AI tools back in 2017.

Now, they are prepping a release of Google Gemini, its next-generation AI platform that can recognize and discuss text, audio, and images users give it. The product was announced in December and is slated to be released to consumers sometime in 2024. Importantly, these AI capabilities will be embedded into the computer chips powering the newest Google Pixel phones, which could give Alphabet an advantage as it tries to gain market share with smartphones.

Alphabet has been investing in AI tools for Google Search and other products for years now. It acquired the preeminent AI research lab, DeepMind, in 2014, which has helped bring on revolutionary technologies, such as the protein discovery tool called AlphaFold. Despite strong growth from upstarts, such as OpenAI, there should be no concerns about Alphabet losing in AI. Google Search still has a 90%-plus market share, which has remained virtually unchanged since the start of 2023.

Don't forget the cloud and YouTube

Google Search makes up the majority of Alphabet's revenue. Last quarter, the segment generated $44 billion in revenue compared to $77 billion for the entire Alphabet business. If it retains its 90% market share globally, this segment should be able to grow along with the world economy. But there are some more promising assets under the Alphabet umbrella. Two that should interest investors are YouTube and Google Cloud.

YouTube is one of the dominant video platforms globally, with billions of active users. Each quarter, it generates close to $8 billion in advertising revenue. It is the most popular streaming application on TV -- even more popular than Netflix -- and should continue to attract advertisers as consumers transition away from traditional sources.

It is also getting into sports rights with the purchase of NFL Sunday Ticket and is the leading virtual cable TV provider with its YouTube TV product. It wouldn't be surprising to see YouTube generating $100 billion in annual revenue 5-10 years from now.

Google Cloud may have even more potential. As one of the leading cloud infrastructure providers, this segment is the backbone of the modern software, cybersecurity, video streaming, and AI markets (including Alphabet's own products). Last quarter, it generated $8.4 billion in revenue and grew 22%. The segment was historically unprofitable but now runs at a slightly positive operating margin.

Competitor Amazon Web Services routinely sports margins above 25%, and there's no reason to think Google Cloud won't get there eventually. With such a long runway left to grow, Google Cloud can easily surpass $100 billion in revenue in the next five to 10 years (similar to YouTube). At a 25% profit margin, that is $25 billion in annual earnings.

GOOG PE Ratio Chart

GOOG PE Ratio data by YCharts. PE Ratio = price-to-earnings ratio.

But is the stock cheap today?

It is clear to me that Alphabet has a bright future. But with the stock up 55% in the last year, it is logical for investors to be skeptical about whether now is a good time to buy shares.

Alphabet currently trades at a price-to-earnings ratio (P/E) of 26.4. This is almost exactly the same as what the S&P 500 trades at. The question: Will Alphabet's earnings per share (EPS) grow faster than the average stock? I think so for three reasons.

First, Alphabet is growing faster than the average stock, with revenue rising by 11% year-over-year last quarter. This should continue with all the tailwinds at its back. Second, it should see margin expansion with the maturity of Google Cloud and more operating leverage in the core Google business. Third, it is reducing its shares outstanding with its share buyback program, which will add more juice to growing its EPS.

Alphabet trades at a market average P/E but is poised to compound its EPS at 15% for the next few years, if not longer. From my perspective, this makes Alphabet a great Magnificent Seven stock to buy in 2024.