Grand View Research estimates that spending across artificial intelligence (AI) hardware, software, and services will compound at 37% annually through 2030. That creates a significant opportunity for investors. Businesses are racing to improve productivity with predictive insights and automation, and that secular trend should drive many stocks higher in 2024 and beyond.

The most prudent way to capitalize on that trend is to build a basket of AI stocks. Here's why now is a good time to add shares of Nvidia (NVDA 6.18%), Amazon (AMZN 3.43%), and Datadog (DDOG 4.95%) to that basket.

1. Nvidia

Nvidia graphics processing units (GPUs) are the gold standard in running complex data center workloads like artificial intelligence (AI) applications. The company has regularly achieved top scores at the MLPerf benchmarks, the industry standard in benchmarking the performance of machine learning (ML) hardware, software, and services across training and inference use cases. And Nvidia holds more than 80% market share in AI/ML chips, according to analysts.

However, the company is truly formidable because of its full-stack strategy. To elaborate, Nvidia has extended its data center hardware portfolio to include networking equipment and central processing units (CPUs) purpose-built for AI, and both have become multibillion-dollar businesses. The company has also branched into subscription software and cloud services to simplify the development of AI applications, and those products have become a billion-dollar business.

Management sees those three adjacencies -- networking, CPUs, and software and services -- as key growth drivers because they extend its ability to monetize AI. Additionally, with products addressing every layer of the AI stack -- infrastructure, software, and services -- Nvidia is an even more compelling option for businesses. To that end, CFRA analyst Angelo Zino believes its "full-stack AI/software capabilities provide an incredible competitive advantage."

Grand View Research expects the GPU market to grow roughly 28% annually through 2030. When coupled with growth in other AI spending categories, that tailwind could translate into annual sales growth above 25% for Nvidia, which makes its current valuation of 30.9 times sales seem tolerable.

As a caveat, that multiple is a premium to the three-year average of 23.5 times sales, but investors with a five-year time horizon should still consider buying a small position today. Nvidia will probably command a premium valuation for the foreseeable future.

2. Amazon

Amazon operates the largest e-commerce marketplace in North America and Western Europe, and it has become the third-largest ad tech company in the world. The company is using AI to make both businesses more efficient and profitable. For instance, Amazon uses ML models to optimize inventory and logistics routes, and it recently launched a generative AI tool that helps brands create marketing content.

However, Amazon is truly primed to monetize AI because it has a dominant position in cloud computing. Indeed, Amazon Web Services (AWS) accounted for 32% of cloud infrastructure and platform services in the most recent quarter, while its closest competitor, Microsoft Azure, held 23% market share. That means AWS is arguably the cloud provider best positioned to support businesses as they experiment with AI, and its status as a leader in cloud AI developer services makes that argument even more credible.

Additionally, AWS has launched new generative AI products. Amazon Bedrock is a cloud service that supports the development of generative AI applications. And Code Whisperer is an AI-enabled copilot for software developers. The company also announced Amazon Q, a generative AI business assistant that can automate tasks and surface insights across a range of systems and data sources, including external products from Microsoft and Salesforce.

With that in mind, Morningstar analysts expect Amazon to grow sales at 11% annually through 2027, driven by particularly strong momentum in digital advertising and cloud computing. That estimate makes its current valuation of 2.8 times sales seem fair, especially when the three-year average is 3 times sales.

3. Datadog

Datadog provides observability and cybersecurity software that helps businesses monitor IT infrastructure and resolve performance issues. Its platform leans on AI to surface insights, detect anomalies, and automate root cause analysis. Datadog is a recognized leader in several software verticals, including application performance monitoring, log monitoring, and AI for IT operations.

Observability software becomes increasingly essential as IT environments become more complex. That means digital transformation projects, like cloud migration and AI deployment, are tailwinds for Datadog. But the company has further cemented its ability to monetize AI with two new products.

First, LLM Observability is a performance monitoring solution for generative AI applications and the underlying large language models. Second, Bits AI is a conversational copilot that helps development and operations teams investigate and resolve problems more quickly.

Datadog expects its addressable market to increase at 11% annually to reach $62 billion in 2026, but the company should grow much faster. In fact, Wolfe Research analyst Alex Zukin believes Datadog could become the "fastest growing software company" as the generative AI boom unfolds, and the Wall Street consensus calls for sales to increase at 26% annually over the next five years. That outlook makes its current valuation of 20.6 times sales seem reasonable.