Particle swarm optimization (PSO) is a classical intelligent algorithm that can effectively perform stochastic global optimization. In this paper, the self-regulation mechanism based on immune memory is introduced into the PSO algorithm, and the optimal solution generated in each iteration process is perturbed by chaos optimization, and an immune particle swarm optimization algorithm IACPSO based on optimal chaos search is proposed. Combined with the immune information processing mechanism and chaotic interference, the algorithm effectively improves the ability of the particle swarm optimization algorithm to jump out of the local optimal value and improves the convergence speed and optimization accuracy during the algorithm optimization process. The simulation results of the CEC2021 test function show that the performance of the algorithm is better than the basic PSO algorithm.