The complexity of the gut ecosystem, with thousands of cross-talking microbial colonizers, together with sparsely observed abundance profiles, has limited progress. We have developed a computational framework to learn an approximate “digital twin” of the maturing infant microbiome, that once learned, can reliably forecast detailed ecosystem trajectories unfolding over weeks from few initial observations. This generative model (Q-net), inferred at the level of taxonomic classes of microbes automatically from standard 16S rRNA profiles, is used to uncover actionable patterns driving developmental fate in early life. Example notebooks are included. Curated models are available at https://doi.org/10.5281/zenodo.7453697.