Objective This study aimed to investigate the effect of Lactiplantibacillus plantarum (LP) on greenhouse gas emissions during the ensiling of alfalfa (Medicago sativa L.). Method Two treatments were established: A control (CK, no additive) and an LP inoculation group. Gas samples were collected at day 3, 7, 15, 30, and 45 of ensiling to measure emissions of carbon dioxide (CO2), methane (CH₄), and nitrous oxide (N2O). The pH, ammonia nitrogen (NH₃-N), and dry matter (DM) contents were determined. Crude protein (CP) content was analyzed on day 7 and 45. Bacterial community structure was assessed using high-throughput sequencing, and co-occurrence networks and random forest models were constructed. Result Compared with CK, LP treatment significantly reduced the emissions of CO₂, CH₄, and N₂O (P<0.05), decreased pH and NH₃-N content, and increased DM preservation, with no significant change in CP content. LP treatment also significantly reduced bacterial diversity on day 7 and 45. Principal coordinate analysis revealed clear separation between LP and CK samples along the Y-axis. Network analysis indicated that LP treatment reduced node number and connectivity, lowered vulnerability, enhanced negative cohesion, and decreased positive cohesion. The random forest model identified the relative abundance of Enterobacter, Lactiplantibacillus, and Lactococcus, pH, Shannon index, and the contribution of PCoA1 as significant contributors to CO2 emissions; the relative abundance of Enterobacter, NH3-N content, pH and the relative abundance of Lactococcus as key factors for CH4 emissions; and pH, the relative abundance of Lactococcus, Shannon index, the relative abundance of Lactiplantibacillus, the contribution of PCoA1 andthe relative abundance of Enterobacter as major contributors to N₂O emissions. Correlation analysis showed that CO₂ emissions were negatively correlated with the relative abundance of Lactiplantibacillus and CP content; CH4 emissions were positively correlated with the relative abundance of Enterobacter; and N2O emissions were positively correlated with the relative abundance of Enterobacter and Shannon index, but negatively correlated with the relative abundance of Lactiplantibacillus, CP content, and the degree of explanation of PCoA1. Conclusion Inoculation with L. plantarum improves fermentation quality, reduces greenhouse gas emissions, and modulates the bacterial community structure in alfalfa silage, with Enterobacter, Lactiplantibacillus, and microbial diversity serving as key microbial factors influencing gas emissions.