Excitement about AI stocks has driven the S&P 500 to record levels this year. The major benchmark is on track…