Environmental contributors to bacterially dominated fermenting consortia of artisanal Mezcal Authors: Patricia Alejandra Becerra-Lucio, Ernesto Pérez-Rueda, Graciela Maria Dias, Natalia Ysabel Labrín-Sotomayor, Artemio Mendoza-Mendoza, Laila Pamela Partida-Martínez, Eugenia Zarza, Yuri Jorge Peña-Ramírez Published: 2026 ABSTRACT AbstractThe production of spontaneously fermented beverages worldwide relies on native microorganisms acquired incidentally through cross-contamination from environmental reservoirs. We examined the microbiota involved in Mezcal fermentation, exploring their origins, dynamics, and ecology. Using shotgun metagenomics, we analyzed four batches of Mezcal, spanning the entire production process from crop to distillation. Bacterial genera such as Leuconostoc and Lentilactobacillus dominated the fermentation samples, whereas Bacillus was the most abundant in the environmental samples. Fermenting yeasts, such as Saccharomyces, accounted for only ~ 10% of the microbial abundance. No significant differences in microbial community structure were observed between the sampled batches, fermentation times, or depths of the fermentation tanks. Weevil samples clustered with fermentation and plant samples, suggesting they may serve as natural reservoirs for Leuconostoc and Lentilactobacillus. Functional differences were observed in COGs related to secondary metabolism during fermentation and correlated with sensory notes identified by a panel of expert tasters, suggesting that variations in the sensory profiles of the final spirit are directly linked to the metabolic products of genes associated with secondary metabolism. Our work analyzed the spontaneous fermentation microbiota, providing fundamental insights into its natural reservoirs and its contribution to Mezcal terroir.Graphical Abstract Supplementary InformationThe online version contains supplementary material available at 10.1186/s12866-026-05199-x.Keywords: Microbial ecology, Environmental microbiota reservoirs, Artisanal process, Agave fermentation, Spontaneous fermentation kinetics, Autochthonous yeasts Background Various fermented products are culturally essential foods and beverages worldwide, among which alcoholic beverages stand out [1]. In industrial processes, fermentation is controlled by adding commercial yeast strains, with the goal of maintaining product homogeneity and maximizing ethanol yield. In contrast, in spontaneous or artisanal processes, fermentation relies on a heterogeneous, unique, and often non repeatable mix of indigenous, domesticated microorganisms that are incidentally inoculated from their natural, region-specific reservoirs in the fermentable substrate [2–4]. Environmental conditions, climatic patterns, production practices, reservoir availability, and physicochemical conditions of the substrate all modulate the establishment of these microorganisms [5–7]. Depending on the type and amount of microbes established during fermentation, the community structure will undergo a succession of fermenting consortia, primarily modulated by ecological interactions that positively or negatively regulate the progression of specific taxa responsible for the resulting flavors [8–10]. An “eubiotic consortium,” i.e., one balanced by a variety of microorganisms, produces not only high alcohol yield but also complex sensory profiles, giving rise to the “terroir” of a drink, i.e., those sensory traits that distinguish a product due to its geographic context of origin. In contrast, a “disbiotic consortium” results in low alcohol yield and overproduction of undesired metabolic products, thereby affecting beverage quality. [10–13]. Recent studies have described the typical microbiota in various spontaneously fermented beverages, such as wine, Toddy, Sake, and Tequila, from which different microorganisms and consortia have been identified, including prokaryotic and eukaryotic representatives [14–18]. These microorganisms rely on their metabolic plasticity and genetic potential to adapt to the conditions existing in natural reservoirs and throughout the fermentation process, which can be highly contrasting [19, 20]. The analysis of the spontaneous fermentation process using methods based on microbial cultures has identified several species, among which yeasts belonging to the Saccharomyces genus have been frequently reported as the most abundant [9, 21] and are mainly associated with ethanol production [4, 22]. However, ethanol production may not be exclusively produced by yeasts, like other taxa, both eukaryotic and prokaryotic, that frequently dominate fermenting communities, and their specific contribution to ethanol production in these fermentation processes remains unknown [4]. Studies based on shotgun DNA sequencing have reported a prokaryotic component in spontaneous fermentations. Thus, bacteria appear to be critical participants, potentially contributing to the formation of many of the sensory attributes in the final product, derived from particular metabolic routes not found in yeasts [3, 23–26]. In addition, new associations between microbial genes, metabolism, and aromatic compounds in musts of different origins have been identified [27, 28], including specific links between sensory properties and bacterial secondary metabolites [29, 30]. Moreover, non-yeast, non-fermenting microorganisms may serve as ecological regulators of fermenting consortia, modulating the composition and succession of microbial communities [31]. Mezcal is an alcoholic beverage obtained by distilling the juice of fermented cooked stems from Agave plants. Mezcal is an alcoholic beverage obtained by distilling the juice of cooked and fermented agave plant stems. The production process is based on cultivation, cooking, milling, fermentation, distillation, and aging techniques that differ and are specific to each producer. Furthermore, production practices can vary between production regions, localities, and neighboring distilleries, and are classified according to their production process as “Ancestral Mezcal”; “Artisanal Mezcal”; or simply “Mezcal” (the procedures established in the other two categories are not followed) [7] Artisanal Mezcal can be considered a model for studying spontaneous fermentations, since its production is based on the proliferation of indigenous microorganisms native to each region, derived from ancient cultural practices with variations in each production area, resulting in the formation of the fermenting microbiota [32]. These microorganisms coevolved with Agave species, key plants of the arid lands of North America, of which Mexico is home to the most significant number of endemic species. The unique interaction between Agave plants and the local microbiota is fundamental to Mezcal’s distinctive character [33]. Its sensory complexity distinguishes it and has made it a beverage with growing global demand, increasing from 0.98 million liters in 2011 to 14.17 million liters in 2022, with exports to more than 81 countries [34]. It is also the second beverage, after wine, to be reviewed by the Michelin Group [35]. Available data on the Mezcal production process has focused on three aspects: 1) Taxonomic studies of the yeasts present in the fermentation process, 2) compounds generated by yeasts during fermentation under laboratory conditions [21, 36–39], and 3) yeasts’ contribution to sensory changes throughout the fermentation process [8, 9, 22, 40]. The identification of the source of the native and fermenting microbiota, possible inoculation routes, and factors affecting spatial fermentation dynamics, as well as their contribution to the dominance of desirable (ethanol and aromas) or undesirable molecules (long-chain alcohols, furfurals, or methanol), remains to be determined as well as the participation of other non-yeast and non-fermenting microorganisms that may play key ecological roles [31]. In this study, we evaluated the metagenomic composition of four spontaneous fermentation representative events in artisanal Mezcal production. We employed deep shotgun sequencing to elucidate the potential origin, diversity, compositional changes, and functional contributions of the microbiome that influence the sensory properties and terroir of artisanal Mezcal. Methods Description of Mezcal production events We sampled four artisanal Mezcal factories (production events) chosen for their prestigious and award-winning products. Two factories are located in Oaxaca state, and two in Michoacán state in Mexico. Sampling sites in Oaxaca state were the “Soledad” (16°33′8.4″ N, −96°49′4.3″ W, 1450 masl) and “Marillero” (16°34′19.5″ N, −97°2′10.1″ W, 1536 masl) factories, both separated by 23.44 km in a straight line. Sampling sites in Michoacán state were the “Vinata” (19°27′28.2″ N, −101°11′43.5″ W, 1725 masl) and “Piedras de Lumbre” (19°33′26.6″ N, −101°5′48.6″ W, 1744 masl), both separated by 15.10 km in a straight line (Fig. 1A). Each location showed relevant differences during the Mezcal production process, including environmental factors, Agave species, techniques, and utensils (Table 1). The number of samples varied across production events (Supplementary File SF1). Due to the sensory profiles and yields of each production batch are unique, this work did not intend to sample different events from the same factory, but rather to contrast four geographically independent production events. Site and sampling diagram. A Map of Michoacan and Oaxaca states, where the Mezcal factories sampled in this study are located. B Diagram of the Mezcal production process showing the phases in which it was analyzed by sampling. 1) Agave plants, 2) Soil, 3) weevils (Scyphophorus acupunctatus), 4) Cooked Agave juice, 5) water, 6) vat water, 7) vat walls, 8) shaking stick, 9) initial fermentation, 10) medium fermentation superficial, 11) medium fermentation middle, 12) medium fermentation bottom, 13) final fermentation superficial, 14) final fermentation middle, 15) final fermentation bottom Table 1Specific characterization of the sampled factoriesCondition/FactorySoledadMarilleroVinataPiedrasPlant speciesA. karwinskiiA. potatorumA. angustifoliaA. americanaA. rhodacanthaA. cupreataA. cupreataAgave °Brix*(Average from six cropped raw stems)15272932292736Soil typeOrthic acrisol with medium texture and lithic phaseOrthic acrisol with medium texture and lithic phaseOrthic acrisol with fine texture and lithic phaseEutric regosol with medium texture and lithic phaseSoil pH8.08.06.18.1ClimateACwo. Semi-warm subhumid climate of group C, annual precipitation of 696.4 mm, average maximum temperature of 30.1 °C, average mean temperature of 21.7 °C, and average minimum temperature of 13.3 °CACw1. Semi-warm subhumid climate of group C, annual precipitation of 696.4 mm, average maximum temperature of 30.1 °C, average mean temperature of 21.7 °C, and average minimum temperature of 13.3 °CACw1. Semi-warm subhumid climate of group C, annual precipitation of 751.6 mm, average maximum temperature of 26.4 °C, average mean temperature of 18.9 °C, and average minimum temperature of 11.4 °CACw2. Temperate, subhumid climate, annual precipitation of 920 mm, average maximum temperature of 32.7 °C, average mean temperature of 24.3 °C, and average minimum temperature of 15.9 °CLand use and vegetationAnnual and semi-permanent irrigation agriculture areaSecondary shrubby vegetation of Pinus sp. forestAnnual rainfed agriculture areaPinus sp. forestFermentation vat material and capacityWooden, 1500 LWooden, 1000 LPlastic water tanks, 1000 LBuried wooden, rectangular vat covered with mud, 8,000 LVat water pH**8.17.8NA**4.9Water pH**8.58.47.27.5Cooking time (h)6084112137Initial fermentation time (h)***74487042Medium fermentation time (h)***134114150176Final fermentation time (h)***204156232263Distillation typeCopper pot with cooler and serpentineCopper pot with cooler and serpentinePhilippine stainless-steel alembic and copper potPhilippine wooden alembic and copper potYield (Kg of Agave L−1 Mezcal)10.06.337.3312.94*Brix. Total amount of soluble solids in a liquid. In Mezcal production, this measurement is used as a proxy for the amount of sugars/carbohydrates available in Agave stems for ethanol conversion** Vat water. Contained water in the fermentation vats between batches to prevent them from drying out. Water. Used water throughout the production, cleaning, and fermentation processes. NA. not applicable (Vats maintained dry between batches)***Fermentation times (in hours) were counted from hour 0, the start of the fermentation, in all cases Specific characterization of the sampled factories A. potatorum A. angustifolia A. americana A. rhodacantha Agave °Brix* (Average from six cropped raw stems) 27 29 32 29 *Brix. Total amount of soluble solids in a liquid. In Mezcal production, this measurement is used as a proxy for the amount of sugars/carbohydrates available in Agave stems for ethanol conversion ** Vat water. Contained water in the fermentation vats between batches to prevent them from drying out. Water. Used water throughout the production, cleaning, and fermentation processes. NA. not applicable (Vats maintained dry between batches) ***Fermentation times (in hours) were counted from hour 0, the start of the fermentation, in all cases Sampling We collected a total of 62 composite samples, of which 34 were taken from potential environmental reservoirs and 28 from fermentation vats. At each factory, we analyzed a single production batch, tracing it from the Agave plants in the field to the end product. Representative composite samples (a pool of six independent replicates) were aseptically collected as follows. Soil samples (10 g of sieved soil collected 30 cm away from the Agave plant´s base, between 5 to 20 cm depth), Agave plants (10 g of stem [piña]), water used in the process (≈ 0.5 g of material obtained by filtration 5–15 L through a 0.22 µm Ø Swinnex filters [Cat SX0004700; GSWG047S6, Merk, Rahway, NJ,. USA]), weevil (Sciphophorus acupunctatus [Coleoptera; Curculionidae] surface-sterilized adult individuals (n = 5) extracted from decaying tissue of the same Agave plants), utensils (tools and equipment) (1 g of biofilm obtained by swab collection), cooked Agave juice (T0) (5 mL from the center of milling vats); and fermentation samples, which were sampled at three times during the fermentation (initial, T1, middle, T2, and final fermentation, T3) and at three different fermentation depths, surface (S), middle (M), and bottom (B) of the fermentation vat (5 mL of “mosto” [cooked and fermented Agave must]) (Fig. 1B). For the fermentation composite samples, soluble solids (°Brix), pH, and temperature were measured at each sampling point. All samples were collected in 1.5 mL microcentrifuge tubes containing RNAlater® (Cat. AM7020, Thermo Fisher Scientific, Waltham, MA, USA) at 50% (v/v). Fermentation times varied across processes due to their specific durations (Table 1). Finally, samples of the distilled Mezcal (3 L) were taken for sensory evaluation. Genomic DNA extraction We extracted total genomic DNA from 250 mg of biomass for each composite sample and from the control microbial community using the ZymoBIOMICS Quick-DNA Fungal/Bacterial Miniprep Extraction Kit (Cat. No. D6300, Zymo Research, Tustin, CA, USA), following the manufacturer’s protocol. We measured the concentration, quality, and purity of the DNA samples by spectrophotometry on a Multiskan GO model FI-01620 with a μDrop Plate and SkanIt software, version 4.1 (Thermo Scientific, Waltham, MA, USA). Library preparation and sequencing Preparation and sequencing of the genomic libraries were performed by an external service using the MGI platform at Química Valaner S.A. de C.V. in Mexico City. Broadly, genomic libraries were prepared using the MGIEasy DNA Library Preparation Kit (Cat. No. 1000005248, MGI, Shenzhen, China). From the constructed libraries, DNA nanoballs (DNBs) were generated using a two-step amplification process, loaded onto the MGISEQ-2000RS sequencer (equivalent to the HiSeq 3000), and sequenced with 200 bp paired-end reads, targeting a read depth of 12 Gbp per sample. Bioinformatic analysis and functional profile We assessed sequence quality using FastQC [41] and compiled results with MultiQC [42]. We verified the adapter sequences and removed all reads with an average quality below30 using Trimmomatic [43]. We compared assembled reads for taxonomic annotation using Blastn against the NCBI non-redundant (nr) database of Archaea, Bacteria, Viruses, and Eukaryotes (version February 2023) as the reference, using the Kaiju pipeline (https://github.com/bioinformatics-centre/kaiju) [44]. We modeled microbial interaction networks based on the top contributing taxa (90% of the accumulated differences identified by SIMPER analysis [Supplementary File SF5]) using the METAMis software [45]. To infer microbial networks, we used METAMIS’s default settings (Concordant pairs ≥ 0.9). To establish functional prediction and genetic annotation of metagenomes, we used metaSPAdes v3.15.3 (https://github.com/ablab/spades) [46, 47]. We assigned functional annotations by comparing the assembled sequences to the Kyoto Encyclopedia of Genes and Genomes (KEGG) [48] and Evolutionary Genealogy of Genes databases using the eggNOG-Mapper (http://eggnog-mapper.embl.de/) [18, 49]. To document any processing bias, we used a commercial microbial community as a control, which was sequenced in parallel on the MGI and Illumina platforms and processed using the same bioinformatic pipeline. This analysis revealed that our pipeline protocol resulted in a slight non-significant (p < 0.05) overrepresentation of yeasts compared to bacteria (Supplementary File SF2). Sensory analysis Sensory evaluation was performed using Quantitative Descriptive Analysis (QDA®) in a double-anonymized design by a private company (one of the largest Tequila producers, which wishes to remain anonymous). The expert panel consisted of 20 highly trained, continuously calibrated professional evaluators. Before evaluation, all samples were normalized to 20% alcohol by volume (v/v) to minimize the effect of ethanol content on sensory perception. The intensity of each attribute was quantified on a linear scale from 0 (not detected) to 10 (highly detected). Evaluations were performed individually, without any exchange of information between panelists. The data obtained were analyzed using Student’s t-tests to identify significant differences between samples. Statistical analysis For quantitative and qualitative sensory descriptor correlations, ecological indices at the Genus level, ordination analysis, hypothesis tests, and Pearson correlations, we used the Paleontological Statistics Software PAST v4.17 [50]. In all cases, the significance threshold (p-value) is reported, along with the corresponding correction (Bonferroni correction was applied for ANOVA or PERMANOVA tests). For Pearson correlations between physicochemical and microbial abundance, we compared the full dataset of absolute abundances for fermenting samples against the corresponding physicochemical data obtained at each sampling point. The significance was computed using a two-tailed t test with n-2 degrees of freedom. Results Physicochemical fermentation conditions We determined in situ at each sampling point basic physicochemical parameters (Soluble solids (°Brix), pH, and temperature) during sampling (Fig. 2). Regardless of the sampling factory conditions summarized in Table 1, we obtained consistent values and kinetics for the evaluated parameters, with a few significant differences between samples from different depths in the Marillero and Piedras factories. Physicochemical fermentation kinetics. Soluble solids (°Brix), pH, and temperature were determined during sampling in the fermentation vats at three different depths General analysis of the microbial diversity of the Mezcal production process The shotgun sequencing effort yielded 553 Gbps, with a Phred quality score > Q33 (Available through NCBI accession PRJNA1190398). Taxonomic assignment of the fermentation samples revealed that bacteria were the most abundant domain, followed by eukaryotes and a small proportion of viruses. Medium to high diversity was found at the genus level with values between 2.471 and 3.165 according to the Shannon diversity index (H’). The data also revealed similar uniformity values in all events, ranging from 0.8408 to 0.9165 according to the Simpson index, indicating that a few genera dominate the fermenting microbial community. The expected richness of the Chao-1 rarefaction analysis demonstrated that our sampling effort covered most of the expected taxonomic identities (Supplementary File SF3). At the phylum level, taxa distribution was similar in the four events and was predominantly composed of Bacillota (> 60%), followed by Actinomycetota, Psedomonadota, and Ascomycota (Supplementary File SF4). Only 22 out of 6,359 genera, represented by Lactic Acid Bacteria (LAB) and Acetic Acid Bacteria (AAB), accounted for 73% of the microbial community’s relative abundance, whereas Saccharomyces and Torulaspora reached up to 5%. At the genus level, we determined that only “Piedras” differed from the other events (p = 0.0036 by PERMANOVA). The common microbial community comprises 5,259 putative genera, and the microbial community of the environmental samples presented a different microbial core compared to the fermentation samples, which comprised 3,246 and 3,769 putative genera, respectively (Fig. 3A). Pearson correlation analysis revealed significant correlations between physicochemical variables (°Brix, pH, and temperature) and the relative abundance of different microbial genera (Fig. 3B). We found that some LAB tend to increase their abundance under conditions of lower soluble solids content and pH, because their metabolic activity produces lactic acid, gradually reducing the medium’s pH and limiting their growth. This process not only favors their ecological dominance by inhibiting competing microorganisms but is also critical for the stability and organoleptic properties of fermented products, particularly at higher temperatures, which could have significant implications for microbial dynamics during fermentation. Genera distribution and Pearson correlation. A General diagram comparing the total number of inferred genera per sample category, showing the distribution of exclusive and shared genera in the evaluated mezcal production processes. The environmental core is shown in green, and the fermentation core is shown in brown. The pink arrow represents the flow of the microbial community between environmental samples, symbolizing cross-contamination from the field to the Mezcal production factories. B Pearson correlation between the physicochemical variables of the fermentation process (°Brix, pH, and temperature) and the relative abundance of the microbial genera showing a relative abundance > 1%. The size of the circle reflects the magnitude of the correlation (larger circles indicate stronger correlations); squares around the circles indicate statistically significant correlations Taxonomic-based analyses The Bray–Curtis similarity analysis revealed clustering of microbial communities by environmental source and fermentation stage (Fig. 4A). The samples were grouped into four clusters, differentiated by their microbial structure, which reflected distinctive patterns of origin. Cluster 1-Tax included environmental samples (water, utensils) and cooked agave juice. Cluster 2-Tax comprises fermentation (T1 initial, T2 medium, and T3 final) and two weevil samples. Cluster 3-Tax contains plants and the other two weevil samples, while Cluster 4-Tax comprises all soil samples. Clusters 1-Tax, 3-Tax, and 4-Tax showed greater microbial diversity and richness than Cluster 2-Tax. Cluster 4-Tax was the most diverse, according to the Shannon diversity index (ranging from 5.128 to 5.835), followed by Cluster 3-Tax (4.042 to 4.313). Similarly, the Chao-1 richness estimators reflected this trend. Composition and structure of microbial communities associated with different niches during the mezcal fermentation process. A Clustering analysis based on Bray–Curtis similarity of microbial composition (relative abundance at the genus level > 1%) in samples from different production events and sample types (vertical axis). Diversity (Shannon) and estimated richness (Chao-1) values are shown for each sample. B NMDS based on Bray–Curtis similarity, showing the clustering of microbial communities by sample type and sampling site (colored dots). Polygons delimit clusters of samples with similar origins The cluster with the most significant internal similarity was Cluster 2-Tax. A predominance of lactic acid bacteria (LAB) genera, including Leuconostoc, Lentilactobacillus, Weissella, Liquorilactobacillus, and Lacticaseibacillus, was observed, which dominated the fermenting community, followed by eukaryotes (Saccharomyces and Torulaspora). This pattern was consistent across the different fermentation samples, regardless of the event, fermentation time, or tank depth. However, there was significant (p < 0.0001 by PERMANOVA analysis) variation in the relative proportions of these genera (Supplementary File SF5). The diversity and richness values were consistent in all fermentation samples. Only the “Piedras” samples exhibited a notably different microbial community compared to the rest of the fermentation samples, in which Lentilactobacillus dominated, indicating a significant difference in microbial composition (p < 0.0001 by PERMANOVA analysis). We found that the particular fermentation conditions associated with this event, such as variations in the type of substrate (soluble solids), showed a significant correlation, as determined by the Pearson analysis (Fig. 3B). Lentilactobacillus was negatively correlated with soluble solids in the must. Environmental samples showed greater heterogeneity, with a relevant presence of genera such as Bacillus dominating the microbial communities, followed by different genera of LAB Weisella, Enterococcus, Lactococcus, Bifidobacterium, Terrilactobacillus, Liquorilactobacillus, Leuconostoc, and Lacticaseibacillus and acetic acid bacteria (AAB) Acinetobacter, Clostridium, and Bifidobacterium, and a smaller portion of eukaryotic genera such as Saccharomyces (Fig. 3A), in addition to other genera with abundance less than 1% (Supplementary File SF5). Water and utensil samples showed less diverse communities, dominated by Clostridium, Bacillus, Enterococcus, and Acinetobacter, and with lower yeast abundance. Non-metric multidimensional scaling (NMDS) ordination analysis showed a clear separation of microbial communities by environmental provenance (Fig. 4B). Fermentation samples, on the other hand, displayed a polygon distinct from environmental samples. T0 (Cooked juice) samples were located close to, but different from, the fermentation samples, reflecting the shift in microbial structure from initial conditions toward a specialized fermentation community. Water and utensil samples formed distinct groups with their unique communities. The weevil-associated microbiota was intermediate between environmental and fermentation-associated microbiota. The analysis also revealed a slight influence of events on community structure, although fermentations tended to cluster by sample type rather than by sampling site. Functional prediction-based analyses Functional assignment with KEGG and EggNOG revealed a wide range of enzymatic profiles. A total of 35 functional categories (Level 1), 188 superclasses (Level 2), and 1207 classes (Level 3) were predicted from the COG (Cluster of Orthologous Groups) SPADES annotation (Supplementary File SF6). To focus on relevant metabolic routes linked to ethanol production and the sensory profile, we analyzed carbohydrate and aroma metabolism COG categories using Bray–Curtis similarity. This assessment revealed clear differentiation among the sample types associated with the fermentation process (Fig. 5A). This grouping allowed us to distinguish three main clusters: Cluster 1Fnc, comprising soil, utensil, water, and T0 samples; Cluster 2Fnc, composed of all fermentation samples and the weevil; and Cluster 3Fnc, composed exclusively of plant samples. The second group was characterized by specific fermentation pathways, with lactate fermentation dominating (10–49% of the abundance), followed by acetoin metabolism (13–27%) and butanediol metabolism (8–24%). This functional profile was consistent across different fermentation stages (T1, T2, T3) and vat depths, like a conserved functional core throughout the fermentation process. Weevil samples were functionally located close to the fermentations, sharing a high proportion of fermentation pathways. Functional prediction at level 2 of functional classification. Superclasses of carbohydrate metabolism and aromatic compounds associated with different niches in the mezcal fermentation process are considered. A Bray–Curtis similarity-based clustering analysis of the relative abundance of predicted microbial functions in different samples (vertical axis) from four sampling events. B NMDS is based on Bray–Curtis distances, where samples cluster according to their predicted functional profile, differentiated by sampling site (colored dots) and sample type (polygons) In contrast, the plant samples exhibited a distinctive functional profile characterized by metabolic pathways involved in the degradation of aromatic compounds. Pathways predominated for acetyl-CoA fermentation to butyrate, the homogentisate pathway of aromatic compound degradation, butanol biosynthesis, and aromatic amino catabolism. Soil samples exhibited intermediate functional diversity, sharing some fermentative pathways, albeit in smaller proportions, and a moderate representation of pathways involved in the degradation of aroma compounds. On the other hand, the utensils and water samples exhibited heterogeneous functional profiles, clustering into a mixed clade characterized by a predominance of lactate and acetoin fermentation pathways, as well as pathways associated with phenolic compound degradation. The NMDS ordination analysis based on the functional prediction showed a clear separation among the different sample groups. The plants clustered into a region within a polygon, separated from the rest of the samples. The soil, water, utensils, and insect samples exhibited greater dispersion but also showed greater proximity to the fermentation polygon (Fig. 5B). However, the sample groups presented significant differences based on the PERMANOVA analysis (p < 0.0001) (Supplementary File SF7). Sensory profile analysis, taxonomical and functional correlations Sensory profiles were obtained for each production event. In total, 61 odor and flavor descriptors were obtained for each event (Supplementary File SF8). Only 35 descriptors showed significant differences (p < 0.05) in at least one of the production events. The analysis of sensory profiles revealed that for Soledad, the principal descriptor was oily (8.30), on a scale of 0 to 10 (where 0 is not detected and 10 is highly detected). The minor descriptor was caramel (1.21). Burnt (6.27) was the main one for Marillero, and Metallic (1.76) was the least. For Vinata, burnt (7.06) and cooked Agave (1.52) were the main and minor descriptors, respectively, and for Piedras, smoked was the principal descriptor (6.01), and the least was rough (2.31) (Fig. 6A). Contribution to organoleptic profile. A The Sensory profile of the distillates obtained from the production events shows the sensory descriptors with significant differences (p < 0.05) in at least one production event. A scale from 0 (the descriptor is not detected) to 10 (it is highly detected) is considered for the intensity of the descriptor. B Pearson correlation analysis between functional categories and the most common genera, the blue ovals indicate a positive relationship, and the red ovals indicate a negative correlation. The color intensity and size of the oval indicate the Spearman tension strength, which ranges from 1 (highest positive tension) to −1 (highest negative tension). C The Sankey diagram reflects the possible origin, microbial diversity, functional prediction, and contribution to the sensory profile of Mezcal, relating the proportion in relative abundance (> 1% of abundant genera) and the different functional categories, which denote the possible origin of the sensory notes of each Mezcal (Soledad, Marillero, Vinata, and Piedras). The width of the bands is proportional to the contribution of each element. COG categories: S, Unknown function; L, Replication, recombination, and repair; K, Transcription; E, Amino acid transport and metabolism; G, Carbohydrate transport and metabolism; J, Translation, ribosomal structure and biogenesis; O, Post-translational modification, protein turnover, chaperones; T, Signal transduction mechanisms; P, Inorganic ion transport and metabolism; M, Cell wall/membrane/envelope biogenesis; C, Energy production and conversion; U, Intracellular trafficking, secretion, and vascular transport; H, Coenzyme transport and metabolism; I, Lipid transport and metabolism; A, RNA processing and modification; V, Defense mechanisms; D, Cell cycle control, cell division, chromosome partitioning; Q, Biosynthesis, transport, and catabolism of secondary metabolites. The size of bars in the Sankey diagram represents the relative abundance of Taxa or COGs reads in each category, whereas connecting lines represent the relative contribution in relation to the target (right) category Correlation analysis of the microbial community and its functionality revealed both positive and negative correlations between the community and the functional categories (Fig. 6B). Notably, the functional categories of carbohydrates and amino acids, as well as their derivatives, showed the highest positive correlation with microbial communities, particularly LAB, suggesting regulation by distinct ecological interactions. To holistically visualize the evaluated factors (event, source, microbiota, functional diversity, and sensory note dominance), we summarized the data in a Sankey diagram (Fig. 6C). The integrated analysis of origin, microbiota, metabolism, and sensory profiles revealed a direct contribution of environmental bacterial communities to bacterial genera present in the fermentation and the final organoleptic characteristics of the product. The Sankey diagram traced the contribution of microorganisms from their origin. It was observed that the microbes dominating the fermentation originated from multiple environmental reservoirs, including factory utensils and water, the agave plant, soil, and weevils. LAB genera, as well as yeasts, are introduced into the fermentation process from these microenvironments. It was evident that the composition of the fermentation consortia (Fermentation Taxa) directly reflects the biodiversity present in the production environments (Environmental Taxa). Finally, a direct correlation was established between the functional profiles of these microorganisms (represented by COG categories) and the spirits’ final sensory notes. Interaction network modeling Differential contribution analysis of microbial communities, performed using SIMPER, identified the main taxa that explain the differences among the four characterized microbial clusters (Fig. 7A). The results reveal marked heterogeneity in community composition, with genera such as Bacillus, Leuconostoc, Bifidobacterium, and Bradyrhizobium showing a relevant differential contribution in each cluster. Furthermore, microbial interaction network analyses (Figs. 7B–E) revealed notable variation in the nature and number of ecological interactions, with mutualism, competition, parasitism, and predation as the predominant types. The data generated by the Lotka–Volterra–based models show that the microbial communities of clusters 1-utensils, 3-plants, and 4-soils (Figs. 7B, D, E) are dominated by parasitism or predation interactions, followed by mutualism interactions, with more complex networks (i.e., more nodes and interactions). In contrast, competitive interactions dominated the microbial communities of cluster 2-fermentation (Fig. 7C). Network properties are detailed in the Supplementary File SF9. Networks of ecological interactions between microbial genera. A Relative contribution (%) of the main microbial genera (> 90%) based on SIMPER for the main clusters formed in the taxonomic analysis. B–E Co-occurrence and ecological interaction networks between microbial genera for the clusters formed in the taxonomic analysis. Nodes represent genera, and connections indicate significant interactions (red, positive interactions; blue, negative interactions). The thickness of the lines reflects the intensity of the interaction, and the direction of the interaction is marked with an arrowhead. Next to each network, the total number of interactions per genus within each cluster is displayed, coded by interaction type: mutualism, competition, parasitism, predation, and commensalism Non-traditional microorganisms in spontaneous fermentations In addition to the metataxonomic assignment of fungi, bacteria, and yeasts, our analysis also yielded a metataxonomic profile of microorganisms not typically reported in fermentations. The assignment revealed the existence of different Phyla in the four Mezcal production events. We consistently found 28 non-bacteria and non-fungal Phyla, of which viruses were the most abundant (74.5%), followed by Chlorophyta (11.61% [mitochondria and chloroplast filtered]), Oomycota (4.81%), Euryarchaeota (3.26%), Ciliophora (1.44%), Rhodophyta (1.39%) as well as other 22 Phyla of archaea, protists and microalgae with abundance less than 1%. The relative abundance of taxa was similar across the four events and did not present significant differences (p > 0.05). However, when analyzing the samples by sample group and the environmental samples by sample subtype, a significant difference was observed (p < 0.05 by PERMANOVA analysis) (Supplementary File SF10). Discussion Taxonomic-based analyses The sensory characteristics of alcoholic beverages, such as Wine, Beer, and Spirits, are increasingly appreciated worldwide [1, 13, 51]. Mezcal, in particular, is appreciated for its sensory complexity, which is linked to the geographical and environmental diversity of the producing regions (Terroir) [7]. Most attention on the spirit production has focused on the plant variety and the distillation practices used, leaving aside the fermenting microbiota [4]. However, the natural reservoirs of indigenous microorganisms that carry out spontaneous fermentations, as in Mezcal, have been poorly studied [4]. In this work, we employed a metagenomic approach to characterize the fermentation microbiome of four isolated artisanal Mezcal production events, aiming to understand the origin, diversity, and shifts in microbial communities and their potential contributions to the resulting sensory profile. Besides the geographic distances and differences in environmental conditions (Table 1) and the common non repeateability of production batches, we observed similar microbial communities clustered by sample type, with a core of microbial genera present in similar proportions in all fermentation samples, regardless of the geographic origin (Fig. 2A), suggesting that the fermentation environment exerts a determining selective pressure on microbial composition above and beyond the initial environmental variability. Our results show that bacteria widely dominate environmental samples, as observed in similar environments such as the plant endosphere [52–55], soil [51], weevil [13], and water [56]. In fermentation samples, our results show that the bacterial domain is the most abundant, with coexistence among different LAB and AAB species. In contrast, the Saccharomyces and Torulaspora yeasts represented less than 1% of the total reads. Our results are consistent with previous reports evaluating microorganisms in alcoholic spontaneous fermentations, in which LAB are the most abundant taxa in beverages of plant origin, such as Toddy, Pulque, and other Agave distillates [3, 4, 18, 26, 57]. In these works, LAB and AAB have been consistently reported as contributors to the development of beverage odor and aroma [58]. For some authors, bacteria were considered potential agents of deterioration and decomposition in beverages [59]. However, AAB has recently been reported to reduce food-borne pathogens [60] and even regarded as responsible for the distinctive aroma of palm beverages [60–62]. Our work expands the list of microorganisms associated with traditional Agave fermentations, as most identified bacterial genera have not been described or isolated from the surrounding environment or from commercial conditions. Our data reveal several key findings regarding the natural reservoirs and origin of fermenting consortia, as well as the shifts observed during fermentation. These data shed light on the microbial and functional diversity during the spontaneous fermentation of Mezcal. We provide the first direct evidence of bacterial dominance throughout the production process in four isolated spontaneous fermentation events. Specific bacterial genera were enriched at different fermentation times, including Leuconostoc in the Soledad, Marillero, and Vinata events, whereas Lentilactobacillus dominated the Piedras event. This association between bacterial diversity and the fermentation stage is consistent with findings from other fermentation processes [24, 25, 63]. It has been suggested that native microbial communities are likely due to cross-contamination under non-aseptic conditions during harvesting, transportation, and fermentation [25, 26]. For example, the identification of Leuconostoc in the samples (likely the gut) of S. acupunctatus suggests that insects may transmit microbial community members to the fermentation samples. In this case, the fermenting microorganisms are putatively present in the gut of S. acupunctatus, a natural borer of Agave plants; these microbes could be critical participants in the turnover of Agave fructans (agavines) during the digestion of the plant tissue, as a consequence of an evolutionary adaptation to this substrate. Consistent with this idea, the microbial communities of weevil samples clustered with those of fermentation samples, suggesting similar community structures. This finding is not new; since 1995, Lachance identified Drosophila spp. as a putative inoculation vector in the spontaneous fermentation of Tequila [64]. Recently, Di Paola suggested that wasps (Vespa crabro and Polistes spp.) participate as vectors of initial inoculation in wine [13]. This evidence suggests that environmental factors and manufacturing practices significantly influence the microbial composition of spontaneous fermentations. We identified a microbial core consistently present in most or all fermentation stages during the production process. These differences in microbiota were only observed when grouping environmental samples by sample type, suggesting that the microbiota of those samples is regulated by the microenvironment, regardless of geographic origin, which would imply a selection force present faced by microorganisms when transitioning from the environmental reservoirs to the fermenting conditions, including the change of substrate, oxygen availability, pH, and other factors. In line with the previous idea, when fermenting communities were analyzed, similar consortia were found, independent of geographic origin, time, and fermentation depth, which contrasted with the structure of communities present in the cooked juice. The conformation of the fermenting consortia appears to be very rapid, occurring within the first few hours of fermentation, and spreads rapidly in the tank, probably due to must agitation (a common traditional practice), suggesting that the early moments of fermentation are essential. Future work exploring shorter timescales will shed light on the nature of this phenomenon. Our evidence indicates that the conditions inside the distillery are more decisive than those we measured outside; however, environmental samples emerge as clear reservoirs and possible inoculation vectors. Indeed, an earlier study evaluating local influences on spontaneous Agave fermentation processes suggested that Agave species are among the most significant factors contributing to the flavor and aroma of derived spirits [4]. In addition, we report, for the first time, on the dominance and coexistence of bacteria in the Agave fermentation process using shotgun genomics. This approach enables analysis of the microbial community as a whole, thereby eliminating bias associated with taxon-targeted methods, such as amplicon or culture-dependent methods. Our sequence control, using a synthetic community, demonstrated that the extraction method and bioinformatic processing slightly overrepresented yeasts, validating the bacterially dominated fermenting consortia. Finally, we must stress the potential limitations of this study regarding the microbial diversity estimation, since the NCBI nr database is not taxonomically curated and is highly redundant. Even though we employed a pipeline that enables taxonomic classification of metagenomic reads via protein-space alignments, a follow-up at the MAG-level analysis will provide supporting evidence. Functional prediction-based analyses and contribution to sensorial profile The annotated functions of the environmental and fermentation samples were quite similar at high classification levels, with carbohydrate metabolism being the most abundant. Carbohydrate, amino acid, and protein metabolism become the primary functions across all samples; these results are similar to those reported in other studies of spontaneous fermentation [65, 66]. Previous studies have shown that aroma components are associated with amino acid metabolism and biosynthesis, and the dynamic interaction between yeast and LAB promotes the metabolism of aromatic compounds [54, 67, 68]. As microbial dynamics are crucial for the formation of critical flavors and metabolic activities, interactions between microorganisms, such as LAB and yeasts, may have a decisive impact on the quality of fermented foods [69, 70]. In this way, by analyzing only the metabolism of carbohydrates and aromatic compounds (Fig. 5A), we focus on the contribution these can make to alcohol production and the sensory profile. It is widely accepted that carbohydrate metabolic pathways are the central regulators of ethanol and other metabolic byproducts found in wine [3, 18]. This functional profile was consistent across different fermentation stages (T1, T2, T3) and vat depths, suggesting a conserved functional core throughout the fermentation process. Previous studies have found that ethanol production is primarily due to microorganisms’ metabolism, which participates in the glycolytic pathway or the Ender-Doudoroff pathway as alternative pathways, or in alcohol production by bacteria [66]. The production and accumulation of higher alcohols and aroma compounds result from the active participation of microorganisms and the dynamic interaction between yeasts and LAB, which promote the metabolism of flavor chemicals, such as amino acid catabolism Ehrlich pathway, as well as lipid production [53, 54, 67, 68, 71]. Furthermore, some studies report that Leuconostoc contributes to the synthesis of aromatic amino acids in fermented beverages [18]. Moreover, the dominant genus, Bacillus, has a broad metabolic capacity, allowing it to produce a variety of aromatic compounds, including aldehydes, higher alcohols, esters, and organic acids, which can contribute sensory notes such as sweet, fruity, earthy, or smoky aromas [72]. Lentilactobacillus, which participates in the formation of secondary aromatic compounds that directly impact the sensory profile, was also found [73]. Other LAB species can also synthesize these metabolites, playing a fundamental role in the final sensory profile of the products. In this context, various functional superclasses, including lactate fermentation, acetoin metabolism, butanediol metabolism, mixed acid fermentation, and aromatic amine catabolism, have been associated with the sensory profile of alcoholic beverages such as beer, wine, and spirits [25, 74, 75] (Fig. 5A). Functional prediction is broadly associated with sensory characteristics of spirit beverages. Volatile compounds related to carbohydrate and amino acids metabolism (e.g., alcohols, esters, acetates) are known to play an essential role in flavor formation [54], however, their exact contributions to all components are still unclear, and further studies using multi-omic approaches, such as metaproteomics and metatranscriptomics, are needed [67, 76], given that most compounds are known to be contributed by some bacterial groups, mainly LAB, and some yeast genera [18]. As is the case with Leuconostoc, Weisella, and Bacillus, which have been positively correlated with floral and buttery aromas in wines [77]. The results obtained allow us to establish a clear relationship between the most abundant microbial genera, the functional identification of microorganisms, their metabolic activity, and specific sensory descriptors (Fig. 6C). This knowledge may add value to the industry by allowing us to anticipate desirable or undesirable sensory characteristics based on the microbiota involved and to optimize strain selection or adjust the fermentation process, ensuring profiles consistent with the expected beverage style. These findings reinforce the importance of integrating microbiological, metabolomic, and sensory analyses into the design of fermentation processes. Analysis of interaction networks in spontaneous fermentation Fermenting microbial communities underlie complex ecological relationships that may not be reflected in diversity and richness analyses. In this regard, microbial interactions can be revealed from a dynamic perspective. We identify putatively regulating phylotypes or consortia throughout the fermentation process. Previous ecological studies suggested that the complexity of the microbial network could reflect the multifunctionality of communities, which depends on microenvironmental conditions [78–81]. These interactions and the succession rate in fermenting communities can affect their metabolism and, consequently, the flavor profile [82]. The networks generated from utensils (Cluster 1) plants (Cluster 3) or soil (Cluster 4) samples reflect a greater complexity in all cases (more nodes and interactions) compared to the network based on fermentation samples (Cluster 2), which demonstrates a specialized structure of the microbial community, in which competition for nutrient availability is reflected in the fermentation process in which LAB exert a competitive relationship, mainly against yeasts, such as Saccharomyces and Torulaspora (nodes 6 and 7 respectively, Fig. 7C). These interactions may be related to feeding, either through competition for nutrients or through the release of compounds [57]. Previous evidence suggests that bacteria reflect competitive relationships with yeasts because all microorganisms must compete for the same sources of nutrients (oxygen, sugars, nitrogen, vitamins, and lipids), which determines the level of inhibition or competition between different microbial populations [70]. Our network models raise the question of the microbial ecological role in spontaneous fermentations and their impact on the sensory properties of the final product, besides the sole abundance of specific taxa. However, due to the limited number of studies on this topic and the wide variability in methodologies, most reports have not yielded consistent conclusions on the impact of microbial interactions and their contribution to the sensory profile. Of particular relevance, some taxa, such as viruses, can be identified as participating in specific networks, suggesting clear ecological regulatory roles. Recent studies suggest that viruses, particularly bacteriophages, play an active role in the microbial networks of ecosystems. Their presence points to ecological regulatory functions, such as parasitism or predation, that control key bacterial populations and modulate microbial succession [83, 84], as observed in the interaction networks. Virus populations can have direct and indirect effects on the production of aromatic metabolites and, consequently, on the final sensory profiles of alcoholic beverages. However, the use of ecological guild classifiers, complemented by experimental approaches that demonstrate the nature of the predicted interactions, remains to be extensively explored. Non-traditional microorganisms in spontaneous fermentations Genomic analysis enables us to identify organisms across all domains, including microalgae, archaea, protozoa, and oomycetes. This work is the first to comprehensively characterize the entire microbial community using deep metagenomics throughout the Mezcal production process, from soil to final product. We identified microorganisms that are rarely reported in fermentation processes, opening the way for new studies to explore their putative ecological roles in spontaneous fermentations. Compared to bacteria, our understanding of Archaea’s biology is limited. Previously, it was thought that they were restricted to highly acidic and hydrothermal environments; however, we now know that they are found in nature and other environments, such as fermentations, suggesting that they perform essential ecological functions of potential interest [85]. Another clade, the Oomycetes, has been reported to play a significant role in plant rot, thereby making organic matter accessible to other microorganisms [86]. However, most known Oomycete species are pathogens of eukaryotes [87], so it is interesting to trace the origin of these microorganisms to identify their reservoirs in the Mezcal environment factories. In the case of microalgae, new research opens up the possibility of identifying the potential contribution of microalgae-derived molecules to the production of various sensory compounds. Microalgae-derived lipids, since fatty acids may participate in the metabolic pathways for the formation and conversion of a high diversity of lipids, allowing the development of a wide range of their applications, food products, and food additives, among others, when used as a fermenting substrate [88]. Conclusion Our results demonstrate that protecting the regional ecological environment in the production area supports the stability of the fermentation microbial community during production, thereby maintaining the quality and unique flavor of Mezcal. Furthermore, our results provide valuable insights into incorporating the microbial factor in the conservation and contribution to the Terroir of not only Mezcal but also various fermented foods. Further research should be conducted to explore 1) correlations and interactions between environmental conditions and spontaneous fermenting communities, 2) differences considering specific taxa and functions, 3) metabolomic and transcriptomic analyses, and 4) shorter intervals in fermentation. Finally, it is essential to establish a system for environmental and social protection measures to maintain the stability of the fermentation microbial community and the cultural processes (including family roles) that preserve it. Supplementary Information Supplementary Material 1. Supplementary Material 2. Supplementary Material 3. Supplementary Material 4. Supplementary Material 5. Supplementary Material 6. Supplementary Material 7. Supplementary Material 8. Supplementary Material 9. Acknowledgements The authors thank Gregorio Hernández and family from “La Soledad” Mezcal, Manuel Montaño and Engracia Montaño from “El Marillero” Mezcal, Luz María Saavedra, Octavio Miranda, and Everardo Villa Hernández from “NanaKutzi” (La Vinata) Mezcal, Sergio Rangel Vieyra (in memoriam), and Rosalía Facio Maciel from “Piedras de Lumbre” Mezcal, Ramiro Angelina, Julio Olvera, Emma Iglesias, Hugo Ruiz González, and Mujeres del Mezcal A.C. for their support in the field research. The authors thank the Instituto de Investigaciones en Matemáticas Aplicadas y en Sistemas, Unidad Académica del Estado de Yucatán, UNAM in Yucatán, Mexico, and the Carlos Chagas Filho Institute of Biophysics of the Federal University of Rio de Janeiro, Brazil, for providing access to supercomputing resources. Authors’ contributions PABL. Investigation, Conceptualization, Methodology, Software, Formal analysis, Visualization, Writing -original draft, Writing—review & editing. EPR. Methodology, Validation, Funding acquisition, Software, Data curation, Supervision, Formal analysis, Writing—review & editing. GMD. Methodology, Validation, Software, Formal analysis, Data curation, Funding acquisition, Writing—review & editing. NYLS. Methodology, Validation, Visualization, Software, Formal analysis, Project administration, Resources, Data curation, Investigation, Writing—review & editing. AMM. Supervision, Validation, Writing—review & editing. LPPM. Validation, Visualization, Supervision, Writing—review & editing. EZ. Validation, Writing—review & editing, Supervision, Writing—review & editing. YJPR. Corresponding Author. Submitting Author. Conceptualization, Methodology, Software, Data curation, Supervision, Resources, Project administration, Writing—review & editing, Visualization, Validation, Funding acquisition. Funding This research was funded by El Colegio de la Frontera Sur through the research grant 5103711808 2021–2024 awarded to YJPR. The sequencing project was granted in 2022 by Química Valaner-MGI Mexico for the “Omics Unravel Mezcal, a Drink with a Complex Spirit” project. PABL is indebted to the Consejo Nacional de Humanidades Ciencias y Tecnologías for her Doctoral scholarship number 786763. PAPIIT-DGAPA UNAM supported EPR through grant IN206326. Data availability The crude sequence dataset is available under NCBI BioProject accession PRJNA1190398. The samples analyzed may be made available upon request after a share transfer agreement has been executed. The datasets generated during the current study are available from the corresponding author upon reasonable request. Declarations Ethics approval and cosent to participate Not applicable. Competing interest The authors declare no competing interests. Footnotes Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Citations Supplementary Materials Supplementary Material 1. Supplementary Material 2. Supplementary Material 3. Supplementary Material 4. Supplementary Material 5. Supplementary Material 6. Supplementary Material 7. Supplementary Material 8. Supplementary Material 9. Data Availability Statement The crude sequence dataset is available under NCBI BioProject accession PRJNA1190398. The samples analyzed may be made available upon request after a share transfer agreement has been executed. The datasets generated during the current study are available from the corresponding author upon reasonable request.