Trading for $102 a share, Amazon (AMZN -0.20%) stock is down substantially from its all-time high of $186, reached in late 2021. Its shares tumbled amid rising interest rates and eroding margins in the e-commerce and cloud computing businesses. But these headwinds look temporary, and Amazon may be on the cusp of recovery. Let's dig deeper.

What went wrong?

While e-commerce has carried Amazon for the last two decades, its cloud computing business, Amazon Web Services (AWS), is arguably the bigger story right now. While AWS represents less than 20% of Amazon's revenue, it generates the majority of operating profits. So when growth and margins in this crucial segment began to slow, investors reacted by dumping Amazon stock, leading to a substantial crash in 2022.

The business is struggling because of macroeconomic uncertainty. First and foremost, inflation is eroding consumer purchasing power for AWS clients, who are now looking to save money by switching to lower-priced service tiers. Rising interest rates are putting even more pressure on these companies.

But the good news is that all these headwinds look temporary, and Amazon can turn these challenges into opportunities to capture market share in the industry.

1. AWS could come roaring back

According to Amazon CEO Andy Jassy, AWS is still early in its adoption curve, suggesting the slowdown is more of a cyclical trend than a sign that the business is stagnating. And as with Amazon's e-commerce operations, management believes that putting the consumer first in AWS is also the best long-term strategy. Instead of trying to "extract" as much money as possible from its clients, the company has decided to help them save money by optimizing their cloud spending.

In the near term, this will naturally lead to lower growth and tighter margins as consumers switch to lower-priced service tiers. But by helping customers navigate this challenging time, Amazon can strengthen client relationships and help protect its market share when industry conditions improve.

2. AI could help supercharge growth

The company also has another trick up its sleeve: artificial intelligence (AI). Since the launch of the chatbot ChatGPT, AI has been taking the tech world by storm. But while it is hard to sift through all the hype, Amazon stands to benefit from this technology. In April, the company started rolling out Bedrock, a generative AI platform designed for AWS clients.

Flaming arrow moving upwards.

Image source: Getty Images.

Bedrock will do the same things as other mainstream platforms -- generate text responses, turn text into images, and so on. But its flexibility can give it an edge. According to management, AWS clients will be able to customize Bedrock's language model, Titan, with their data, saving them the time and cost of building their own AI platforms. Bedrock also may have a ready market among existing AWS clients who want to get all their cloud and AI needs from the same service provider.

It's too early to know how much AI will impact Amazon's future growth and profitability. But this could be the second wind that lifts the company from its current slump. Investors have plenty of reason to be optimistic.