Large-scale outflows driven by active galactic nuclei (AGN) can have a profound influence on their host galaxies. The outflow properties themselves depend sensitively on the history of AGN energy injection during the lifetime of the outflow. Most observed outflows have dynamical timescales longer than the typical AGN episode duration, i.e. they have been inflated by multiple AGN episodes. Here, we present a neural-network based approach to inferring the most likely duty cycle and other properties of AGN based on the observable properties of their massive outflows. Our model recovers the AGN parameters of simulated outflows with typical errors $< 25{{\ \rm per\ cent}}$. We apply the method to a sample of 59 real molecular outflows and show that a large fraction of them have been inflated by AGN shining with a rather high duty cycle δAGN > 0.2. This result suggests that nuclear activity in galaxies is clustered hierarchically in time, with long phases of more frequent activity composed of many short activity episodes. We predict that $\sim \! 19{{\ \rm per\ cent}}$ of galaxies should have AGN-driven outflows, but half of them are fossils - this is consistent with currently available data. We discuss the possibilities to investigate AGN luminosity histories during outflow lifetimes and suggest ways to use our software to test other physical models of AGN outflows. The source code of all of the software used here is made public.