The autonomous swimming of fish in a complex flow environment is a nonlinear and intricate system, which is the focus and challenge in various fields. This study proposed a novel simulation framework for artificial intelligence fish. It employed a high-precision immersed boundary-lattice Boltzmann coupling scheme to simulate the interactions between fish and flow in real time, and utilized the soft actor-critic (SAC) deep reinforcement learning algorithm for fish brain decision-making module, which was further divided into a vision-based directional navigation and a lateral line-based flow perception modules, each matched with its corresponding macro-action space. The flow features were extracted using a deep neural network based on a multi-classification algorithm from the data perceived by the lateral line and were linked to the fish actions. The predation swimming and the various Kármán gait swimming were explored in terms of training, simulation, and generalization. Numerical results demonstrated significant advantages in the convergence speed and training efficiency of the SAC algorithm. Owing to the closed-loop “perceive-feedback-memory” mode, intelligent fish can respond in real-time to changes in flow fields based on reward-driven requirements and experience, and the accumulated experience can be directly utilized in other flow fields, and its adaptability, model training efficiency, and generalization were substantially improved.