In this study, we developed a machine learning methodology and a general-purpose Python library for simultaneously designing molecules exhibiting any desired set of properties and their synthetic reactions with any network topology. A forward model was constructed using a synthetic reaction prediction model and property prediction models as building blocks, and its inverse mapping was obtained based on a Bayesian inference framework to simultaneously identify a reaction network, its constituent reactant sets, and the final products that satisfy arbitrary target properties. The reactant set was selected based on a combination of predefined commercial compounds. As the design space, consisting of arbitrary reaction networks and reactant sets, was very large, we developed a sequential Monte Carlo algorithm incorporating a recurrent algorithm for the network search. Performance tests showed that our algorithm can successfully find high-quality virtual molecules. The quality of the designed molecules was evaluated based on their reproducibility and novelty with respect to previously synthesized molecules. The distributed Python library was designed using an interface that allows users to plug-in arbitrary reaction prediction models, property prediction models, and a set of commercial compounds. This is expected to facilitate its widespread use in practical applications.