The objective of this study is to explore the association of plasma metal concentrations with impaired cognitive function in different genotypes of ATG7 using multiple models. A cross-sectional survey was conducted in rural China among 994 individuals aged 30 years or older. Cognitive function was assessed using the Mini-Mental State Examination (MMSE). Genetic analysis focused on two single-nucleotide polymorphisms (SNPs) in the autophagy-related gene ATG7 (rs2606757 and rs8154). Plasma concentrations of metals were quantified using inductively coupled plasma mass spectrometry. Restricted cubic splines were used to explore the association between serum metal concentration and the occurrence of mild cognitive impairment in individuals with various genotypes. Bayesian Kernel Machine Regression (BKMR) models were used to explore the interactions between individual metals. In a restricted cubic spline model, there is a nonlinear relationship between plasma concentration of Cd and the occurrence of cognitive impairment in individuals carrying the AA (P of Nonlinear = 0.008) and AT (P of Nonlinear = 0.007) genotypes at the rs2606757. However, in people carrying the TT genotype at the rs2606757 locus, the concentration of metals in plasma was not significantly associated with cognitive impairment (P of Nonlinear = 0.534). The results of the BKMR model are consistent with those of the restricted cubic spline model. The TT genotype at rs2606757 in ATG7 appears to confer greater cognitive resilience against Cd-induced cognitive damage. These findings highlight the importance of considering gene-environment interactions in the context of cognitive impairment and suggest potential avenues for preventing cognitive decline in individuals exposed to Cd. Further research is needed to elucidate the precise mechanisms underlying these interactions.