Amazon (AMZN 0.08%) is one of the world's largest companies. It's valued at $1.4 trillion as of this writing, and its stock features in both the FAANG group and the "Magnificent 7," alongside its other trillion-dollar peers in the technology sector. 

Most people know Amazon for its e-commerce business, which has become the largest in the world. But its industry-leading cloud services platform, Amazon Web Services (AWS), is the growth and profitability engine behind the entire company, and it's using its dominant position to swoop into the artificial intelligence (AI) space.

Amazon recently released its financial results for the second quarter of 2023 (ended June 30), which came in much better than expected. Plus, in its conference call with investors, the company shared more details about its AI strategy. 

Amazon stock has rocketed 60% higher in 2023 so far, but it's still down 25% from its all-time high after last year's sell-off in the technology sector. Here's why that's an opportunity for investors to buy. 

A digital rendering of computer chips, with one labeled AI.

Image source: Getty Images.

Amazon is catching up to its peers in the AI race

Big-tech giants Microsoft and Google parent Alphabet have been engaged in a fierce battle over artificial intelligence this year, particularly when it comes to AI models delivered to their business customers in the cloud. But since AWS is the cloud industry's largest platform, it's only natural it stakes a claim to a slice of the pie.

AWS leads both Microsoft Azure and Google Cloud by revenue, number of customers, and breadth of functionality. Now, it's working on expanding its AI product portfolio, and Amazon CEO Andy Jassy wants AWS to dominate in what he says are the technology's three core layers. 

The first layer is data center infrastructure, like Amazon's new EC2 P5 cloud instances, which are powered by Nvidia's (NVDA -4.69%) latest H100 graphics chips (GPUs). They enable developers to scale their workloads to 20,000 GPUs, giving them significant computing power to build, train, and deploy their AI models.

But unlike other cloud providers, Amazon is also developing its own chips, which could be an important differentiator in the future, since Nvidia is basically the only game in town. 

The second layer features large language models (LLMs) as a service. According to Jassy, AWS customers don't always want to invest in building their own AI models; they'd instead prefer to adopt existing ones and customize them for their needs. AWS offers customers an LLM it developed in-house called Titan, in addition to several third-party options from prominent AI companies like Anthropic and Stability AI. 

The third and final layer is the consumer-facing generative AI software applications like OpenAI's ChatGPT. This is the area investors have been focusing on most, and AWS already offers tools like CodeWhisperer to help developers accelerate their programming tasks. Jassy says this layer has captured the most attention from investors, but the financial opportunities in the other two layers could be just as significant.

Amazon blew away expectations in the second quarter

Amazon has struggled to generate overall revenue growth over the last 12 months, primarily because high inflation and rising interest rates curbed consumers' spending power, which has impacted the company's e-commerce business. E-commerce makes up 39% of Amazon's total revenue, and it managed to deliver 5% year-over-year growth in the second quarter, which was an acceleration from Q1. 

It was coupled with 22% growth in its digital advertising segment, which has become an important business for Amazon as it continues to develop its media assets. Its flagship website amazon.com is the main driver of ad revenue, but with Amazon Music and the Prime and Twitch streaming platforms in its portfolio, the company is constantly creating new opportunities for businesses to reach their customers.

But AWS is always the point of focus for investors when it comes to Amazon's quarterly reports, because it's usually responsible for most (or all) of the entire company's operating income (profit). Some Wall Street analysts expected AWS's year-over-year revenue growth to slow into the single-digit percentages, but it topped expectations with a 12% increase. Its operating income dipped slightly as the company made investments in developing its AI portfolio. 

Overall, Amazon's company-wide revenue for Q2 came in at $134.4 billion, up 11% compared to the year-ago period, and comfortably above the Street's $131.5 billion forecast. It also delivered $6.7 billion in net income for the quarter, which translated to $0.65 in earnings per share, or nearly double the $0.35 per share the Street expected. 

Investors might regret not buying Amazon stock now

Amazon stock surged by about 8% the day after it reported its Q2 results, and it's having a bumper 2023, with a year-to-date gain of 60%. But it's still trading 25% below its all-time high following a brutal sell-off across the technology sector in 2022. 

Plus, investors weren't giving Amazon credit for its presence in AI up until recently, as they were preoccupied with AI stocks like Nvidia (which has tripled in value in 2023). But with Amazon's strategy now clearly laid out, the company has an opportunity to penetrate two key markets.

First, Nvidia CEO Jensen Huang says there is $1 trillion worth of existing data center infrastructure, which needs upgrading to support accelerated computing and AI. I'm not suggesting Amazon's new chips will be comparable in performance to Nvidia's at this stage, but even capturing a fraction of that market could create a lucrative revenue stream. 

Second, Cathie Wood's Ark Investment Management believes the AI software industry will be generating a collective $14 trillion by 2030. AWS has a growing presence in that field, which could supercharge its revenue growth for the remainder of this decade (and beyond).

Overall, investors who can buy and hold Amazon stock for the next five years or more could earn a very positive return on their money.