This study explores ethnomathematical structures embedded inGedogbatik in Indonesia and examines the role of artificial intelligence (AI) in integrating these structures into STEM projects for pre-service elementary teachers and in fostering public engagement through social media. The objectives are to identify mathematical concepts in batik motifs and production processes,analyzethe contribution of AI in ethnomathematical analysis, and evaluate the pedagogical and social impacts of this integration. A qualitative ethnographic approach was employed, involving six batik artisans and eighteen pre-service teachers. Data were collected through interviews, participant observation, focus group discussions, and social media interaction analysis, andanalyzedusing thematic, narrative, and AI-assisted digital pattern techniques. The findings show thatGedogbatik embodies systematic mathematical concepts, including number, measurement, coordinate systems, geometry, transformations, and patterns, reflected in both motifs and production activities. AI enhanced analytical precision and revealed implicit mathematical reasoning used by artisans. The integration into STEM projects resulted in contextualized, pedagogically coherent learning models, thereby improving teacher competence. Social media dissemination generated positive public responses. This study contributes an AI-assisted ethnomathematics–STEM framework that supports contextual mathematics learning, teacher education innovation, and cultural sustainability.