The objective of this study was to elucidate the role and mechanism of changes in the rhizosphere microbiome following A. oligospora treatment in the biological control of root-knot nematodes and identify the key fungal and bacterial species that collaborate with A. oligospora to biocontrol root-knot nematodes. We conducted a pot experiment to investigate the impact of A. oligospora treatment on the biocontrol efficiency of A. oligospora against Meloidogyne incognita infecting tomato. We analyzed the rhizosphere bacteria and fungi communities of tomato by high-throughput sequencing of the 16S rRNA gene fragment and the internal transcribed spacer (ITS). The results indicated that the application of A. oligospora resulted in a 53.6% reduction in the disease index of M. incognita infecting tomato plants. The bacterial diversity of rhizosphere soil declined in the A. oligospora-treated group, while fungal diversity increased. The A. oligospora treatment enriched the tomato rhizosphere with Acidobacteriota, Firmicutes, Bradyrhizobium, Sphingomonadales, Glomeromycota and Purpureocillium. These organisms are involved in the utilization of rhizosphere organic matter, nitrogen, and glycerolipids, or play the role of ectomycorrhiza or directly kill nematodes. The networks of bacterial and fungal co-occurrence exhibited a greater degree of stability and complexity in the A. oligospora treatment group. This study demonstrated the key fungal and bacterial species that collaborate with the A. oligospora in controlling the root-knot nematode and elaborated the potential mechanisms involved. The findings offer valuable insights and inspiration for the advancement of bionematicide based on nematode-trapping fungus.