The S&P 500 and the Nasdaq have roared higher in recent times, even reaching records and confirming the presence of a bull market, and a specific group of stocks has been setting the pace. I'm talking about the technology stocks referred to as the "Magnificent Seven" -- a reference to the 1960 Western by the same name. Alphabet (GOOG 9.96%) (GOOGL 10.22%), Amazon, Apple, Meta Platforms (META 0.43%), Microsoft, Nvidia, and Tesla round out this set of technology winners.

Investors have piled into Magnificent Seven shares for a few reasons. These companies boast solid earnings track records, their future prospects are bright, and many offer a way to bet on the technology everyone is excited about these days -- artificial intelligence (AI).

Now, after gains in the triple and even quadruple digits (in the case of Nvidia) over the past five years, you might expect these stocks to have become extremely expensive. But this isn't the case. In fact, the following two Magnificent Seven AI stocks are surprisingly cheap, offering you a great buying opportunity right now. Let's check them out.

AI-powered robots work in a conference room.

Image source: Getty Images.

Alphabet

Alphabet is best known as the parent of the world's favorite search engine, Google Search. The company has steadily held more than 90% of the global search market, and this is likely to continue thanks to Alphabet's focus on AI.

Alphabet today is using AI in two ways in particular that should help ensure its biggest source of revenue -- advertising -- continues to grow. In the most recent quarter, Google advertising rose 10% to $65 billion, accounting for 75% of total revenue.

Advertisers flock to Alphabet to place ads so that they can try to sell their products or services to us as we use Google Search. This ads business already is strong, with growth continuing even during recent tough economic times. Now, though, Alphabet's AI tools are helping to improve the search experience for users and assist advertisers as they design ads.

For example, generative AI has helped reduce search latency by 40% for U.S. English language searches, and AI is transforming search to offer summaries, a wider variety of links, and other features to deliver a more complete result. Better search results should keep users coming back, and that means advertisers will keep coming back to reach them here too. Advertisers also benefit from Alphabet's AI-powered solutions, such as a conversational experience that speeds up ad creation.

Today, Alphabet shares trade for only 19x forward earnings estimates, which looks like an absolute steal considering the company's enormous search market share -- and the potential for AI to keep it in the lead.

Meta Platforms

When you think of Meta, you probably think of its suite of leading social media apps, including Facebook, Messenger, Instagram, and WhatsApp. Selling advertising across these apps drives Meta's revenue. And revenue has been on the rise, gaining 25% in the most recent quarter to more than $40 billion.

But Meta also has thrown itself into the area of AI, making it a development priority across the company so that this platform may serve as a foundation for future products. The company has developed the Llama large language model (LLM) and is now training version 3. Meta is heavily investing in the graphics processing units (GPUs) that power AI models -- and expects to bring on board 600,000 GPUs of compute, many from chip leader Nvidia, by the end of the year.

Meta chief executive officer Mark Zuckerberg says the goal is that in the future those using Meta products and services will have their own AI assistant to get things done -- and developers, content creators and businesses may also access AI to accelerate and streamline their operations. All of this, thanks to Meta's investments today.

It's a big goal, but Meta has the financial strength -- thanks to solid earnings from its social media business -- and the strategy to get there. The company reiterates its commitment to open-source software infrastructure -- by sharing developments and progress, Meta could help create secure platforms, attract top talent, and establish itself as an AI giant.

Right now, Meta trades for 24x forward earnings estimates, a bargain for a company that's vying for a leading role in AI, is putting in the necessary efforts, and at the same time offers you earnings growth from its core business.