Both 2021 and 2022 were rough for Palantir Technologies' (PLTR -0.84%) stock, but 2023 has been the complete opposite, with the stock up more than 87% year to date as of May 24. It seems as if popular investor Cathie Wood and her firm ARK Investment Management have also taken notice.

After adding 1.26 million shares of Palantir across its exchange-traded funds (ETFs) in mid-May, ARK Invest added around $4 million more in shares on May 22:

Fund Shares Bought Value on Day of Purchase
Ark Innovation ETF (ARKK -0.26%) 243,158  $2.9 million
ARK Next Generation Internet ETF (ARKW -0.01%) 42,162 $500,000
Ark Fintech Innovation ETF (ARKF -0.26%) 54,250 $642,000

Data source: ARK Invest. Closing price on May 22, rounded to the nearest thousand.

These recent additions aren't ARK Invest's first rodeo with Palantir. A few of its ETFs held the stock from 2020 to 2022, including its flagship ARKK fund, which had over 24 million shares before selling them all in February 2022. With Wood and ARK Invest doubling back on Palantir, should you buy the stock?

Encouraging financial performance in the first quarter

A lot of Palantir's current 2023 success can be credited to two things: encouraging earnings and recent artificial intelligence (AI) hype.

In the first quarter, Palantir made more than $525 million in revenue, up 18% year over year and beating Wall Street's estimates. This translated into its second consecutive quarter of profitability under generally accepted accounting principles (GAAP). Operating income -- a company's profits from its core business -- was $4 million, compared to a roughly $40 million loss last year in the same period.

Add that to Palantir's $188 million in free cash flow in the first quarter rising from around $29 million in the first quarter of 2022, and it's no wonder investors -- old and new -- got excited about the stock again.

The AI race is alive and well

Although AI is relatively new to the mainstream, Palantir has been dealing with it in some form for roughly two decades. The company specializes in big data and analytics and plans to use this expertise to help propel its new Artificial Intelligence Platform (AIP).

AIP allows users to apply large language models (like those used by ChatGPT) in more customizable ways that make sense for them. They can leverage AI to be more efficient at predicting outcomes, identifying patterns, giving insights, and more.

Palantir CEO Alex Karp said, "The depth of engagement with and demand for our new Artificial Intelligence Platform is without precedent," which says a lot given the recent AI race by big tech. If Karp is right, AIP should be a major growth driver for Palantir.

ARK is known for investing in innovative and disruptive companies, so it's no surprise that recent AI developments reignited its interest in Palantir. Considering that its customers are mostly governments and corporations, it's also better positioned than most to monetize AI on an enterprise scale.

Build a stake in the company consistently

If you're a long-term investor, there's no "wrong" time to invest in a great company per se, but there are less-than-ideal times. With Palantir's recent stock price spikes, you have to wonder how much is built on hype and how much is sustainable, especially with so much economic uncertainty right now.

Palantir is a growth stock, so it's volatile by nature, but the rest of 2023, especially, could be full of swings. If you're looking to buy shares, now would be a good time to dollar-cost average your way into it.

Suppose you want to put $1,000 into Palantir. Instead of investing that all at once, you could break it down into four $250 investments, or 10 $100 investments, or whatever else works for you. Approaching it this way can help avoid investing a lump sum right before a huge downward swing.

Palantir looks like a good long-term option; just be ready to stomach some short-term swings along the way.