Photo-induced ultrafast processes often proceed on multiple electronic states and are controlled by nonadiabatic couplings between electronic and nuclear degrees of freedom. Nonadiabatic couplings are elaborate to calculate, since they require the first order (nonadiabatic coupling vectors (NACs)) and the second order (scalar couplings) derivatives of the electronic wave-function with respect to the nuclear coordinates. To study those processes nonadiabatic dynamics simulations are performed on potential energy (PE) surfaces. The surfaces can be either pre-computed and fitted, or are computed on-the-fly, in so-called direct-dynamics simulations. If the PE surfaces are pre-computed and fitted, the computational cost of the dynamic simulation can be significantly reduced. Fitted surfaces combined with the multi-configurational time-dependent Hartree approach (MCTDH) 2,3 became the golden standard for nonadiabatic dynamics simulations. But, fitting PE surfaces is a tedious task, in particular for large systems, as PE surfaces have to be accurately fitted globally or along reaction paths, which have to be known before the simulation. Contrary, in on-the-fly or direct-dynamics simulations the PE surfaces and properties are only computed on demand. This is the standard approach in full-dimensional semiclassical molecular dynamics calculations, like in trajectory surface hopping (TSH) simulations. In standard implementations of direct-dynamics simulations, an electronic structure calculation is launched at each time step independent of whether the properties have been already calculated in this region before. Such an implementation leads to recomputation of nearby points multiple times, especially if the system is trapped in a bound potential. In this work, the benefits of the two approaches are combined by introducing a database with an effective fitting algorithm.