Megacap technology companies have dominated the conversation when it comes to artificial intelligence (AI), and for good reason. These companies are both spending big and profiting nicely as the technology advances.

However, megacap stocks are not the only way to play the trend in AI. Let's look at two smaller stocks that have a good opportunity to outperform their larger peers in the coming years.

Artist rendering of AI in the brain.

Image source: Getty Images.

SoundHound AI

SoundHound AI (SOUN -2.69%) is tackling AI much differently than most megacap AI companies. The company has built a speech-to-meaning and deep-meaning understanding platform that can figure out what a user's intent is before they finish speaking, which is much more akin to how people process speech.

That might not sound like a big deal, but as AI moves beyond simple generative AI chatbots to autonomous agents that plan and act, real-time understanding of intent is a major advantage. While there are a lot of companies chasing AI agents, SoundHound's focus on voice-first interaction is what sets it apart.

SoundHound's acquisition of Amelia last year helped change its path from a company that at the time had made most of its inroads in the automobile and restaurant industries. Amelia brought with it virtual agents that served complicated, highly regulated sectors like healthcare and finance that needed to understand industry jargon and compliance rules.

It then combined Amelia's conversational intelligence with its own speech-to-meaning technology, to create Amelia 7.0, which behaves more like a digital employee than a virtual assistant. Instead of just answering questions, it can integrate with ERP and CRM systems to handle transactions and customer service interactions end to end.

The company is migrating 15 of its largest enterprise clients to Amelia 7.0, and it recently bought another company, Interactions, to help orchestrate its AI agents across different systems. It's also added AI vision technology to its platform.

SoundHound was already seeing huge revenue growth before its AI agent push, but this shows a company that is able to quickly pivot to where the market is headed. Last quarter, its revenue skyrocketed 217% year over year to $42.7 million, and management expects it to reach adjusted EBITDA (earnings before interest, taxes, depreciation, and amortization) profitability by the end of 2025, which would be an important milestone.

SoundHound is still an early stage growth story, and competition in agentic AI is fierce, but its unique approach and ability to quickly adapt to a changing market could set it up to be a huge winner in the coming years.

GitLab

GitLab (GTLB -4.98%) is not as flashy as some AI companies, but it has nicely positioned itself as an essential tool for the world's software developers. The company started out simply as a DevSecOps platform that customers would use as a safe platform to store their code, but it has evolved into a full software development life cycle solution that can also help developers save time in their daily routines.

AI has become central to that mission, as its Duo AI agent automates repetitive tasks that eat up most of a developer's day. Developers only spend about 20% of their time coding, so anything that frees up more time to actually write code drives productivity. That's why Duo AI has the potential to be a big growth driver moving forward.

Where there were some initial fears that AI would shrink the need for human coders, hurting GitLab's seat-based business model, thus far, the opposite has been true. The rise of AI has sped up software creation, leading to more projects and more demand for GitLab's platform. The company has partnerships with leading cloud computing providers, such as Amazon's AWS and Alphabet's Google Cloud, which also helps it capture enterprise customers building AI-driven applications in the cloud.

GitLab has consistently seen strong revenue growth, with revenue rising between 25% and 35% for eight straight quarters, including a 29% jump last quarter to $236 million. Much of the growth is coming from existing customers expanding their use of the platform by adding seats and moving up to higher-tier plans. This led to a robust 121% dollar-based net retention over the past 12 months.

Moving forward, one of GitLab's biggest opportunities is its recent shift to a hybrid seat-plus-usage pricing model. This gives it more upside as usage grows, while also protecting it if AI ever does reduce the number of developers on a project.

GitLab's steady growth and strategic pricing shift make it an underappreciated way to invest in the AI boom. The stock is also cheap, trading at a forward price-to-sales (P/S) ratio of under 7 times 2026 analyst estimates. Between its growth and valuation, the stock is well positioned to outperform in the years ahead.