This study explores the diversity and functions of microbiomes in ancient agroecosystems of the Mixteca Alta Geopark (MAG). Microbiome analysis could provide insights into soil bacterial communities and their role in enhancing soil fertility, nutrient cycling, and plant growth. We used 16S rRNA gene amplicon sequencing to identify key features in the composition of the microbiota of the Lama-bordo, Valley, and Terrace agroecosystems in MAG. Analysis of agroecosystem soils revealed 21 bacterial phyla, with Acidobacteria, Proteobacteria, Actinobacteria, and Chloroflexi dominating. These microbial communities contribute to soil health, carbon cycling, and disease suppression. The study identified specific phylogroups and metabolic pathways associated with nutrient-rich environments like Lama-bordo and Valley, and nutrient-poor, sandy soils like Terrace. Soils from Lama-bordo and Valley were grouped due to microbiome similarity despite geographic separation, whereas Terrace soils differed. Nutrient-rich Lama-bordo and Valley soils host copiotrophic bacteria, while nutrient-poor Terrace soils favor oligotrophic species like Acidobacteria. Functional analysis of microbiomes reveals distinct metabolic pathways, including antibiotic biosynthesis (streptomycin, vancomycin) suggesting a role in plant disease resistance, amino acid pathways indicating active nitrogen cycling, and vitamin B5 and lipoic acid pathways contributing to energy metabolism and antioxidant functions.