Amazon (AMZN -1.07%) has had a challenging couple of years, as 2022's macroeconomic deceleration led to significant declines in its e-commerce segments. Meanwhile, rising interest rates caused some businesses to trim spending on cloud services, which slowed the revenue growth of Amazon Web Services (AWS). However, the long-term outlooks for both online retail and the cloud market remain strong, and Amazon is likely to benefit substantially as both industries recover.

In 2023, Wall Street made efforts to get past the economic deceleration, in part on the prospects of new developments in artificial intelligence (AI). According to data from Grand View Research, the AI market is projected to expand at a compound annual rate of 37% through 2030. Meanwhile, Amazon's position as the biggest cloud infrastructure company and recent developments in its generative AI offerings are likely to lead to compounding growth as well. Wall Street likes what it sees in this regard and, so far in 2023, has Amazon shares trading up a whopping 51%. More and more analysts believe a bull market could be underway, and it's likely to take Amazon's stock right along with it.

Should you follow Wall Street's lead? Here are two reasons you might want to consider investing in Amazon now -- and no surprise, they both involve AI.

1. Amazon is making inroads into generative AI

The launch of OpenAI's ChatGPT last November triggered something of a stampede as countless companies rushed to either form partnerships with OpenAI or launch their own competing versions of the generative AI chatbot. Microsoft (MSFT 1.70%), a major investor in OpenAI, got early access to ChatGPT to add it to various Microsoft software and services, including its list of cloud services through Azure. Alphabet (GOOG 0.77%) (GOOGL 0.84%) responded by launching its competing generative AI platform, Bard. With all eyes on AI chatbots, Amazon -- without a version of its own -- appeared to be lagging behind. 

However, the company strategically pivoted to alternative generative AI services to attempt to dominate other areas of the high-growth market rather than directly competing with ChatGPT. In doing so, Amazon is playing the long game, positioning itself as a leader in other forms of AI while all eyes are temporarily on chatbots. 

In mid-April, AWS launched Bedrock, a generative AI service that helps clients produce digital tools like chatbots and image-generation programs. Bedrock can also create content, such as a targeted ad campaign based on a company's product description. Additionally, the company recently added a service called CodeWhisperer to AWS, which makes software development easier by generating code based on a developer's needs. 

AWS holds a leading 32% market share in the cloud infrastructure industry, while Microsoft sits in the No. 2 spot with 23% (Alphabet's Google Cloud is a distant No. 3 at 10%). If Amazon can continue offering cutting-edge generative AI services, it will likely retain its lead and be well-equipped to significantly profit from the industry's growth. 

2. Amazon is taking on Nvidia 

Amazon is also taking its AI business to the next level by expanding into hardware. After utilizing Nvidia's graphics processing units (GPUs) to boost the power of AWS for over a decade, the company is now designing some machine learning accelerators of its own -- the Inferentia and Trainium chips. The company aims to make it easier for developers to run intensive AI workloads in the cloud at accessible prices. Amazon CEO Andy Jassy recently said in an interview with CNBC that the new chips its designing will have "much better price-performance than you'll find anywhere else."

Nvidia currently has an 80% to 95% market share in AI chips. Meanwhile, other semiconductor companies such as Advanced Micro Devices are working hard to produce chips capable of offering an alternative to Nvidia's. Amazon is joining an already competitive market. However, its respected brand combined with attractive pricing gives it massive potential in the space. 

Additionally, the move into chip production is favorable for its business, as the ability to procure hardware tailored specifically to its AI models could allow it to offer the most powerful AI cloud services in the industry, making it easier for Amazon to stay ahead of rivals like Microsoft and Alphabet. 

Amazon shares have flown high in the first half of this year. However, its leading market share in e-commerce and cloud computing could bolster its business and stock price over the next decade and beyond. Given all that, Amazon stock is still too good an opportunity to pass up in a possible bull market.