This study investigates heavy metal contamination in soils, irrigation water, and agricultural produce (fruits: Vitis vinifera (grape), Cucumis melo var. saccharimus (melon), and Citrullus vulgaris. Schrade (watermelon); vegetables: Lycopersicum esculentum L. (tomato), Cucurbita pepo (zucchini), Daucus carota (carrot), Lactuca sativa (lettuce), Convolvulus Batatas (potato), and Capsicum annuum L. (green pepper)) in the Boumerdes region of Algeria. The concentrations of seven heavy metals (cadmium (Cd), chromium (Cr), copper (Cu), iron (Fe), nickel (Ni), lead (Pb), and zinc (Zn)) in soil and food samples were analyzed using atomic absorption spectrometry. Health risks associated with these metals were evaluated through the estimated daily intake (EDI), non-carcinogenic risks (using target hazard quotient (THQ), total target hazard quotient (TTHQ), and hazard index (HI)), and carcinogenic risks (cancer risk factor (CR)). Statistical analyses, including cluster analysis (CA) and Pearson correlation, were conducted to interpret the data. The results revealed the highest metal transfer as follows: Cd was most significantly transferred to tomatoes and watermelons; Cr to carrots; Cu to tomatoes; and Fe, Ni, Pb, and Zn to lettuce. Among fruits, the highest EDI values were for Zn (2.54·10-3 mg/day) and Cu (1.17·10-3 mg/day), with melons showing the highest Zn levels. For vegetables, the highest EDI values were for Fe (1.68·10-2 mg/day) and Zn (8.37·10-3 mg/day), with potatoes showing the highest Fe levels. Although all heavy metal concentrations were within the World Health Organization's permissible limits, the HI and TTHQ values indicated potential health risks, particularly from vegetable consumption. These findings suggest the need for ongoing monitoring to ensure food safety and mitigate health risks associated with heavy metal contamination.