Artificial intelligence (AI), especially deep learning, is gaining extensive attention for its excellent performance in medical image analysis. It can automatically make a quantitative assessment of complex medical images and help doctors to make more accurate diagnoses. In recent years, AI based on ultrasound has been shown to be very helpful in diffuse liver diseases and focal liver lesions, such as analyzing the severity of nonalcoholic fatty liver and the stage of liver fibrosis, identifying benign and malignant liver lesions, predicting the microvascular invasion of hepatocellular carcinoma, curative transarterial chemoembolization effect, and prognoses after thermal ablation. Moreover, AI based on endoscopic ultrasonography has been applied in some gastrointestinal diseases, such as distinguishing gastric mesenchymal tumors, detection of pancreatic cancer and intraductal papillary mucinous neoplasms, and predicting the preoperative tumor deposits in rectal cancer. This review focused on the basic technical knowledge about AI and the clinical application of AI in ultrasound of liver and gastroenterology diseases. Lastly, we discuss the challenges and future perspectives of AI.