Artificial intelligence (AI) has easily been the theme of 2023, with countless companies pivoting their businesses to the budding market. The launch of OpenAI's ChatGPT last November reignited interest in the technology and made many rethink what was possible with AI.

The industry has significant growth potential, with applications in numerous sectors, from healthcare to education, machine learning, consumer products, cloud computing, and more. According to Grand View Research, the AI market hit $137 billion in spending in 2022 and is projected to expand at a compound annual growth rate (CAGR) of 37% through 2030.

As a result, it could be worth adding an AI stock to your portfolio and likely profiting from the industry's long-term development. Alphabet (GOOG 1.69%) (GOOGL 1.69%) and Amazon (AMZN 1.47%) are two attractive options, with both holding top positions in the cloud market and heavily investing in AI over the last year.

So, let's assess whether Alphabet or Amazon is the better AI stock right now.

Alphabet

In May, Alphabet CEO Sundar Pichai said in a blog post that the tech giant was seven years into its "journey as an AI-first company." While true, Alphabet has significantly ramped up its AI expansion in 2023.

In February, the company launched Bard, its answer to ChatGPT. The chatbot didn't instill much confidence in investors, with a fumbled debut that suggested its release was premature. However, Alphabet seems to have learned from its mistakes and could make a big splash in AI in 2024.

Since Bard's release, Alphabet has taken a slower approach to AI, honing its technology. Consequently, the company has been slightly overshadowed by competitors like Amazon and Microsoft, but I wouldn't count it out over the long term. Alphabet is gearing up to unveil its highly anticipated large language model, Gemini, next year. The algorithm is based on massive data sets and is expected to be very competitive with OpenAI's GPT-4.

Moreover, Alphabet is an attractive stock based on its nearly endless opportunities to monetize its AI offerings. Gemini has the potential to boost multiple areas of its business, such as offering more efficient advertising methods through Search and YouTube, improving functionality in Android, providing new AI tools on productivity services like Gmail and Google Docs, improving video recommendations on YouTube, and more.

Amazon

Amazon's stock has soared 77% year to date, with Wall Street rallying over its prospects in AI. The retail giant potentially holds an edge in the market as the home of the world's biggest cloud platform with Amazon Web Services (AWS).

Demand for AI cloud tools has soared this year as companies increasingly look for ways to incorporate the technology into their businesses. Amazon has worked to meet demand and please prominent cloud clients like Netflix, Sony, and Meta Platforms by adding a range of AI features on AWS.

Just this year, AWS introduced Bedrock, a service for building AI applications; CodeWhisperer, a tool that can generate code for developers; and HealthScribe, which can take clinical notes between doctors and patients. Moreover, CEO Andy Jassy announced in July the company will diversify its position in AI by venturing into chip development, going up against the likes of Nvidia and Advanced Micro Devices.

Amazon has big plans in AI, with its stock a compelling way to back the high-growth market.

Is Alphabet or Amazon the better stock to invest in AI?

As two of the biggest names in tech, Alphabet and Amazon each have significant potential in AI and will likely play critical roles in the industry's future. Several areas of Alphabet's business could majorly profit from AI. Meanwhile, Amazon is likely to corner the market on AI cloud computing with its dominance in the sector.

As a result, a good way to determine which of these companies is the best way to invest in AI is by looking at which is trading at a better value.

AMZN PE Ratio Chart

Data by YCharts

The table above compares these companies' price-to-earnings and price-to-free-cash-flow ratios, two helpful metrics in determining a stock's value. In both respects, Alphabet is by far the better buy. Alphabet's significantly lower figures indicate its shares are a bargain compared to Amazon.

While many AI-minded investors focused on companies such as Amazon, Nvidia, and Microsoft this year, Alphabet has slipped from the radar to the benefit of new investors. The company arguably has similar earnings potential in AI to these companies but is trading at a far better price, with Alphabet stock a screaming buy right now.