Four times every year, we get a fantastic opportunity to take a peek inside top investor Warren Buffett's portfolio to see which stocks he's recently bought or sold. At the same time, we can examine which stocks have been around for a while and could be considered key positions for the billionaire.

This moment happens as managers of more than $100 million in U.S. securities are required to file Form 13F, detailing their latest moves, to the Securities and Exchange Commission. It happens quarterly, this past May 15 being the latest deadline for first-quarter trades. Here, we can see that Buffett, as chairman of Berkshire Hathaway, continued to maintain his position in two top artificial intelligence (AI) stocks. In fact, together, they make up more than 26% of his $258 billion portfolio.

Buffett isn't known for investing in technology, but he and his managers have made exceptions for certain incredible businesses with strong competitive positions. Of course, in true Buffett style, he's always gotten in on these players when they've traded for reasonable prices. Let's check out these two AI leaders that Buffett loves and consider whether they're still buys today.

Warren Buffett smiling at an event.

Image source: The Motley Fool.

1. Apple: 25.7% of Buffett's portfolio

Warren Buffett bought Apple (AAPL -2.88%) shares in the first quarter of 2016 and progressively added to his position until it became his very biggest. In fact, even after Buffett sold shares of the company last year, it remains his largest holding. Comments he's made throughout the years suggest Apple and its CEO, Tim Cook, remain near and dear to his heart.

During the recent Berkshire Hathaway shareholder meeting, Buffett even thanked Cook for the performance he's driven at Apple. Buffett said the late Apple co-founder Steve Jobs "really made the right decision" when choosing Cook to take over.

Apple clearly has something Buffett cherishes: a solid moat or competitive advantage. This takes the form of Apple's brand, which is so strong that customers wait eagerly for the next product update and won't switch from the company's flagship product, the iPhone, even though other brands are cheaper.

Now, Apple is infusing its products with AI in the form of Apple Intelligence. Apple wasn't first to the AI market, instead preferring to take its time to develop tools suited to its style. Apple Intelligence's very own foundation models power features that can make a difference in users' daily lives -- from writing tools to a smooth connection to ChatGPT. Requests are processed either on-device or in the cloud, but in both cases, the focus is on something very important to Apple: privacy.

Cook says AI is making a difference for growth, with the iPhone 16 performing better in markets where Apple Intelligence is available than in markets where it has yet to be launched.

Apple stock has slipped in recent weeks on concerns about the company's manufacturing dependence on China -- a country the U.S. has particularly focused on for import tariffs. But a recent initial deal between the two countries suggests the impact on companies such as Apple will be limited. On top of this, Apple has made efforts to diversify its manufacturing base, transitioning some business to India and Vietnam.

All of this means that today, trading at 28 times forward earnings estimates, down from 35 times at the start of the year, Apple looks like a great buy for long-term investors.

2. Amazon: 0.7% of Buffett's portfolio

Warren Buffett once publicly chastised himself for not buying Amazon (AMZN -0.87%) sooner. "I blew it," he told CNBC in a 2018 interview. He said he didn't realize the company's true potential. But the following year, Amazon appeared on Berkshire Hathaway's 13F after one of Buffett's investment managers bought the shares.

Amazon has remained a Berkshire Hathaway holding ever since. Buffett's comments during that 2018 interview show that he's impressed by all that Amazon has accomplished, so it's not surprising that Buffett has held on to the company after the initial Amazon buy. Amazon has "far surpassed anything I would have dreamt could have been done," Buffett said in the CNBC interview.

So, let's take a quick look at this company that, though a small part of Buffett's portfolio, has securely kept its spot. Amazon is an e-commerce giant and generates explosive growth in this market, but its biggest profit driver is its cloud computing business, Amazon Web Services (AWS). The great news is that AWS has become a giant in AI, a market expected to reach into the trillions of dollars by the 2030s.

AWS, which offers customers a wide range of AI products and services, has already gained from its investment in this technology. In the recent quarter, Amazon said AWS reached a $117 billion annual revenue run rate, thanks to demand from AI customers. And since Amazon is the worldwide leader in cloud services, it's well positioned to keep growing its AI customer base.

All of this is set against the backdrop of an already solid earnings picture. Over time, the company has increased revenue and net income into the billions of dollars. So, today, trading at 32 times forward earnings estimates, down from about 45 times in December, this stock looks like another Warren Buffett favorite that makes a smart long-term buy for both growth and security.