Warren Buffett is one of the world's most admired investors. He has built an unshakable legacy on the back of his long-term approach to the stock market, typically sticking with businesses he understands, and those that generate reliable growth and profitability.

His Berkshire Hathaway investment company has adopted many of those same principles in managing its $342 billion portfolio, though some of Buffett's lieutenants occasionally delve into opportunities outside his main areas of expertise.

Two of those companies are now rapidly developing artificial intelligence (AI), and Berkshire has a front-row seat as they make inroads into this new, game-changing industry. But for investors, only one of those stocks might be worth buying right now.

1. Amazon

Amazon (AMZN -1.90%) is an incredibly diverse company with a dominant presence in e-commerce, cloud computing, and digital advertising. Berkshire Hathaway invested in the stock in 2019, and its stake is worth a cool $1.3 billion today, but Buffett has repeatedly expressed regret for not identifying the opportunity sooner. 

There's probably still significant upside in the tank, though, especially because in the first quarter of 2023, Amazon CEO Andy Jassy said the company plans to build all of its business units on top of large language models. He says it will reinvent the customer experience, from online shopping to advertising to entertainment.

Plus, Amazon Web Services (AWS) is one of the oldest partners of semiconductor giant Nvidia (NASDAQ: NVDA), which currently makes the most powerful data-center chips for accelerated computing and AI training. The two parties just struck a new deal ahead of the launch of Amazon's new EC2 P5 cloud infrastructure, which will give AWS customers access to supercomputer-like performance with the ability to scale up from 10,000 GPUs to 20,000. It will allow businesses to train the most advanced commercial AI models ever. 

Circling back to e-commerce, Amazon has deployed 520,000 fully autonomous robots inside its fulfillment centers. No other company is using an army of robots anywhere near that size, and thanks to advancements in AI, they're capable of picking and packing goods 2.5 times more efficiently than human workers. If Amazon ever decides to sell its robotics products to third parties, it could be entering into an industry with an expected value of $9 trillion by 2027. 

Amazon generated $514 billion in revenue in 2022, which was more than Apple, Microsoft, and Google parent Alphabet, yet it has a smaller market capitalization than each of them. Over the next 10 years, I think Amazon has the potential to amass $5 trillion in value, which means Buffett could be set for strong gains -- and investors might want to join in. 

2. Snowflake

Berkshire Hathaway invested approximately $730 million in cloud computing company Snowflake (SNOW -0.49%) around the time it came public in late 2020. It fell into a couple of categories Buffett usually likes to avoid: technology stocks and initial public offerings. Hence, it's probable other portfolio managers within Berkshire made the bet rather than Buffett himself.

Snowflake is the creator of the Data Cloud, which is designed to break down data silos. Companies are increasingly reliant on cloud computing to run their businesses online, but it generates a substantial amount of data that's often stored in different departments, or on different platforms. The Data Cloud gives the organization a clearer view by aggregating data in one place, and it also provides powerful analytics tools to help them draw valuable insights.

Data and AI go hand-in-hand, so it's no surprise more than 1,500 customers used Snowflake to manage an AI, machine learning, or data science workload in the first quarter of fiscal 2024 (ended April 30). That was a 91% year-over-year jump. 

Snowflake also recently acquired a small company called Neeva, which developed an AI search tool built on large language models. Developers are typically the main employees with access to Snowflake's platforms, so they have a front-row seat to the unique insights drawn from their organization's data. But with Neeva, even non-technical staff could learn to use prompts to find useful information to improve business processes. 

Today, Berkshire's stake is worth a shade over $1 billion, but it was worth about 130% more when Snowflake stock traded at its all-time high in November 2021. It crashed in value during the tech sell-off in 2022, but it's also down because the company's revenue growth rate is rapidly slowing. 

In Q1, Snowflake's revenue came in at $624 million, a 48% year-over-year increase, but that was much slower than the 85% growth it delivered in the year-ago period. The result prompted the company to reduce its full-year revenue guidance for fiscal 2024 to $2.6 billion (from $2.7 billion previously), much to the disappointment of investors.

Despite the 56% decline in Snowflake stock from its all-time high, it still trades at a relatively high valuation compared with its peers in the cloud industry. Therefore, while Berkshire Hathaway is sitting on a profit in this AI play right now, there's a possibility the stock isn't done falling.