Last month, shares in Alphabet (GOOG 2.17%) (GOOGL 2.23%), parent company of Google and YouTube, went on a hot run. During this time frame, this "Magnificent Seven" stock surged in price, as concerns about competition and regulatory scrutiny subsided.

More recently, shares started to cough back these latest gains. As an investor, you may be concerned that this rally is proving to be short-lived and that a further pullback is in store.

Shares could stay under pressure in the near term, but I wouldn't rule out Alphabet's potential to remain a strong performer in the long run. Mostly, that is due to the prospect of this stock benefiting from a further valuation expansion, as generative AI strengthens all aspects of the company.

A woman uses a mobile AI app on her smartphone.

Image source: Getty Images.

Why Alphabet crushed it in September

Alphabet shares trended higher throughout August, but it wasn't until September that this popular tech stock started to take off once again. At first, this was due to a favorable court ruling in one of the U.S. Department of Justice's (DOJ) antitrust suits against Alphabet's Google subsidiary.

Ahead of the final ruling, I thought that Judge Amit Mehta would rule in favor of remedies to past alleged anticompetitive practices that would severely impact the future of not just Alphabet, but Apple, as well.

However, Mehta's decision proved to be a relative slap on the wrist. The DOJ may have touted its victory in the courts, but in the eyes of the market, the company was getting off easy. Mehta ordered an end to search exclusivity, yet continued to allow Google to pay device makers like Apple to preload its products. He also did not call for Google to divest any of its businesses, including Android and Chrome.

Investors took this decision to mean that regulatory scrutiny around Alphabet will keep dissipating. After rallying on the ruling, shares continued to climb through mid-September, due to this factor as well as increased confidence in the company's ability to capitalize on the rise of AI via the rollout of its Gemini AI platform.

Don't fear the pullback

Since last month's surge in bullishness, Alphabet continued to knock it out of the park with promising AI-related updates. For instance, the launch of an image-editing feature on Gemini helped to increase the platform's popularity, suggesting that it's starting to give OpenAI's ChatGPT a run for its money.

Google also continues to invest heavily in data centers. In recent weeks, multibillion-dollar projects in the U.K. and Belgium have been announced. The expansion of the company's data center infrastructure also stands to benefit from its fast-growing Google Cloud unit.

In mid-September, Alphabet rose to prices topping $250 per share, putting the stock safely in the $3 trillion club, although it's struggled to maintain that level and the rally has been unsteady.

While not for certain, this pullback may be due to concerns that shares have moved too far, too fast. Still, even if that is the reason, there's no need to fear any weakness or short-lived drop in market cap.

Should you buy Alphabet stock today?

In the near term, valuation concerns could continue to impact Alphabet's price performance. However, I believe that the company could be in the midst of a permanent rerating. With Gemini growing in popularity and Google now integrating it into its other products, including its Chrome browser, the company appears well positioned to use AI to deepen its competitive moat.

At the same time, Google is exploring other ways to monetize its AI investment, including through subscription-based software products like Gemini Enterprise. Increased revenue diversification could also help to justify a higher valuation for Alphabet. Right now, shares trade at a forward P/E ratio of 23, while other stocks with high exposure to the AI growth trend, like Microsoft and Amazon, trade at forward P/E ratios in the high 20s and low 30s.

An increased earnings multiple, combined with continued double-digit earnings growth, should keep this stock a strong performer for years to come. With this, I'd consider any weakness an opportunity to enter or increase a position.