Artificial intelligence (AI) is becoming a bigger part of our lives in several ways, and we interact with it in different forms almost every day. From booking a cab on a virtual assistant to interacting with a customer service agent, AI works in the background to help make the experience better.

And AI will proliferate even faster in the coming years. JPMorgan, for instance, believes that sales of AI-related software, hardware, and other services will grow from an estimated $12 billion last year to roughly $58 billion in 2021.

There are several ways for investors to tap into the AI trend. Let's look at three of them, and the corresponding companies -- Twilio (NYSE:TWLO), Salesforce.com (NYSE:CRM), and Alphabet (NASDAQ:GOOG) (NASDAQ:GOOGL) -- that could add value to a portfolio.

Man holding a tablet projecting a brain.

Image source: Getty Images.

Twilio can ride the speech recognition wave

Allied Market Research believes that speech recognition will be the fastest-growing segment in AI over the next five years. And one company is on track to take advantage. Last October, cloud communications specialist Twilio announced the general availability of its AI-driven speech recognition platform, which can convert speech into text in as many as 119 languages and dialects.

Twilio's automated platform can also analyze the intent of a caller. The company's clients can thus make their interactive voice response (IVR) systems smarter, as callers can simply state the menu they want to go to instead of pressing buttons on a keypad. Additionally, Twilio's clients can capture key data like names, addresses, and account numbers automatically, allowing the customer service agent to focus on other important requirements.

The deployment of such intelligent software capabilities is one reason Twilio is witnessing a massive increase in its customer base. The company's active customer accounts shot up almost 33% year over year to 54,000 at the end of the previous quarter, helping it smash its own estimates by a wide margin.

Twilio has also boosted its full-year revenue and earnings targets. It now expects a loss of $0.08 a share as compared to its original expectation of $0.12 a share, indicating that it is moving closer to profitability. Analysts expect its earnings to increase at an annual pace of 20% over the next five years, which doesn't look like a long shot given its focus on AI.

Salesforce has you covered in CRM

AI is going to revolutionize customer relationship management (CRM), and there aren't many better bets than Salesforce.com to tap into this. The company forecasts that spending on AI deployment in CRM could jump from $7.9 billion in 2016 to as much as $46.3 billion in 2021.

Salesforce now accounts for almost a fifth of the overall CRM space, while its next nearest competitor, Oracle, has a market share of just 7.1%. What's more, the company's 2017 market share increase eclipsed the combined growth of the next 20 CRM providers, allowing it to expand its market share for the fifth consecutive year.

As such, Salesforce is in prime position to take advantage of AI in CRM. Assuming that the company continues to control 20% of the CRM market for the next three years, it could generate over $9 billion in AI-related revenue, provided the market becomes as big as Salesforce forecasts. By comparison, Salesforce has generated just over $10 billion total in trailing-12-month revenue, so AI can give it a big shot in the arm going forward.

Salesforce's AI tools have already gained impressive traction among customers. For instance, its AI-driven Einstein platform was carrying out more than 1 billion AI-powered predictions every day in February, less than two years after launch. Salesforce has made Einstein more capable by adding tools like a prediction builder, which allows businesses to predict outcomes on the basis of the data they feed into it. And one of Salesforce's banking customers used Einstein to register a 10-point increase in its net promoter score (NPS), a measure of how willing a company's customers are to recommend its products and services to others.

Alphabet is making a dent in smart speakers

Sales of AI-enabled speakers, better known as smart speakers, tripled last year, and the hype isn't going to die down anytime soon.

Research company Gartner predicts that 75% of U.S. households will have a smart speaker by the end of the decade, up from just 7% around a year ago. And it forecasts that a quarter of these households will have more than two devices, so sales of smart speakers could hit 138 million by 2020 in the U.S. alone, six times the 23 million speakers sold last year.

Alphabet subsidiary Google is the rising star in smart speakers. It is expanding its smart speaker lineup to offer more voice-controlled smart-home products and expand market share. It's working, as Google cornered 30% of smart-speaker sales in the U.S. that boosted its market share to 18.4% in 2017, up from just 7% in 2016 as it ate into rival Amazon's market share with a flurry of new products.

It won't be surprising if Google can sustain its impressive smart speaker momentum thanks to a recent decision. Earlier this year, Alphabet sent the Nest smart-home subsidiary back into Google's fold. This is aimed at promoting better integration between the Nest and Google hardware development teams, allowing Google to bolster its position in smart speakers, which are the basis of smart homes.

Still taking off

AI has already started bearing fruit for Alphabet, Twilio, and Salesforce.com. The areas that these companies are targeting -- smart speakers, CRM, and speech recognition -- are just beginning to take off. If you're looking to invest in the AI boom, consider these stocks for the long haul.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Harsh Chauhan has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), Amazon, Salesforce.com, and Twilio. The Motley Fool owns shares of Oracle and has the following options: short June 2018 $52 calls on Oracle and long January 2020 $30 calls on Oracle. The Motley Fool has a disclosure policy.