The past few months, as stock prices have primarily marched higher, have felt great. However, the emotions of investing can also trap investors and shorten memories. It wasn't that long ago that the mood on Wall Street was doom and gloom.

It's easy to forget just how volatile Wall Street can be. Generally speaking, the market doesn't go in one direction for too long, and the pivot can sometimes happen fast. Many technology stocks have hit sudden turbulence over the past week or so, which could signal that this bull market's first correction is upon us.

Embrace it. Corrections are healthy and allow investors to buy high-flying stocks on a pullback. Some of the leading artificial intelligence (AI) stocks come to mind here.

Here are three stocks that investors can buy for under $1,000 and confidently hold for the long term. Consider nibbling now and buying more aggressively if market weakness continues.

1. Palantir Technologies

Data and AI software company Palantir Technologies (PLTR 3.73%) is generating a ton of growth momentum with commercial customers after building its business catering mainly to the U.S. government and its allies. Palantir builds custom software on its proprietary platforms, which help customers analyze data and trends, aiding real-time decision-making in end markets ranging from national security to healthcare. The bottom-line pitch is that data is becoming a competitive edge, and Palantir helps its customers tap into their data.

It's still remarkably early in Palantir's growth story. The company ended 2023 with just 375 commercial accounts. There are 350,000 large corporations worldwide. Now, Palantir's top 20 customers each spend over $55 million annually on average, so this software isn't going to fit into every company's budget. But it seems reasonable that Palantir could build a customer base in the thousands over the next decade and beyond.

The best part is that Palantir is also becoming a very profitable company. It's consistently profitable according to generally accepted accounting principles (GAAP), and analysts believe earnings could compound at 26% annually over the next three to five years. It isn't cheap, even for its expected growth, at 69 times earnings. Investors should relish a market pullback that offers up Palantir at lower prices.

2. Microsoft

Technology conglomerate Microsoft (MSFT 1.82%) has wedged itself into the AI battle, leaning on its cloud platform Azure and its strong partnership with ChatGPT and Sora creator OpenAI. Microsoft is weaving AI technology into its business, including Microsoft 365 software, Bing search, and enterprise software apps. Azure also powers AI for other companies as the world's second-leading cloud platform.

The great thing about Microsoft is that it's such a robust and well-rounded company that investors get some upside from AI but ultimately hold a forever stock. Microsoft generates nearly $70 billion in annual free cash flow and carries a fortress-like balance sheet with a AAA credit rating, higher than the U.S. government. In other words, Microsoft might be the world's least likely company to fail.

The combination of AI excitement and Microsoft's sterling reputation have priced the stock at a lofty 34 times earnings, and analysts expect earnings growth averaging 16% annually moving forward. If market weakness brings shares down from their all-time highs, investors should put Microsoft near the top of their buying list.

3. CrowdStrike Holdings

Cybersecurity is a tremendous long-term growth trend. The increasingly digital economy demands better security technology to protect against sophisticated attacks and hackers. CrowdStrike Holdings (CRWD 2.03%) is among a new cohort of next-generation security platforms that use cloud technology and AI to provide real-time protection that adapts and improves on the fly.

CrowdStrike sells different products and services in modules, and cross-selling to customers has supported strong revenue growth. Approximately 63% of customers pay for at least five modules as of Q3 of CrowdStrike's fiscal year 2024, and 26% pay for seven or more. The business is highly profitable, converting 30% of its revenue to cash flow, and has an additional $2.4 billion in net cash.

The stock's been on a tear, soaring 170% over the past year. Today, CrowdStrike trades at 80 times earnings, which is steep, even with annual earnings growth expected to average 36%. Again, investors shouldn't try to time their first purchase perfectly but don't jump in all at once out of fear of missing the boat. Build a position slowly, and lean into buying if the market starts pouring cold water on the stock's hot momentum.