Myocardial infarction (MI) stands as the predominant cause of morbidity and mortality within the spectrum of cardiovascular diseases, with an unfavorable long-term prognosis. Vagus nerve stimulation (VNS) emerges as a potential clinically significant intervention for alleviating myocardial remodeling after MI, offering promise as a therapeutic approach. However, challenges persist in addressing the fundamental issues of flexibility, miniaturization, and the long-term use of VNS devices. Here, we devised an implantable ultrasound-driven piezoelectret-based nanogenerator (UPN) as a wireless-powered and battery-free vagus nerve stimulator. The UPN with the features of flexibility and lightweight exhibited a maximum output of 10.68 V and 261 μA (peak to peak) under an ultrasonic probe setup at 700 mW cm−2. In the in vivo efficacy study, VNS therapy resulted in a notable improvement in cardiac function with the treatment of UPN, a 20.42 % enhancement in left ventricular ejection fraction and an 11.76 % increase in fractional shortening on the 28th day were realized. Concomitantly, inflammatory responses, myocardial fibrosis, and sympathetic nerve remodeling witnessed a significant reduction. Particularly noteworthy is the observed therapeutic effect linked to the inhibition of the IL-17 and TNF signaling pathways. In summary, this study introduces a novel strategy for nerve stimulation, offering a potential avenue for treating chronic inflammatory diseases.