The U.S. stock market has made a remarkable turnaround in 2023 from its once-in-a-decade low in 2022. The benchmark S&P 500 index is already up nearly 28% from its bear-market low of October 2022. The benchmark index now needs to climb by less than 5% to create an all-time high. Once this happens, we can conclusively announce the beginning of a new bull market.

In such a favorable macroeconomic environment, it makes sense for investors to pick up stakes in high-quality stocks benefiting from rising secular tailwinds. With artificial intelligence (AI) emerging as the hottest trend of 2023, investors should consider shares of Palantir Technologies (PLTR 3.73%) and Alphabet (GOOG 9.96%) (GOOGL 10.22%). Both are using AI technologies to not only strengthen their core businesses but also add new revenue streams.

So in case you have $500 that is not needed to pay bills or other contingencies, consider buying and holding these stocks for the next decade.

1. Palantir Technologies

Shares of data mining and analytics company Palantir have surged by more than 200% so far in 2023 -- a remarkable turnaround for a stock that had lost nearly 65% of its market value in 2022.

The company started its journey with the Gotham platform, which processed large data streams with AI and machine learning algorithms to provide actionable insights to government clients. Subsequently, the company expanded into the commercial sector with its Foundry platform.

In April 2023, Palantir launched its game-changing Artificial Intelligence Platform (AIP), which integrates large language model capabilities in its core machine learning technology and enables clients to interact with the system using a chatbot. Since its launch, AIP has already attracted nearly 300 enterprise clients -- which highlights the demand for this groundbreaking product.

Palantir earned nearly 55% of its total revenue from its government business in the third quarter. Government business is built over time and involves significant trust between partners. Hence, although the company's government revenue grew at only 12% year over year to $308 million in the third quarter, these customers are highly sticky. Furthermore, Palantir expects government demand for Palantir Gotham and AIP to increase dramatically in the current geopolitical environment.

The company has also made impressive inroads in the commercial segment, with revenue there growing by 23% year over year to $251 million in the third quarter. The pace of growth was even more pronounced in the U.S. market, where commercial revenue was up by 33% to $116 million.

Palantir expects to rapidly increase its commercial customer base with its innovative go-to-market strategy called AIP Bootcamp. Deviating from the traditional pilot project strategy, which requires one to three months, AIP Bootcamp allows multiple clients to test the company's platforms for real workflows within five days. Since the customer has a solid idea of the benefits that can accrue with the use of Palantir software, it helps accelerate customer negotiations while also resulting in improved unit economics (reduced per-client marketing expenses) for Palantir.

Financial performance in the third quarter was remarkable, with Palantir reporting a positive net income for the fourth consecutive quarter. Hence, even though the shares trade at a price-to-sales multiple of 20.8 -- significantly higher than the industry median of 2.2 -- Palantir's sticky government customer base, increasing penetration in the commercial segment, solid adoption of AIP, innovative go-to-market strategy, and improving profitability justify its premium valuation.

2. Alphabet

Alphabet, the parent company of Google, has demonstrated remarkable resilience in its core advertising business -- especially in the high inflation environment of 2022. However, now the situation seems to be on the verge of recovery.

Google advertising revenue (prominently earned from the Google search engine and other Google-owned and operated properties such as Gmail, Google Play, and Google Maps, as well as from YouTube and other Google network partners) rose by 9.5% year over year to $59.6 billion. Despite increasing competition from Microsoft's ChatGPT-powered Bing search engine, Google Search dominated the global search market with a 91.5% share. Google also accounted for a nearly 39% share of the global digital advertising revenue in 2023.

To further maintain its market leadership in the search space, Alphabet has been integrating generative AI capabilities into its search technology, referred to as the Search Generative Experience (SGE). The company has added capabilities such as videos and images into responses, image generation, and understanding and debugging of code to its search experience. These features may further help increase user engagement.

Furthermore, the company is also experimenting with generative AI to help advertisers create relevant, high-quality ads. Alphabet is also gearing up for the launch of a large language model (LLM) called Gemini as a competitor to OpenAI's ChatGPT in 2024.

Although Google Cloud lags behind Amazon's Amazon Web Services (AWS) and Microsoft's Azure in terms of market share, it still has the potential to become a solid growth driver in the coming years. Currently, Google Cloud accounts for around 60% of the world's top 1,000 companies. By offering AI-optimized cloud infrastructure to train and deploy LLMs, Google Cloud has also managed to attract over half of the funded generative AI start-ups in the world.

Despite the many pros, Alphabet trades at a price-to-sales ratio of 5.2, even lower than its five-year average multiple of 5.9. Considering its strength in search and cloud business, AI capabilities, and a very reasonable valuation, Alphabet seems to be an obvious pick now.