With the rapid development of agriculture in China today, the demand for agricultural machinery is rapidly increasing. A large amount of exhaust gas emissions poses a severe threat to the environment. To better promote engine fuel and air mixing, enhance engine performance, and achieve low emissions, we conducted a numerical study of the pre-chamber and nozzle design in a gasoline engine for an agricultural tractor by using the G-equation method in Converge CFD software. The relevant optimization of the three model parameters in the G-equation was performed using the improved particle swarm algorithm (PSO). The model parameters after optimization by the PSO algorithm were: a1=0.77, b1=2.0, b3=1.0. It was confirmed that the predicted engine performance was enhanced greatly with the pre-chamber system. More importantly, the results reveal that the volume and area ratios of the pre-chamber played a crucial role in the performance of the pre-chamber. Through a series of parametric studies on the pre-chamber and main chamber characteristics, we can identify the best sets of volume and area ratios based on the combustion reaction progress, the turbulent mixing profiles, and the exhaust gas emission. The turbulent maximum strength and the exhaust gas concentration of nitrogen oxides can differ by 13 and 18 times, respectively. In practical design, we recommend the optimization of the concerned metrics with the findings in the paper.