Since the launch of OpenAI's chatbot, ChatGPT, the focus on generative artificial intelligence (AI) has increased by leaps and bounds. In fact, the global generative AI market is estimated to grow annually at a compound average growth rate (CAGR) of nearly 80% from $1.75 billion in 2022 to $33 billion in 2027.

Not surprisingly, retail investors stand to benefit by picking up high-quality stocks that have exposure to this emerging tailwind. Here's why Meta Platforms (META 0.43%) and Datadog (DDOG 4.95%) fit the bill and can prove to be attractive buy-and-hold stocks in the ongoing AI boom.

Meta Platforms

Social media giant Meta Platforms has been a hot topic in 2023, with shares surging by nearly 148% so far this year. The growth seems even more impressive considering that the company's financial performance depends heavily on advertising -- a sector deeply affected by the current tough macroeconomic conditions. Investors have also been concerned about the company's heavy investments in the metaverse.

Despite these headwinds, Meta posted solid numbers in the second quarter. The company saw the daily active people (DAP) using its family of apps (Facebook, WhatsApp, Messenger, Instagram, and Threads) rise by 7% year over year to 3.07 billion and the number of monthly active people (MAP) grow by 6% year over year to 3.88 billion.

The company's use of AI, to analyze people's preferences and interactions and recommend relevant advertisements and content as well as track ad performance for sellers, is driving up engagement and monetization on the platform. AI-recommended content from unrelated accounts has emerged as the fastest-growing content category on Facebook Feed and has driven up the time spent on the platform by 7% in the second quarter. AI is also helping improve monetization with automated ad products called Meta Advantage.

Meta is working on integrating AI into its backbone infrastructure, which includes AI-optimized data centers, customized AI chips, and its 16,000-GPU supercomputer. The company launched AI Sandbox for advertisers, which helps them leverage the power of generative AI for a range of tasks including creating diverse variations of the same ad copy for different audiences, background creation based on text prompts, and image cropping for Facebook and Instagram ads.

Besides AI initiatives for its family of apps, Meta is also focused on monetizing short-form video feature Reels, Twitter clone Threads, and the Whatsapp Business app to drive top-line growth. CEO Mark Zuckerberg has dubbed 2023 the "Year of Efficiency" and has been aiming to make the organization more lean and flexible by laying off middle management staff and eliminating non-critical projects.

Wall Street analysts are forecasting the company's non-GAAP (adjusted) earnings per share (EPS) to reach $16.7 in fiscal 2024. Multiplying this by the company's forward P/E multiple of 22.4 produces a share price of $378, implying a decent upside potential close to 27%. Hence, it seems to make sense for investors to opt for a modest investment in this AI stock.

Datadog

Datadog is a cloud-native "observability" company that monitors servers, databases, tools, and services through its platform. Its shares dropped by a staggering 17% in a single day after the company reported second-quarter results on Aug. 8. The company's revenue surged by 25.4% year over year, reaching $509.5 million, while adjusted net income was up 50% year over year to $125 million. Despite the better-than-expected results, the gloomy outlook for the third quarter and full year did not sit well with the investors.

Although Datadog is facing near-term headwinds as large customers continued to optimize spending on cloud and observability in the second quarter, its long-term growth prospects still seem promising. Growing adoption of digitization and advanced technologies such as big data, cloud computing, machine learning, and AI have made its tools mission-critical for enterprises.

With Datadog's observability and cybersecurity platform providing real-time visibility to enterprises in their applications, databases, servers, and networks by pooling together diagnostic data, organizations are better equipped to quickly identify pain points and resolve them.

Hence, even in a supposedly difficult second quarter, Datadog saw a 23% year-over-year increase in total customer count to 26,100 customers -- which includes 2,990 customers who spend over $100,000 or more annually on the company's offerings.

Although the trailing-12-month dollar-based net revenue retention rate dropped year over year by 10 percentage points to 120% at the end of the second quarter, it was still above 100%, highlighting the success of the company in cross-selling and upselling to its existing customer base.

Datadog is also introducing new AI-based products to strengthen its position. This includes a large language model (LLM, used to power generative AI applications) observability product, to enable LLM developers to monitor the performance, quality, and accuracy of these models. The company has also introduced Bits AI, which acts as an incident management copilot and helps businesses identify and automatically remediate critical technical issues.

Datadog has a strong balance sheet -- $2.2 billion in cash and $885 million in total debt at the end of the second quarter -- giving the company much-needed flexibility to further fund its AI initiatives. The company's management is also well-known for providing conservative guidance and then outperforming its outlook on a quarterly basis.

Wall Street also seems to have deduced this trend. Out of the 38 analysts covering the stock, 29 recommend buying, despite the recent share price fall. Given the backdrop of high analyst confidence and the company's strong fundamentals, it makes sense for retail investors to consider a small position in this stock.