We develop a chemical evolution model in order to study the star formation history of the Milky Way. Our model assumes that the Milky Way is formed from a closed box-like system in the inner regions, while the outer parts of the disc experience some accretion. Unlike the usual procedure, we do not fix the star formation prescription (e.g. Kennicutt law) in order to reproduce the chemical abundance trends. Instead, we fit the abundance trends with age in order to recover the star formation history of the Galaxy. Our method enables one to recover with unprecedented accuracy the star formation history of the Milky Way in the first Gyrs, in both the inner (R<7-8kpc) and outer (R>9-10kpc) discs as sampled in the solar vicinity. We show that, in the inner disc, half of the stellar mass formed during the thick disc phase, in the first 4-5 Gyr. This phase was followed by a significant dip in the star formation activity (at 8-9 Gyr) and a period of roughly constant lower level star formation for the remaining 8 Gyr. The thick disc phase has produced as many metals in 4 Gyr as the thin disc in the remaining 8 Gyr. Our results suggest that a closed box model is able to fit all the available constraints in the inner disc. A closed box system is qualitatively equivalent to a regime where the accretion rate, at high redshift, maintains a high gas fraction in the inner disc. In such conditions, the SFR is mainly governed by the high turbulence of the ISM. By z~1 it is possible that most of the accretion takes place in the outer disc, while the star formation activity in the inner disc is mostly sustained by the gas not consumed during the thick disc phase, and the continuous ejecta from earlier generations of stars. The outer disc follows a star formation history very similar to that of the inner disc, although initiated at z~2, about 2 Gyr before the onset of the thin disc formation in the inner disc.