Artificial intelligence (AI) looks to be here to stay. Companies are automating processes, students are using chatbots to help them write essays, and AI is creeping more and more into day-to-day workflows for business professionals.

Although it's hard to predict what the future will be for this technology, three stocks that can benefit from its growing popularity are Microsoft (MSFT 1.82%), Palantir Technologies (PLTR 3.73%), and UiPath (PATH 0.26%).

1. Microsoft

Microsoft appears to have the pole position in AI right now, as it has already rolled out AI-powered products and services. It has invested $13 billion into OpenAI, the company behind popular chatbot ChatGPT.

Microsoft has been incorporating AI into its office products, including Word, Excel, and Outlook, as part of Microsoft 365 Copilot. The subscription will cost $30 per month, and analysts expect it could bring in $10 billion in annual revenue for the tech company by 2026.

Given that the company generates more than $200 billion in annual revenue, the Copilot subscriptions are not going to have a huge impact on the top line in the near term. But in the long run, as more products and services incorporate AI, there could be even more gains for the business. And there could also be entirely new services that arise.

If you want a relatively safe way to invest in AI, Microsoft may be your best option. Not only does its relationship with OpenAI link it with one of the best AI chatbots available now, but Microsoft's core business is already hugely successful and profitable.

2. Palantir

Palantir is a bit of a riskier play for investors, as it has only recently become consistently profitable. But the company may have more upside with respect to AI.

Its business centers around data analysis and helping organizations make crucial decisions, including governments and commercial clients. And the launch of the Palantir Artificial Intelligence Platform (AIP) has unlocked a new growth opportunity for the business, one that it is aggressively pursuing.

By the end of November, the company says it will have completed AI boot camps with more than 140 organizations -- events intended to help them discover use cases for AI and learn about how it can help them with mission-critical operations.

Efficiency is a big part of Palantir's business. CEO Alex Karp noted in the company's most recent letter to shareholders that in a span of four years, the company's revenue per employee has nearly doubled. A more efficient operation combined with more revenue growth on the horizon thanks to AI could lead to even better results for Palantir.

Through the first nine months of 2023, the company reported revenue of $1.6 billion, which was 16% higher than the $1.4 billion it reported during the same period in 2022. The difference on the bottom line was even more significant: Palantir posted a profit of $116 million through the first three quarters of this year, compared to a loss of $405 million in the prior-year period.

For long-term investors, Palantir is another good way to invest in AI. And with the business now expecting to maintain its profitability, there's less risk involved than there was in the past.

3. UiPath

UiPath is a specialist in robotic process automation (RPA). Using its software, clients can automate routine tasks and improve the efficiency of their operations. It can help businesses in virtually any industry, and its broad reach and market potential are what make UiPath another exciting AI stock to own.

In the company's fiscal 2024 second quarter, which ended on July 31, UiPath's revenue rose 19% year over year to $287 million. The business, however, remained unprofitable, incurring an operating loss of about $78 million. However, that was less than the $120 million loss it reported in the prior-year period.

As businesses continue to seek more AI-powered solutions and RPA becomes more commonplace, investors shouldn't be surprised to see UiPath's growth accelerate and its bottom line continue to improve.

UiPath is the smallest AI company on this list with a market cap of just over $10 billion, but it could also have the most upside in the long term.