Last year, Amazon (AMZN 1.34%) struggled with various economic headwinds, as well as other company-specific challenges. That led it to report its first annual loss in nearly a decade, and its shares dropped almost 50%.

Things may be looking up, though. The company has made progress on its recovery plan, significantly reducing the outflow of cash and increasing operating income. Amazon may even have just the thing to boost revenue at Amazon Web Services (AWS), which is generally its biggest profit driver. I'm talking about artificial intelligence (AI). Let's find out more.

The Amazon story

First, it's important to consider Amazon's story over the past few years. A black swan event hurt many retailers -- but actually led to an enormous wave of demand for Amazon. The pandemic, in its early days, kept people at home and favoring online shopping. To keep up, Amazon doubled its fulfillment network in just two years.

The problem was, as demand settled, Amazon found itself with excess capacity. At the same time, economic challenges, like higher inflation, weighed on earnings. AWS managed to continue growing revenue and operating income in the double digits through most of last year.

But as companies felt the pressure of rising inflation, growth in AWS skidded to a halt. In the most recent quarter, AWS operating income fell more than 20%. Amazon said it was directing AWS customers toward its cheaper cloud computing solutions as they tried to manage with tight budgets.

Fast forward to today. As mentioned above, Amazon is moving forward with its plan to cut costs, invest in the highest-growth areas, and return to annual profitability. In the most recent earnings period, the company reported a 30% increase in operating income. And it cut its outflow of cash to $3.3 billion over the trailing 12 months from more than $18 billion.

That's positive. But to truly regain its strength and supercharge growth, Amazon will have to see a new wave of growth at AWS. And AI could play an important role.

First, it's important to note that Amazon is the global leader in cloud computing services. So it's already in a position of strength. The company's willingness to work with its customers' budgets during tough times -- by providing them with cheaper solutions -- also should keep it ahead.

An easy way to launch AI applications

Now, AWS' focus on AI could spur that much-needed phase of growth. Amazon Bedrock represents an important piece of the puzzle. This is part of AWS' offering that makes it easy for developers to create and launch generative AI applications.

They don't have to build infrastructure to do this; AWS has that taken care of. By using Amazon Bedrock, developers can design a variety of applications, from chatbots to text generation.

Amazon also is investing $100 million to create the AWS Generative AI Innovation Center, according to news reports. As part of this program, AWS' AI experts will help customers learn how to use AI to grow their businesses.

More than 100,000 clients already are using AWS for their AI workloads, Amazon says. So the company is no stranger to this area and understands the importance of investing in it. Expanding at a compound annual growth rate of 35%, the generative AI market is expected to top $51 billion by 2028, according to data from Markets and Markets.

All of this means that, yes, AI could spark growth at AWS in the coming months and years. The cloud computing service already is a leader -- and if Amazon continues to put focus on and invest in AI, it could easily keep its spot.

That's good news for Amazon investors. And it offers another reason for those waiting on the sidelines to buy shares of this e-commerce and cloud computing giant today -- and hold on for the long term.