Introduction: Biochar and milk vetch (MV) are known to improve soil fertility and crop yield. However, the effects of the combined application of rice straw biochar (RSB) and MV over multiple years on nitrogen (N) dynamics, microbial ecology, and rice yield remain unclear. This study is to evaluate the synergistic effects of RSB and MV over multiple growing seasons. Methods: A three-year field experiment was conducted with four treatments, N fertilizer alone (CK), N+RSB (B), N+MV (M), and N+RSB+MV (BM), and measured various indicators of soil health and rice yield. Results: Soil organic C, total N, inorganic N (NH 4 + and NO 3 − ), microbial biomass C/N, and enzyme activities (urease, nitrate, and nitrite reductase) were 14%–30%, 12%–25%, 18%–40%, 20%–45%, and 15%–50% higher in the B and M treatments than in the CK; the greatest increases in these parameters (by 14%–89%) were observed in the BM treatment. Microbial diversity (α-diversity of soil microbes) was increased and the expression of N-cycling functional genes ( nif H, amo A, nar G, nir S/ nir K, nos Z) was 9.1%–400% higher in the BM treatment than in the CK. High gene abundances (AOA amo A, AOB amo A, nar G, nir S, nir K, and nos Z) were associated with increased N uptake and grain yield. Microbial biomass C and N were key drivers of shifts in microbial communities influencing N-cycling genes. Increased soil C and N availability in the BM treatment stemmed from changes in the expression of microbial genes and enzyme activities enhancing N assimilation and rice yield. Discussion: Hence, combining RSB with MV can promote soil fertility, rice productivity and ecological benefits.