Summer is now in full swing, but the excitement surrounding artificial intelligence (AI) still appears to be in the early stages of heating up. If you're looking for companies that are on track to score huge wins with AI, some of the best opportunities could be hiding in plain sight. 

Read on to see why two Motley Fool contributors believe that buying these two stocks would be a smart move for investors looking to capitalize on the rise of artificial intelligence. 

This tech giant's AI opportunities are underappreciated

Keith NoonanWhen it comes to investor excitement about AI opportunities, it's probably fair to say that Amazon (AMZN 3.43%) hasn't been getting as much attention as Microsoft lately. To some extent, that's understandable.

While Microsoft is a heavily software-focused business, Amazon still generates a large majority of its revenue from e-commerce. Unfortunately, the online retail business has always been relatively low-margin, and costs have risen significantly over the last couple of years. 

On the other hand, the company's Amazon Web Services (AWS) business still leads Microsoft Azure in the cloud infrastructure market and stands to see long-term tailwinds related to the rise of artificial intelligence. Not only does Amazon have top-tier cloud infrastructure software capabilities and resources, but it's also been working for years on designing its own chips specifically tailored for large-language models and other generative AI applications.

Even though macroeconomic conditions mean that near-term sales growth for AWS will be pressured, the company sees a veritable deluge of demand stemming from AI and machine learning over the next few years.

Additionally, the potential for AI to have a beneficial impact on Amazon's e-commerce business shouldn't be underestimated. It's no secret that the online retail unit's rising operation expenses have weighed on the company's overall profitability lately, but there's a good chance that progression for artificial intelligence and robotics technologies can reduce warehouse and delivery costs and make the e-commerce business significantly more profitable. 

With Amazon staring down massive opportunities in AI and still trading off roughly 30% from its high, now looks like a good time to invest in the tech giant. 

AI could make Pinterest more engaging

Parkev Tatevosian: Pinterest (PINS 4.04%) is an undercover AI stock that could make an excellent investment in July. The image-based social media company can implement AI to help surface images that keep users browsing longer. Of course, Pinterest makes its revenue by showing advertisements to people on the app, so extra time means more opportunities to show ads. 

Pinterest was already doing an excellent job growing users and revenue. Indeed, from 2017 to 2022, Pinterest boosted revenue from $473 million to $2.8 billion. If AI can keep users engaged incrementally longer, that revenue could still expand further.

PINS Cash from Operations (Quarterly) Chart.

PINS Cash from Operations (Quarterly) data by YCharts.

Pinterest is already consistently generating positive cash flow from operations (see chart above), and a boost in revenue from AI is likely to create a meaningful increase. That's one reason investors have been so excited about AI -- it has the potential to increase the operational effectiveness of a business at a reasonably low cost. In other words, the return on investment is excellent for businesses.

PINS P/E Ratio (Forward 1y) Chart.

PINS P/E Ratio (Forward 1y) data by YCharts.

To make a case for investing in Pinterest stock more compelling, it's trading at an inexpensive value. Pinterest stock is selling at a forward price-to-earnings ratio of 26.84, near the lower end of its range in the last 18 months. In my opinion, long-term investors looking to capitalize on the effectiveness of artificial intelligence have an excellent choice with Pinterest stock. 

Don't miss out on the AI revolution

Even though many companies with strengths in artificial intelligence have enjoyed strong share-price performance this year, there are still AI stocks trading at levels that leave room for long-term investors to score very strong returns. While Amazon and Pinterest's respective paths forward in AI look largely different, both companies have big opportunities in the space and are valued at levels that point to the substantial upside for long-term investors.