Everyone's been talking about artificial intelligence (AI), and it may be one of the hottest investment areas today. Why? Because the technology has the potential to transform many industries, saving time and money for companies, and even result in lifesaving discoveries -- such as better drugs and medical devices. Analysts expect the AI market to surpass $1 trillion by the end of the decade.

Even though many AI stocks have soared, though, this doesn't mean you've missed out if you haven't already invested in this exciting field. The AI growth story is just getting started, meaning there's plenty of room for the strongest players to continue advancing over time. So, if you're ready to invest in AI, check out these two stocks that make solid long-term bets.

An investor smiles while looking at a phone in an office.

Image source: Getty Images.

1. Amazon

You probably know Amazon (AMZN 0.35%) best for its e-commerce business, but the company is also building its presence in the world of AI. It's using the technology to streamline operations within fulfillment centers, for example, and better serve customers. But where Amazon truly is going all in on AI is in the company's cloud computing business, Amazon Web Services (AWS).

"We're optimistic that much of this world-changing AI will be built on top of AWS," chief executive officer Andy Jassy wrote in Amazon's recent shareholder letter. He also said generative AI may be the biggest game-changing technology since the Internet.

Jassy says Amazon is "deeply investing" in the three layers that make up AI -- over time, this could make AWS the go-to place for businesses seeking to launch AI projects. These layers include the building blocks for foundation models such as chips and software, a fully managed service for customers wanting to leverage an already existing foundation model, and finally applications driven by AI.

Since AWS today is the world's No. 1 cloud computing company, it's perfectly positioned to sell these solutions to customers and become an AI giant.

And when you buy shares of Amazon, you have this exposure to a high-growth area but also the security of booming e-commerce and cloud businesses that helped the company report double-digit revenue growth last year and more than $30 billion in net income. All of this makes Amazon stock, trading at 44 times forward earnings estimates, well worth the price.

2. Meta Platforms

Meta Platforms (META -2.99%) is another company that may be an important part of your daily life -- if you use Facebook, Messenger, WhatsApp, or Instagram. This social media giant owns all four, and thanks to these apps, it brings in billions of dollars in advertising revenue every year. Chances are this will continue because two things in particular should keep users coming back to Meta, therefore prompting advertisers to keep coming back to reach them.

First, Meta has a strong moat or competitive advantage in the world of social media, and that's its broad audience of loyal users -- making it difficult for any of us to switch to another platform. If we do, we may not be able to connect with all of our contacts. Meta estimates that more than 3.1 billion people use at least one of its apps every day.

Now here's the second reason why Meta should stay ahead. The company is putting a focus on AI, making the technology its biggest investment area this year. Chief executive officer Mark Zuckerberg says he aims to bring on board about 600,000 graphics processing units (GPUs) of compute this year in order ensure enough capacity for the company's projects.

Meta's plan includes launching AI tools across its products and services, making them better and better for both leisure and professional use. And Meta, developer of the Llama large language model, is maintaining its software as open source so that it might become an industry standard -- another positive point for the company. Considering this and Meta's track record of earnings growth, the stock looks cheap at 26 times forward earnings estimates -- and makes a solid AI bet to buy and hold for the long haul.