ABSTRACT This paper highlights an innovative approach to address the environmental challenges associated with waste management and construction materials. The study presents a new technique for utilising treated sewage sludge in the production of eco-friendly geopolymer mortar. Sewage sludge is a byproduct generated from wastewater treatment plants that poses significant environmental issues due to its disposal problems. Geopolymer mortar, on the other hand, is a sustainable construction material that can be produced by activating industrial waste materials, such as fly ash, using alkaline activators. By integrating machine learning algorithms and data visualisation techniques, this study optimises the mix parameters of geopolymer mortar while simultaneously reducing the negative impact of sewage sludge disposal. The experimental results show that sewage sludge ash can replace fly ash and fine aggregate in 1:3 geopolymer mortar by up to 30% and 20%, respectively, without any toxic or heavy metal residues. The compressive and flexural strength of the sludge-based mortar were comparable to ordinary geopolymer mortar, while water absorption and drying shrinkage were similar to control specimens. This research offers a unique solution to promote sustainability in waste management and construction industry by utilising waste materials, including fly ash and treated sewage sludge, for geopolymer production.