Microorganisms living inside plants can promote plant growth and health, but their genomic and functional diversity remain largely elusive. Here, metagenomics and network inference show that fungal infection of plant roots enriched for Chitinophagaceae and Flavobacteriaceae in the root endosphere and for chitinase genes and various unknown biosynthetic gene clusters encoding the production of nonribosomal peptide synthetases (NRPSs) and polyketide synthases (PKSs). After strain-level genome reconstruction, a consortium of Chitinophaga and Flavobacterium was designed that consistently suppressed fungal root disease. Site-directed mutagenesis then revealed that a previously unidentified NRPS-PKS gene cluster from Flavobacterium was essential ...