The launch of ChatGPT has overwhelmingly been revolutionizing the stock market. Of particular interests of stock traders and financial analysts, discovery about artificial intelligence stock market has become the main focus. The paper selected top worldwide artificial intelligence (AI) enterprises from Yahoo Finance and made future return forecasts with the long short-term memory networks (LSTM). The predicted information is employed in conducting portfolio optimization within the scope of mean-variance analysis to obtain an assessment of the portfolios performance. The outcomes illustrate that the utilization of the LSTM model exhibits aptness in forecasting the forthcoming returns of financial instruments. Furthermore, a favorable preference entails the inclusion of NVDIA and Microsoft stocks in the portfolio. These discoveries offer utility in proposing pioneering investment strategies and aligning with the prevailing tendencies of societal progression.