The reproducibility of chemical reactions, when obtaining protocols from literature or databases, is highly challenging for academicians, industry professionals and even now for the machine learning process. To synthesize the organic molecule under the photochemical condition, several years for the reaction optimization, highly skilled manpower, long reaction time etc. are needed, resulting in non-affordability and slow down the research and development. Herein, we have introduced the DigiChemTree backed with the artificial intelligence to auto-optimize the photochemical reaction parameter and synthesizing the on demand library of the molecules in ultra-fast manner. Newly, auto-generated digital code was further tested for the late stage functionalization of the various active pharmaceutical ingredient.