Artificial intelligence (AI) is the new big thing. The technology is evolving rapidly, and it could substantially contribute to the growth of companies that become leaders in the field.

Many investors are also looking to cash in by investing in those corporations that seem ahead of the pack. There are many options, but e-commerce titan Amazon (AMZN 0.76%) is one of the best. Let's find out why it's a great AI play to buy and hold forever.

Amazon's position in AI

The company has made several moves in AI. Last year, it announced Bedrock, a service it provides through its cloud computing platform, Amazon Web Services (AWS). Bedrock helps developers build generative AI applications like ChatGPT, whether they focus on speech, pictures, or videos.

Amazon also invested $4 billion in Anthropic, an AI-focused company that developed Claude, a family of generative AI platforms that is competing with GPT-4, the latest version of ChatGPT.

Claude is also the name of the large language model developed by Anthropic that Amazon now offers through Bedrock. A $4 billion investment might seem like a lot, but it's not that much for Amazon, which generated about $32 billion in free cash flow last year. Management seems confident that investments in AI will pay for themselves several times over, and AWS has a run rate of $100 billion.

AI does not account for a large percentage of that total yet, but CEO Andy Jassy said he believes that it is going to "drive tens of billions of dollars of revenue over the next several years." AWS is already one of Amazon's most important growth drivers, especially on the bottom line, with its much larger margins. Last year, Amazon's total net sales of $574.8 billion increased by 12% year over year.

AWS sales grew slightly faster, by 13.3% year over year, to $90.8 billion -- or just 15.8% of the company's total top line. But its operating income of $24.7 billion made up almost 67% of Amazon's $36.9 billion total operating income. And Amazon's AI work will only improve the performance of AWS.

More than an AI play

There are many ways to invest in AI, and doing so through a company like Amazon is a great way to mitigate risk. A pure-play AI company could skyrocket, but it could also sink if its initiatives don't pay off or if the industry doesn't become as big as many analysts currently think it will.

However, Amazon's business is strong enough and diversified enough to handle these potential outcomes. The company remains the leader in e-commerce, with a 37.6% share of the U.S. market as of last year. E-commerce still has a long runway for growth, so Amazon will continue to benefit from this market for years. Its e-commerce business enjoys the network effect: The platform becomes stronger and more valuable the more sellers and buyers join it.

That also makes the company's website more attractive to advertisers. Its ad business continues to grow fast, according to management. Elsewhere, the company is a leader in video and music streaming.

Besides its leadership in several industries ripe for growth and a strong competitive edge, something else makes it an outstanding forever stock: The company has developed a culture centered around innovation and a focus on customer satisfaction.

Amazon didn't become a leader in e-commerce or cloud computing by accident. And it will likely continue to invest in promising areas, including its work in healthcare, which is slowly but surely taking form.

Here's the bottom line: Amazon is an excellent stock to cash in on the rise of AI, e-commerce growth, and cloud computing. Long-term investors shouldn't go wrong with this robust, versatile business.