Researchers have long used gravity models to analyze international trade patterns, identify export opportunities, and negotiate trade agreements. Recent research has emphasized the significance of relatedness and product complexity research in developing robust economic development strategies. This paper presents a novel approach, incorporating relatedness and product complexity as integral elements for interpreting export potential within gravity models powered by machine learning. Our approach stands out for its proficiency in accurately predicting bilateral trade values at a detailed product group level, providing valuable insights for policymakers and other stakeholders. The research leverages random forest machine learning models for predictions and incorporates relatedness and complexity to reveal new dimensions in international trade analysis. • Inspired by the rapidly evolving research on product complexity and relatedness, we explore the possibilities of incorporating the value of potential export flows when analyzing opportunities for diversifying exports. • Gravity models of international trade are commonly employed tools for estimating trade flows and analyzing export potential. However, traditionally, these models have been utilized to estimate aggregated trade or trade within a specific product category. • We demonstrate that machine learning methods can handle thousands of product groups in one integrated model, predicting export potential at the detailed 6-digit HS product group level. • Building on Hidalgo's work, we propose a 5 W economic complexity framework for assessing export diversification opportunities, covering what, when, worth, where, and who. • To pinpoint even better-informed priorities for export promotion, future research should integrate additional features such as trade barriers, expected market demand growth rates, and risks associated with destination markets. [ABSTRACT FROM AUTHOR]