When it comes to artificial intelligence (AI), no other companies come close to the attention paid to the "Magnificent Seven." Indeed, Microsoft, Alphabet, Apple, Tesla, Nvidia, Meta Platforms, and Amazon (AMZN 0.88%) are all helping shape the AI narrative in their own ways.

While Microsoft's relationship with ChatGPT developer OpenAI and Tesla's self-driving cars are impressive, there is a different Magnificent Seven member that stands above the rest.

I see Amazon as the best AI opportunity among mega-cap tech. Here's why its long-term picture looks as good as ever.

Amazon has mountains of cash...

The last couple of years have been challenging for technology businesses in particular. Unusually high inflation led the Federal Reserve to enact nearly a dozen interest rate hikes.

The combination of inflation and rising interest rates caused consumers and businesses to curb spending. This significantly affected Amazon, which derives sales and profits primarily from its e-commerce and cloud computing operations.

But in 2023, things started to turn around for Amazon. Inflation cooled down a bit, which helped ignite some increased economic activity.

The company's revenue from e-commerce, advertising, and subscription services comes from its North American and International segments. During 2023, revenue between these two segments increased 11% year over year to $484 billion. But more importantly, the company generated positive operating income for these two segments.

In 2023, the company's North America and International operations combined for $12.3 billion of operating income. These two segments lost a combined $10.5 billion in 2022.

Besides e-commerce and advertising, one of the company's crown jewels is its cloud computing platform, Amazon Web Services (AWS). Revenue for AWS soared 13% year over year in 2023 to $90.7 billion, and it accounts for nearly 67% of the company's total operating profit.

This underscores how important it is to derive growth from cloud software. As demand for AI applications rise, AWS will play a crucial role in Amazon's longer-term growth.

The combination of increased sales and a return to positive operating income helped to accelerate free cash flow (FCF). Last year, the company generated $36.8 billion of FCF; in 2022, FCF was negative $11.6 billion.

With $86 billion of cash and equivalents on its balance sheet, Amazon seems prepared to thrive in the fiercely competitive AI realm, and it's attracting high-profile investors like Cathie Wood and Warren Buffett.

A person leveraging AI tools in a warehouse

Image source: Getty Images.

...and it's not afraid to use it

Microsoft kicked off the AI revolution following its multibillion-dollar investment in OpenAI. So far, it has deeply integrated ChatGPT throughout its Azure cloud platform in an effort to gain an edge on AWS.

But Amazon responded swiftly with a $4 billion investment with Anthropic, a start-up co-founded by former OpenAI employees. The primary aim of the investment is to unlock new opportunities in the cloud.

As part of the deal, Anthropic will use AWS as its primary cloud provider and will train future generative AI models with Amazon's in-house Trainium and Inferentia chips.

These are important developments that investors should not overlook. Amazon's ambitions in the chip space could prove lucrative in the long run as companies look to diversify beyond Nvidia's semiconductors. And by leveraging AWS, Anthropic should be a unique source of generating leads for Amazon's cloud platform.

Is now a good time to buy Amazon stock?

The chart below compares Amazon to its Magnificent Seven peers on a price-to-sales (P/S) basis. With a P/S of just 3.3, Amazon is the lowest-valued stock among the seven based on that metric.

AMZN PS Ratio Chart

AMZN PS ratio data by YCharts.

Taking this a step further, Amazon's current P/S is well below its 10-year high of 5.6, which it reached just a couple of years ago. I think there are a couple of factors at play here.

For starters, I think Amazon's investment in Anthropic is overlooked in comparison to Microsoft's deal with OpenAI. Moreover, the economy has been plagued by inflation and rising interest rates over the last couple of years, so I think some investors have soured on Amazon given its high degree of sensitivity to the macro environment.

AMZN PS Ratio Chart

AMZN PS ratio data by YCharts.

Although each of those points has merit, they are shortsighted arguments.

There are very few companies that can leverage AI across a host of growth markets including e-commerce, cloud computing, advertising, streaming, and subscription services. Given Amazon's sustained profitability and strong cash position, I see the company emerging as a long-term winner as secular AI themes play out.

The AI story is just beginning, and Amazon is in an incredible position to dominate with its prolific ecosystem. The company's currently discounted valuation compared to its peers makes now a lucrative opportunity to scoop up shares and prepare to hold for the long run.