Explosive leaps forward in artificial intelligence (AI) capabilities have been getting lots of attention lately. They've also helped power strong gains for the stock market this year, and a powerful new bull market could be on the horizon. 

On the other hand, not every company with strong positions in AI has rocketed to new valuation highs. There are still some great AI stocks trading at big discounts, but investors need to be prudent about which ones they put their money into. Read on for a look at two top AI stocks that are worth buying and holding for the long term -- and one that should be avoided like the plague.  

Buy Snowflake to capitalize on the data boom

Snowflake (SNOW 3.69%) is a leading provider of data-warehousing and analytics tools that are making it possible for AI software creators to build better models. The company's Data Cloud platform allows users to combine and analyze information from otherwise walled-off cloud sources. Given that having access to relevant data is crucial for building and improving AI applications, Snowflake looks poised to play an important role in the artificial intelligence revolution.  

But Snowflake has seen macroeconomic conditions pressure its sales growth and valuation. The company's share price is down roughly 63% from the high it reached in November 2021.

On the other hand, on April 30, the company ended its first quarter of fiscal year 2024 with remaining performance obligations up 31% annually at approximately $3.4 billion. Remaining performance obligations represent contracted future revenue that has not yet been recognized. So it seems clear enough that demand for its services will remain solid through at least much of this year.

What's more, it's encouraging that the company has continued to gain ground with large customers. Product revenue from Global 2000 companies increased in the quarter, and the company's count of onboarded Global 2000 customers increased 15% year over year in Q1 to hit 590. Snowflake was able to grow its product revenue 50% year over year to reach $590 million in the period thanks primarily to its strength with large customers, and it looks like the business will continue serving up strong sales growth. 

Buy CrowdStrike to profit on AI cybersecurity trends

CrowdStrike (CRWD 2.03%) is a leading provider of cybersecurity protections for computers, mobile hardware, and other endpoint devices. The company's Falcon software platform uses AI to detect, categorize, and counteract threats, and its adaptive capabilities look poised to continue winning customers in the evolving cybersecurity landscape. Cyberattackers will make increasing use of AI, and businesses and institutions will need defenses that can keep pace.  

As the number of threats has grown, CrowdStrike has continued to attract new customers and expand relationships with existing clients. Today, 62% of customers use at least five service modules on the Falcon platform.

The company has already scored huge wins in the enterprise market, and it's now aiming to move downmarket and drive adoption for its services among small and medium-size businesses (SMBs). Scoring wins with large customers is central to the company's growth engine, but bringing smaller customers on board and helping them to grow provides additional avenues to success.

CRWD PS Ratio (Forward) Chart

CRWD PS Ratio (Forward) data by YCharts

In CrowdStrike's first quarter, sales increased 42% year over year to reach $693 million. Meanwhile, non-GAAP (adjusted) net income rose 82% to hit $136 million.

Valued at roughly 62 times this year's expected earnings and 11.6 times expected sales, CrowdStrike has a growth-dependent valuation. But it's increasing sales and earnings at rates that suggest that long-term investors could see very strong returns on the stock. With the company's share price down 49% from its peak, CrowdStrike looks like a smart buy. 

Avoid C3.ai due to valuation and speculative growth path

C3.ai (AI 3.02%) stock has posted explosive gains this year thanks to surging excitement surrounding artificial intelligence technologies. Despite still trading down 82% from its high, the company's share price is up roughly 187% year to date.

While the company grew sales just 5.6% in its most recent fiscal year, which ended April 30, C3.ai stock is valued at more than 12 times this year's expected sales. Following the launch of its generative AI services, the company does expect sales momentum to pick up this year, but the stock looks pricey. 

AI PS Ratio (Forward) Chart

AI PS Ratio (Forward) data by YCharts

For its current fiscal year, the company is guiding for revenue to come in between $295 million and $320 million. Hitting the midpoint of that range would mean delivering annual sales growth of roughly 15%.

While it's encouraging to see growth momentum picking up, that level of sales expansion may not be enough to justify its current valuation. And the company still expects to post an adjusted loss between $50 million and $75 million for the year. 

With such a rich valuation, it's probably best to avoid C3 stock right now.