Sorghum is a vital economic crop in China, generating substantial amounts of crop residues annually, which necessitates research into its comprehensive utilization. Cyanogenic glycosides, a class of metabolites widely distributed in sorghum and other plant species, tend to release hydrogen cyanide under enzymatic action, posing a potential poisoning risk to animals. In the present study, to enhance the fermentation quality of sorghum straw silage, β-glucosidase-producing lactic acid bacteria isolated from fresh sorghum straw were employed as inoculants. A systematic investigation was conducted on the microbial community structure and metabolomic profiles following 60 days of fermentation, utilizing untargeted metabolomics analysis to elucidate the mechanisms by which β-glucosidase-producing lactic acid bacteria influence sorghum straw silage fermentation quality, as well as the degradation of dhurrin and reduction of hydrocyanic acid levels in sorghum. The results demonstrated that the silage fermentation quality in the lactic acid bacteria-supplemented experimental group was significantly improved compared to the control group. Attributed to the modulation of metabolic pathways, the levels of dhurrin and hydrocyanic acid exhibited a significant decrease with extended ensiling duration. At the metabolite level, biological pathways involved in steroid biosynthesis, terpenoid synthesis, and carotenoid synthesis were upregulated during different stages of ensiling. These metabolites not only enhance the nutritional value of the feed, but also possess anti-inflammatory and health-promoting properties, thereby further underscoring the positive regulatory role of lactic acid bacteria in the silage process.