There has been tremendous buzz around artificial intelligence (AI) over the past few months, and investors gained new insight into how it has the potential to substantially boost the revenue of companies looking to make the most of this hot technology.

After all, PwC estimates that AI could add $15.7 trillion to the global economy by 2030. IDC, on the other hand, estimates that global spending on AI systems could hit $154 billion in 2023 and surpass $300 billion by 2026. The market's growth will be driven by increasing investments in AI hardware, software, and services.

That's why investors looking to take advantage of this technology would do well to add some top AI stocks to their portfolios right now before they become more expensive. AI stocks are flying high this year, and they could maintain their terrific momentum, given the massive amount of money that's being spent on this technology.

Let's look at two companies that stand to win big from different AI niches.

1. Nvidia

Nvidia (NVDA 3.65%) is touted as one of the biggest beneficiaries of the growing AI adoption, as its chips play a key role in the proliferation of this technology. The parallel computing power of the company's graphics processing units (GPUs) enables data centers and servers to train AI and deep learning models since they can process massive amounts of data simultaneously.

Not surprisingly, Microsoft and OpenAI employed tens of thousands of Nvidia GPUs to train their popular chatbot ChatGPT. Also, GPUs are now being used for AI inferencing as well, a task that they were supposedly not so great at earlier. Inferencing is the process where trained AI models are put to work.

All this tells us why the demand for Nvidia's GPUs is booming. DigiTimes reports that there has been a surge in orders for the company's A100 and H100 data center GPUs that are used for AI applications, and these chips command a significant premium over the company's personal computer (PC) graphics cards.

More importantly, Nvidia is looking to push the envelope in AI chips and capture a bigger share of the tremendous opportunity here. The company will start shipping its Grace server processors this year. Nvidia is claiming that its Grace server processors are 30% more capable in terms of computing and 70% more power efficient than rivals. As a result, these chips can help data centers double their throughput without the need to consume more electricity.

Given that the market for AI chips is projected to grow to a whopping $304 billion by 2030 at a compound annual growth rate of 29% through the end of the decade, as compared to just $28 billion last year, Nvidia is at the beginning of a massive growth curve. What's more, Nvidia reportedly dominates fast-growing niches such as generative AI with a whopping market share of 90%, according to HSBC.

All this means Nvidia's data center business seems built for impressive growth in the long run thanks to the AI catalyst. Bank of America estimates that AI alone could drive 25% annual growth in Nvidia's revenue through 2027, but it won't be surprising to see the company clock faster growth, as customers are reportedly lining up to buy its AI chips.

2. Alphabet

While Nvidia could benefit big time from the hardware side of AI, Alphabet (GOOG 1.25%) (GOOGL 1.27%) is pulling out all the stops to deploy the technology in its existing services. Doing so would help Alphabet maintain its dominance in multibillion-dollar markets such as search, advertising, and workplace collaboration, among others.

For instance, the market for next-generation search engines powered by deep learning, machine learning, and AI is expected to clock 25% annual growth through 2026. Alphabet's Google is the leading search engine platform, with a market share of more than 85%. Microsoft has been reportedly making inroads into Google's territory of late with the help of its AI-powered Bing search engine, so Alphabet needs to integrate AI into its own services.

Not surprisingly, Alphabet recently revealed that generative AI will be making its way to Google Search, making it easier for users to get contextual answers to their queries, such as planning a vacation or buying a product. With the global search engine market expected to generate $348 billion in revenue by 2028 as compared to $167 billion in 2021, Alphabet's integration of AI into Search could go a long way in helping the company maintain its dominant position in this market and supercharge its growth in the long run.

Meanwhile, Alphabet is bringing a host of AI-related features to the Google Workspace suite of business applications and collaboration tools. Workspace users will be able to use AI to create slides with just text inputs, refine existing text or even create new emails or documents, and use worksheet data to create workflows or plans.

Google controls 50% of the market for office productivity software, ahead of second-placed Microsoft, which controls 45% of this market. It is important for Google to stay ahead of rivals in this market, as the cloud-based office productivity software market could be worth $127 billion in 2030 as compared to just under $21 billion last year.

In all, Alphabet could fortify its advantageous position in these huge end markets with AI's help. The stock has gained 42% so far in 2023, but it is still trading at 27 times trailing earnings, a discount to its five-year earnings multiple of nearly 30. That's why investors looking to add an AI stock to their portfolios at an attractive valuation should buy it before it is too late.