Intercropping is an important planting method for the sustainable use of land resources, and soil nematodes are an indicator of soil health, which can reveal the function of food webs in underground ecosystems. To explore the effects of different intercropping patterns of oats on yield and soil nematode communities, five treatments were set up: oat monoculture, and intercropping systems of oat||soybean, oat||rice bean, oat||potato, and oat||sweet potato. The effects of different intercropping patterns of oats on crop yield and the number, diversity, and community structure of soil nematodes were analyzed to determine the best intercropping pattern. The results showed that, compared with monoculture, intercropping had certain advantages in terms of land utilization rate and total crop yield. The intercropping of oats and potatoes had the highest land equivalent ratio (1.36), Followed by the intercropping of oats and soybeans, the land equivalent ratio is 1.29. A total of 39 genera were identified, including 12 bacterivorous nematodes, 4 fungivorous nematodes, 13 plant-parasitic nematodes, and 10 omnivorous predatory nematodes. The four oat intercropping patterns significantly reduced the relative abundance of plant-parasitic nematodes, increased the relative abundance of beneficial nematodes (bacterivorous and fungivorous), and optimized the soil nematode community structure. Among them, the best intercropping pattern was oat and soybean, with the highest proportion of microbial-feeding nematodes (88.42%) and the lowest proportion of plant-parasite nematodes (6.31%). Additionally, the intercropping pattern of oat and soybean was significantly higher than that of oat monoculture (P
<0.05) in multiple ecological indexes (Wasilewska index, nematode channel ratio, Shannon-Wiener index, and enrichment index), and was also the best among the four intercropping patterns. The enrichment index of oat and rice bean intercropping was the highest, and the plant parasite index was the lowest, indicating that the soil nematode community was the least disturbed. The enrichment index and structure index of each cropping pattern were lower than 50, and the soil nematode food web was in quadrant D, indicating that the soil environment was in a stressed state, the food web was degraded, and the soil nematode community was unstable at the experiment location. Pearson correlation analysis showed that soil nematode community ecological indices were correlated with soil physical and chemical properties. Organic matter was significantly negatively correlated with the evenness index (r
<0.05), significantly negatively correlated with the Shannon-Wiener index (r
<0.01), and significantly positively correlated with the plant parasitic index (r
<0.05). There was a significant positive correlation between available K content and the nematode channel ratio (r
<0.01), increasing available K content could change the decomposition pathway of soil organic matter and contribute more to the decomposition of soil organic matter. In conclusion, intercropping can optimize the soil nematode community structure, improve the soil ecological environment, and increase crop yield. Among the four intercropping patterns, oat and soybean intercropping were the best method, not only having the highest crop yield but also the most beneficial nematode community structure for soil health, which showed the strong production and ecological advantages of traditional Gramineae and Leguminosae intercropping.