Carrier phase measurements currently play a crucial role in achieving rapid and highly accurate positioning of global navigation satellite systems (GNSS). Resolving the integer ambiguity correctly is one of the key steps in this process. To address the inefficiency and slow search problem during ambiguity solving, we propose a single-frequency GNSS integer ambiguity solving based on an adaptive genetic particle swarm optimization (AGPSO) algorithm. Initially, we solve for the floating-point solution and its corresponding covariance matrix using the carrier-phase double difference equation. Subsequently, we decorrelate it using the inverse integer Cholesky algorithm. Furthermore, we introduce an improved fitness function to enhance convergence and search performance. Finally, we combine a particle swarm optimization algorithm with adaptive weights to conduct an integer ambiguity search, where each generation selectively undergoes half-random crossover and mutation operations to facilitate escaping local optima. Comparative studies against traditional algorithms and other intelligent algorithms demonstrate that the AGPSO algorithm exhibits faster convergence rates, improved stability in integer ambiguity search results, and in practical experiments the baseline accuracy of the solution is within 0.02 m, which has some application value in the practical situation of short baselines.