PurposeIn this research, we seek to understand the effects of artificial intelligence (AI) and knowledge management (KM) processes in enhancing proactive green innovation (PGI) within oil and gas organizations. It also aims to investigate the moderator role of trust and sustainability in these relationships.Design/methodology/approachThis paper employs a quantitative analysis. Surveys have been gathered from the middle-line managers of twenty-four oil and gas government organizations to evaluate the perceptions of the managers towards AI, KM processes, trust, sustainability measures and proactive measures toward green innovation. Analytical and statistical tools that were employed in this study, including structural equation modeling with SmartPLSv3.9, have been used to analyze the data and to examine the measurement and structural models of this study.FindingsThe study results reveal a significant and positive impact of AI utilization, KM processes and PGI within oil and gas organizations. Furthermore, trust and sustainability turn out to be viable moderators affecting, and influencing the strength and direction of AI, KM and PGI relationships. In particular, higher levels of trust and more substantial sustainability commitments enhance the positive impact of AI and KM on green innovation outcomes.Practical implicationsUnderstanding the impact of AI, KM, trust and sustainability offers valuable insights for organizational leaders and policymakers seeking to promote proactive green innovation within the oil and gas industry. Thus, organizations can increase the efficiency of sustainable product development, process improvement and environmental management by using robust AI technologies and effective KM systems. Furthermore, fostering trust among stakeholders and embedding sustainability principles into organizational culture can amplify the effectiveness of AI and KM initiatives in driving green innovation outcomes.Originality/valueThis study extends the current knowledge by assessing the effect of AI and KM on proactive green innovation while accounting for trust and sustainability as moderators. Utilizing quantitative methods offers a nuanced understanding of the complex interactions between these variables, thereby advancing theoretical knowledge in the fields of innovation management, sustainability and organizational behavior. Additionally, the identification of specific mechanisms and contextual factors enriches practical insights for organizational practitioners striving for a practical understanding of the dynamics of the complexities of sustainable innovation in an AI-driven era.