I doubt HubSpot (HUBS -0.78%) and Cognex (CGNX 2.06%) come to mind when most investors think about artificial intelligence (AI), but both companies use AI to great effect, and Wall Street strategists are generally bullish on the stocks.

HubSpot has a median 12-month price target of $597 per share, implying 43% upside from its current price. And Cognex has a median 12-month price target of $52 per share, implying 50% upside from its current price.

Of course, investors should never lean too heavily on price targets, but both of these little-known AI stocks warrant further consideration, given the optimism on Wall Street.

HubSpot: A leader in AI sales assistant software

HubSpot specializes in customer relationship management (CRM). Its platform brings together productivity software for sales, marketing, customer service, and operations teams, and it includes solutions for content management and commerce. Those tools help businesses generate leads, convert leads into customers, and maintain lasting relationships with those customers over time.

HubSpot started with marketing software, and it remains a leader in marketing automation, but the company has successfully expanded into the broader CRM space despite tough competition from larger companies like Salesforce and Microsoft. Its freemium pricing, tiered product offering, and broad suite of integrated CRM applications are particularly attractive to small and medium-sized businesses (SMBs).

Indeed, its strong market presence in several software verticals, coupled with a high user satisfaction score, won HubSpot recognition as the best software company in any category in 2023. That commendation comes from peer-review-based research company G2.

HubSpot delivered a strong financial performance in the second quarter. Revenue increased 25% to $529 million, and non-GAAP (generally accepted accounting principles) net income jumped 212% to $70 million. Investors can expect similar momentum for the foreseeable future. HubSpot has hardly scratched the surface of its addressable market, which management values at $77 billion by 2028, and the company is leaning into artificial intelligence (AI).

HubSpot is already a market leader in AI sales assistant software among SMBs, but it recently announced "HubSpot AI," a suite of capabilities that will automate workflows across its CRM platform. It includes generative AI assistants to help customers draft emails, build websites, and create marketing content; AI chatbots to automate customer service; and predictive AI features for forecasting and recommendations.

On that note, Morningstar analyst Dan Romanoff expects HubSpot to grow revenue at 21% annually over the next five years. That makes its current valuation of 10.6 times sales look very reasonable, especially when the three-year average is 17.1 times sales. While there is no guarantee that shareholders will see returns of 45% anytime soon, patient investors with a longer time horizon (at least three to five years) should feel comfortable buying a small position in this growth stock today.

Cognex: A leader in machine vision

Cognex specializes in machine vision systems and software, as well as industrial image-based barcode readers. Its products include simple rule-based tools and AI-enabled solutions that automate portions of the manufacturing, distribution, and quality assurance processes by identifying, measuring, and inspecting parts and packages, usually with much greater speed and precision than a human.

The company primarily serves the consumer electronics, automotive, and logistics industries, and its two largest customers are rumored to be Apple and Amazon, though neither company is mentioned by name in recent financial filings. Cognex has distinguished itself as the market leader in industrial machine vision.

Even so, the company had a dismal second quarter. Revenue fell 12% to $243 million, and GAAP net income declined 2% to $57 million. Management expects another dismal performance in the third quarter. But a few tough quarters say more about the difficult economic environment than they do about Cognex.

High inflation and rising interest rates have dampened demand for factory automation solutions, especially in e-commerce logistics and consumer electronics. Businesses have shifted focus from growth to cost control and efficiency, and Cognex is naturally struggling. But macroeconomic headwinds will ease eventually, and the company should regain its momentum when that happens.

Adoption of machine vision is still in its early stages, but Cognex is a market leader, and the market itself is expected to expand at a long-term rate of 13% annually. Better yet, management says revenue growth will outpace the industry average by 200 basis points, implying continued market share gains in the future.

That outlook makes its current valuation of 6.8 times sales -- the cheapest valuation multiple in more than five years -- look quite reasonable, if not downright cheap. While there is no guarantee Cognex will produce 50% returns in the next year, investors with a time horizon of at least three to five years should feel comfortable buying a small position in this AI growth stock today.