Background Myocardial fibrosis caused by myocardial infarction (MI) is the key factor leading to cardiac remodeling; nod-like receptor family pyrin domain-containing 3 (NLRP3) plays an important role in regulation of myocardial injury; however, its relationship with TLR4/MyD88/NF-κB signaling pathway is largely unreported. In recent years, traditional Chinese medicine (TCM) prevention and treatment of cardiovascular diseases has shown its unique advantages and broad application prospects. LuQi Formula (LQF) has been used for more than 20 years in Shuguang Hospital (Shanghai, China), and it was confirmed that it can improve the clinical symptoms of patients after MI. Here, we investigated the mechanism of LQF by suppressing NLRP3 inflammasome activation and TLR4/MyD88/NF-κB pathway in mice with MI. Purpose The purpose of this study was to verify the positive effects of the LQF in ameliorating myocardial fibrosis and inflammasome infiltration in the MI mice in vivo. Methods Forty mice were randomized into four groups: the sham group, the MI group, the LQF group, and the perindopril group (n = 10 per group). Left anterior descending (LAD) coronary artery ligation was performed in all groups except the sham group. The mice were treated with LQF after MI. After 4 weeks, LDH, cTnI, IL-1β, and IL-18 were measured by enzyme-linked immunosorbent assay (ELISA) kit, and cardiac function was evaluated by echocardiography. Hematoxylin and eosin (H&E) and Masson staining were used to evaluate the myocardial injury and fibrosis. Western blot was used to evaluate the expression of collagen I, α-SMA, NLRP3 inflammasome, and TLR4/MyD88/NF-κB signaling pathway. Immunohistochemical analysis was used to further detect the expression of Fibronectin, α-SMA, collagen I, collagen III, NLRP3, and NF-κB in myocardial tissue. Results Compared with the MI group, the ejection fraction (EF) and fractional shortening (FS) in the LQF group were significantly improved, while the left ventricular end diastolic diameter (LVEDd) and left ventricular internal dimension systole (LVIDs) were significantly decreased. The representative staining of H&E and Masson showed that treatment with LQF could effectively reduce myocardial injury and fibrosis. ELISA results showed that serum LDH, cTnI, TNF-α, IL-18, and IL-1β in LQF group were significantly lower than those in MI group. The western blot results showed that the expressions of collagen I and α-SMA were decreased significantly in the LQF group. Moreover, the expressions of NLRP3 inflammasome and TLR4/MyD88/NF-κB signaling pathway were downregulated in the LQF treatment group. Conclusion Our results suggested that LQF could significantly improve cardiac function and ameliorate myocardial fibrosis. In addition, we found that LQF could downregulate the TLR4/MyD88/NF-κB signaling pathway and then inhibit the activation of NLRP3 inflammasome, suggesting that LQF alleviated cardiac fibrosis by decreasing the TLR4/MyD88/NF-κB signaling pathway and then inhibited NLRP3 inflammasome activation in MI mice, which indicates potential therapeutic effect of LQF on patients with MI.