Warren Buffett has never been one to follow trends in technology. Nonetheless, his investment portfolio for Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) has become heavily weighted toward one of the biggest technology trends of the last decade: artificial intelligence (AI).

Nearly half of Berkshire's $361 billion portfolio is invested in just three AI stocks. What's more, that percentage is getting bigger, as Buffett and his team at Berkshire trim their other stock positions. But this trio has, for the most part, withstood the portfolio culling. All three present excellent investment opportunities and may deserve a spot in your portfolio.

Let's take a closer look at these three Berkshire-backed AI stocks.

1. Apple: 48.8% of Berkshire Hathaway's portfolio

Berkshire Hathaway first bought shares of Apple (AAPL -0.35%) in 2016 and has continued to buy shares. Its most recent purchase was in the first quarter of 2023 when Buffett and his team added 20.4 million more shares to bring the total to 915.6 million. Those shares now account for about 48% of Berkshire's investment portfolio.

There's a lot for Buffett to like about Apple. Its combination of hardware, software, and services gives it a strong moat. And that moat isn't just against competitors, as exemplified by the iPhone's 55%-plus market share for smartphones in the United States. Buffett said at Berkshire Hathaway's shareholder meeting earlier this year that people would rather give up their car than their iPhone if they had to choose.

Apple has been a longtime investor in AI, but you might not realize it. The company has a history of focusing on consumer benefits instead of the technology behind how it creates those game-changing features in its products. For example, AI powers lots of new features in the new iOS and WatchOS, such as live voice mail, crash detection, and abnormal ECG detection.

Apple is also starting to invest heavily in the forefront of AI development: generative AI. It reportedly built its own large language model and it's internally testing its own ChatGPT-style chatbot.

As the platform owner, Apple has a tremendous advantage if and when it rolls out a generative AI application like a chatbot. It can build it directly into the native iOS, MacOS, and WatchOS software that over 2 billion people around the world already use. That's a massive advantage that could present new revenue opportunities for Apple or simply make its devices that much more desirable.

With shares trading around 29 times 2024 earnings estimates, Apple stock carries a premium compared to the S&P 500. However, with its massive cash position and share repurchase program, the stock deserves that premium. Investors shouldn't shy away from Buffett's favorite stock.

2. Amazon: 0.4% of Berkshire Hathaway's portfolio

Berkshire Hathaway owns 10 million shares of Amazon (AMZN 3.43%) after giving its position a slight trim last quarter. The holding company first bought a stake in early 2019. Buffett previously lamented his inability to get a handle on the power of the Amazon business model and the value of the company as the big reason stopping him from buying the stock earlier.

Amazon has built a strong foundation in AI innovation that can be seen throughout its operations. From product recommendations to supply chain management to its logistics routing, AI is essential to improving Amazon's bottom line, so it has invested heavily in building advanced algorithms. More recently, Amazon integrated more advanced AI into its Alexa voice assistant.

But Amazon is also a big tech company investing in both hardware and software for generative AI. Its cloud computing business, Amazon Web Services, is helping more and more businesses bring AI capabilities to their businesses and data analysis. It invested $4 billion in Anthropic, one of the leading generative AI developers. Anthropic subsequently agreed to use Amazon's Trainium chips to train its large language model in Amazon's cloud.

As the leading enterprise cloud provider, Amazon is in a strong position to capitalize on the growing demand for AI. Despite its high valuation, shares are still attractive because the tech titan is showing improving margins and AI investments give it a lot of potential to outperform analysts' expectations going forward.

3. Snowflake: 0.3% of Berkshire Hathaway's portfolio

Berkshire Hathaway purchased a stake in Snowflake (SNOW 3.69%) just before its IPO in 2020. The 6.13 million shares it acquired have remained untouched since, and they now account for about 0.3% of the company's investment portfolio.

Snowflake has artificial intelligence at its core. It specializes in data lakes, which store unorganized data from companies. It uses AI to digest that information and create insights for enterprises, which can then be retrieved from a data warehouse as needed. Snowflake removes the need for businesses to invest in their own storage and processing and works with all the major public cloud computing providers.

As the amount of data organizations create grows, especially in developing new AI applications, Snowflake's data storage and processing service becomes increasingly valuable. On top of that, Snowflake lets businesses sell their data on its marketplace, which could become a big business as AI developers look for data to feed into their models and applications.

Despite its recent strong price performance, Snowflake stock trades at a great value relative to its historic pricing. Its price-to-sales ratio of 22.9 is below where it started the year, and well below its historic median P/S ratio above 34. As data continues to fuel the AI revolution, Snowflake will play a crucial role in helping businesses make sense of and access that data, driving strong top-line growth for years to come.