Artificial intelligence (AI) has been around for years but the industry really caught fire this year.

Following OpenAI's release of the ChatGPT chatbot last November, you can hardly read the paper or turn on the TV without finding out something new about machine learning and then next big business opportunity in the AI market. At the same time, the global economy is finally getting over the inflation scare of 2022, and the interest rate hikes that have been limiting price growth are now slowing down.

As a result, AI stocks are leading the charge in a broad-based market recovery in 2023. The S&P 500 index has delivered a total return of 15.9% year-to-date, trailing a 31.3% jump in the tech-heavy Nasdaq Composite index and an even loftier 36.9% return on the Nasdaq CTA Artificial Intelligence index.

But as investors, we should always turn away from the rearview mirror and look at the road ahead instead. What companies are poised to make a mint in the AI market over the next few years?

So I'm here to suggest two no-brainer AI buys in early July. Let's start with one of my favorite long-term stock ideas, regardless of sectors and industries, that just happens to be a giant in the field of artificial intelligence.

The ABCs of AI

I often call Alphabet (GOOG 9.96%) (GOOGL 10.22%) the best stock to own if I was forced to pick just one.

The Google parent is a genuine cash machine, generating $62 billion of free cash flow out of $285 billion in top-line revenues over the last four quarters. Don't forget that it achieved these results mostly by selling digital ads in an inflation-inspired crisis for that exact market. Now imagine what Alphabet's sales and cash profits will look like when the economy gets back on its feet and advertisers start spending real money on their marketing efforts again.

So that's one important reason why Alphabet is a strong buy right now. The stock has traded sideways for two years while trailing revenues rose by 29%. It's unusual to have Alphabet's stock available for the modest price of 5.4 times sales and 19 times forward earnings.

On top of that, this company was literally built to be flexible and adapt to dramatic market shifts. If and when online advertising truly goes out of style forever, Alphabet will be ready to run with one or more of its alternative business operations. I don't know whether it's self-driving car services, cloud computing platforms, or medical research (or maybe some unheralded idea we haven't even heard of yet) that will shoulder the financial load in the end, but Alphabet will be ready to hit the ground running.

And you may have noticed that the examples of potential growth drivers in Alphabet's future have one thing in common. Self-driving cars use AI systems to navigate real-world traffic. Google Cloud sells cloud-based access to powerful AI platforms, and you'll also find AI features across pretty much everything the computing platform offers. You can bet that the Verily Life Sciences group puts AI-driven supercomputers to good use in its medical research efforts.

The truth is, I have no real idea how much time, effort, cash, and brainpower Google and Alphabet have put into AI research over the years. But I am convinced that very few companies can match this giant's AI prowess by now. It may take some time to build consumer-ready products around some of these unknown AI assets, but you'll see that happening over the next couple of years.

The one-two punch of reasonable share prices, unbreakable flexibility in the overall business plan, and exciting AI-based growth prospects add up to a fantastic buy right now. Alphabet is an easy pick.

The unexpected underdog of automation

Now, let's talk about a company that's been flying under the radar despite its direct involvement in the AI industry. Meet UiPath (PATH 0.26%), the largely unsung hero of robotic process automation. This company is like the Swiss Army knife of automated industry processes -- it's got a tool for every job, from the mundane daily tasks to the complex business processes that make you wish you'd paid more attention in your college statistics class.

But here's the kicker: this AI stock is on fire sale in 2023.

Despite being in the thick of the AI boom, UiPath's stock has been about as exciting as watching paint dry. It's down 75% over the past two years, lagging behind the broader stock market in the last quarter. But hey, one investor's loss is another's buying opportunity, right? This could be a golden ticket for those who believe in the combination of AI brains and real-world business automation.

Now, I know what you're thinking. "The stock price is down in both the short term and over two years. Isn't that a bad sign?"

Well, not necessarily. Remember, investing of more of a marathon than a sprint. The adoption of AI and automation in business is still in its early innings, with years of blue-sky growth straight ahead. As more companies wake up to the direct benefits of automation (think cost savings, efficiency, and the joy of not making people do mind-numbing tasks), UiPath could be sitting on a gold mine.

So, to wrap it up: UiPath might not be the belle of the ball right now, but its focus on AI and automation could make it the Cinderella story of the decade. The current share price might just be the pumpkin carriage that takes you to the royal ball of money-making stock returns.