Abstract. Endmember mixing analysis (EMMA) is often used by hydrogeochemists to interpret the sources of stream solutes, but variations in stream concentrations and discharges remain difficult to explain. We discovered that machine learning can be used to reveal patterns in stream chemistry that pertain to information about weathering sources of solutes and also about subsurface groundwater flowpaths. The investigation has implications, in turn, for the balance of CO2 in the atmosphere. For example, CO2-driven weathering of silicate minerals removes carbon from the atmosphere over ~106-yr timescales. Weathering of another common mineral, pyrite, releases sulfuric acid that in turn causes dissolution of carbonates. In that process, however, CO2 is released instead of sequestered from the atmosphere. Thus, to understand long-term global CO2 sequestration by weathering requires quantification of CO2-versus H2SO4-driven reactions. Most researchers estimate such weathering fluxes from stream chemistry but interpreting the reactant minerals and acids dissolved in streams has been fraught with difficulty. We use a new machine learning technique in three watersheds to determine the minerals dissolved by each acid. The results show that the watersheds continuously or intermittently sequester CO2 but the extent of CO2 drawdown is diminished in areas heavily affected by acid rain. Sulfide oxidation contributes ~23 % to 62 % of sulfate fluxes. Without the new algorithm to deconvolve the mineral weathering, CO2 drawdown was always overestimated. The new technique, which also elucidated the importance of different subsurface flowpaths and long-timescale changes in the watersheds, should have great utility as a new EMMA for investigating water resources worldwide.