Warren Buffett, often regarded as the greatest investor of all time, has historically been cautious about investing in technology companies. However, whether it was his doing or due to the influence of some of its investing lieutenants, Berkshire Hathaway's (BRK.A +0.29%) (BRK.B +0.51%) portfolio holds several tech stocks, or at least tech-adjacent ones. Some of them are notable players in the growing field of artificial intelligence (AI) as well, and could deliver excellent returns over the long run as they capitalize on this massive opportunity. Three stocks in the conglomerate's portfolio, in particular, Apple (AAPL +0.47%), Amazon (AMZN +1.77%), and Alphabet (GOOG 0.05%) (GOOGL +0.06%), appear to be excellent AI stocks to buy.
Image source: Getty Images.
1. Apple -- 22.69% of the portfolio
Despite Berkshire Hathaway selling Apple shares on multiple occasions in recent years, the iPhone maker remains the conglomerate's largest holding. And although Apple is perceived as lagging behind some of its similarly sized tech peers in AI, the company is making slow but steady progress in that department. Apple added even more AI features to its latest iPhone, the 17, which is seeing strong demand. Management believes AI features are part of the reason.
The iPhone 17 and the previous 16 are hitting supply constraints, preventing Apple from meeting the high demand for these models. Over the next couple of years, the company should see a strong renewal cycle, which will help boost sales.

NASDAQ: AAPL
Key Data Points
Meanwhile, Apple is significantly increasing its AI-related investments. Apple is likely still in the early stages of its AI strategy and will capitalize on its large installed base to further strengthen its ecosystem by adding a slew of AI features across its devices. And as it does, the company's hardware business, particularly the iPhone, should continue to be a decent growth driver. Furthermore, Apple's services segment will also continue to make progress.
This long-term, high-margin opportunity will help boost profits as Apple's more than 1 billion subscriptions continue to grow. All these factors make Apple's prospects attractive and an excellent AI stock to buy and hold on to for a while.
2. Amazon -- 0.82% of the portfolio
Amazon has become a leading provider of AI services. Through its market-leading Amazon Web Services (AWS), the tech giant offers such products as SageMaker, a service that helps companies build and train machine learning models. Perhaps Amazon's best-known AI offering is Bedrock, through which it provides access to a library of generative AI models, including some of the market leaders. Amazon is also utilizing in-house AI to enhance efficiency and productivity.
The army of industrial robots in Amazon's warehouses now uses AI assistance to optimize travel routes. This aligns with Amazon's ruthless focus on customer service, as it helps expedite shipments to customers even faster. These initiatives are expected to continue positively impacting the company's financial results.

NASDAQ: AMZN
Key Data Points
Amazon's cloud computing business is performing very well and has recently achieved sales growth of the kind it had not seen in years. Meanwhile, Amazon's robot-related efforts should help cut costs and increase margins within its e-commerce business. The best part is that these are long-term opportunities for the company, and it boasts a strong economic moat thanks to switching costs within its AWS division and strong network effects for its e-commerce business. All these factors make it a top AI stock to buy and hold.
3. Alphabet -- 1.62% of the portfolio
Alphabet is a newcomer inside Berkshire Hathaway's portfolio, with the conglomerate initiating a position for the first time during the third quarter. The online search leader is also establishing itself as a leader in AI, although at first, many thought the rise of chatbots would disrupt its search empire; however, it has adapted thanks to AI. Alphabet's AI overviews and AI mode are achieving strong success. Alphabet also offers access to a variety of AI services through the cloud, which are helping that segment -- already the company's fastest growing -- expand even faster.

NASDAQ: GOOGL
Key Data Points
Meanwhile, the company recently launched its newest AI model, Gemini 3, which it says is its best one yet. It's clear that Alphabet is benefiting from AI, and not seeing its business decline because of it, as some predicted. And there is more to come, as the company continues to innovate. It adds to the long list of growth drivers it boasts, which also include its streaming ambitions through YouTube and a large and growing number of Google subscriptions. Berkshire Hathaway was right to initiate a position in this excellent AI stock.