What happened

Shares of C3.ai (AI 0.42%) were climbing higher today after the enterprise artificial intelligence software company reported better-than-expected second-quarter results.

The company beat Wall Street's expectations for both its top and bottom lines, and as a result, investors pushed its stock up by 6% as of 11:11 a.m. ET. 

So what 

C3.ai reported a non-GAAP (adjusted) loss of $0.11 per share, up significantly from a loss of $0.23 in the year-ago quarter and beating analysts' consensus estimate of a loss of $0.16 per share. 

The company's sales of $62.4 million -- up 7% from the year-ago quarter -- also impressed investors and outpaced Wall Street's average estimate of $60.9 million. 

"We made substantial progress ramping our consumption-based sales motion effort, which has been well received by our customers, partners, and sales organization. We expect consumption-based sales will be a substantial contributor to growth in forthcoming quarters," C3.ai CEO Thomas Siebel said in a press release. 

The company also highlighted the fact that its subscription revenue increased 26% in the quarter to $59.5 million. Additionally, the number of completed contracts in the quarter more than doubled to 25.  

Now what

C3.ai's management issued revenue guidance for the third quarter in the range of between $63 million to $65 million, which is slightly lower than Wall Street's average estimate of $66.8 million. 

But with the company beating both top and bottom line expectations in the second quarter, investors were more than happy with artificial intelligence stock today and are clearly optimistic about its potential.