Mechanical fault diagnosis and detection are crucial for enhancing equipment reliability, economic efficiency, production safety, and energy conservation. In the era of Industry 4.0, artificial intelligence (AI) has emerged as a significant tool for mechanical fault diagnosis and detection, attracting considerable attention from both academia and industry. This review focuses on the application of AI techniques in mechanical fault diagnosis and detection using artificial intelligence techniques based on the existing research. It examines various AI algorithms including k-nearest neighbors, support vector machine, artificial neural network, deep learning, reinforcement learning, computer vision, and transformer algorithm integrating theoretical foundations with practical applications in industrial production. Furthermore, a comprehensive overview of these algorithms applications in mechanical fault diagnosis and detection is provided. Finally, a critical assessment highlights the advantages and limitations of these techniques, while forecasting the developmental trajectories of future intelligent diagnostic technologies based on machine learning. This review serves to bridge the gap between researchers in AI and fault diagnosis, contributing significantly to the field.