There is little doubt that artificial intelligence (AI) will play a greater part in our lives 20 years from now. A study from IT giant Gartner says that one-third of enterprises are expected to spend at least $1 million on AI in the next two years, and all companies surveyed plan to spend some money on AI.

This could mean great things for both C3.ai (AI -0.72%) and UiPath (PATH -1.52%), both of which bring artificial intelligence to enterprises. Each company has a unique offering that tries to help its customers use AI to thrive over its competitors, and with the broad ramp-up in AI in the workplace, these two stocks could see major growth over the coming years.

C3.ai and UiPath are both down substantially from their all-time highs, which potentially gives investors a nice buying opportunity here. Here's why I think these two stocks could explode over the next few years. 

Person looking at their phone with a digital face looking back at them.

Image source: Getty Images.

1. C3.ai

C3.ai was a stock that had tremendous hype going into its IPO, but once it came public, the excitement quickly wore off. The company has never neared its IPO price, and it is currently down 84% off its all-time highs. Shares also trade at 10 times sales -- a low multiple for an AI stock -- which could allow the company to flourish over the next decade. 

When a bright developer is looking for a job working with artificial intelligence, they might be looking to work at tech companies like Alphabet or Meta Platforms, but maybe not an oil company, for example. However, the need for AI in older industries is still strong.

For companies that might not have the "wow factor" when hiring developers and talent, C3.ai brings AI models to them. The company offers an entire suite of AI models for large-scale businesses, and the company has benefited from focusing on this group of customers. It saw Q2 revenue growth of 41% year over year (YOY) to $58 million.

The company's primary revenue stream comes from the oil industry, but the company is investing heavily to expand into other industries like utilities and manufacturing, both of which have the potential to rely heavily on AI in the coming decade. C3.ai spent $83 million in the first two fiscal quarters alone to try to establish a brand name for itself, so as businesses realize they need AI to keep up with competitors, C3.ai may be the first company they look to. The company saw 63% YOY customer growth in Q2, so this spending has already seen some payoff, and it could continue as the world begins to adopt AI at a faster rate. 

The company's net income and free cash flow are not pretty, but its balance sheet is strong enough to subsidize these losses. In the first two fiscal quarters for the company, it made $111 million in revenue, but $94 million was lost. Additionally, its free cash flow was -$20 million, but the $1 billion C3.ai has in cash and investments on the balance sheet could allow the company to continue investing in its brand name and attracting customers. 

All this could result in a bright future for C3.ai, which is why I think the company could begin to crush the market in the coming years. 

2. UiPath

While C3.ai focuses on bringing a wide offering of AI tools to underserved enterprises, UiPath is looking to make all businesses more efficient with robots.

UiPath is a leader in robotic process automation (RPA), meaning the company has some of the best software automation tools on the market that free up human employees to work on more critical tasks while its RPA tools complete the repetitive tasks in an office. UiPath is not trying to get rid of human workers, but its AI can assist employees and make them more efficient by performing low-skill tasks magnitudes faster than humans can. 

This type of AI has seen major adoption, and as the leader, UiPath has followed suit. The company has over 9,360 customers and $818 million in annual recurring revenue, and the company continues to see stellar growth. Over 1,300 customers spend more than $100,000 annually, a number that jumped 52% YOY.

Like C3.ai, however, the company is not done here. It is investing heavily -- which resulted in a Q3 net loss of $123 million --  in developing new products and marketing to capitalize on the fast-growing market it sees ahead. UiPath's addressable opportunity is expected to reach $30 million by 2024, which represents tremendous growth from today, and UiPath wants to maintain its leadership position to capitalize on it.

As one of the two primary companies in the space, I am confident that it will continue to expand alongside the market. With shares trading at just 21 times sales, investors could be nicely rewarded as the company continues to succeed.