We present ROBO, a model and its companion code for the study of the interstellar medium (ISM). The aim is to provide an accurate description of the physical evolution of the ISM and to set the ground for an ancillary tool to be inserted in NB-TSPH simulations of large scale structures in cosmological context or of the formation and evolution of individual galaxies. The ISM is made of gas and dust. The gas chemical composition is regulated by a network of reactions that includes a large number of species. The dust contains the standard mixture of carbonaceous grains (graphite grains and PAHs) and silicates of which the model follows the formation and destruction by several processes. The model takes into account an accurate treatment of the heating and cooling processes based on several physical mechanisms. The model is applied to a wide range of the input parameters and the results for important quantities describing the physical state of the gas and dust are presented. The results then are organized in a database which represents the space of initial and final values of the parameters after a certain time interval is elapsed. It constitutes a sort of vector field representing the evolution of a ISM element under a large variety of physical conditions. The database is fed to an artificial neural network (MANN) which, once trained, yields the same results as ROBO. Finally, MANN is faced with the NB-TSPH code EVOL so that the physical conditions of the ISM can be known at each time and position with a great accuracy in practice at no computational cost. A few illustrative cases are presented. We suggest that such an algorithm can replace the tedious real-time calculations of the thermo-dynamical properties of the ISM in hydrodynamical codes.