He-Wei-Decoction (HWD), a traditional Chinese medicine formula, emphasizes "strengthening the spleen and supplementing qi (Jianpi Yiqi)," and "resolving stasis and detoxifying (Huayu Jiedu)." This formula has been utilized in the treatment of chronic atrophic gastritis (CAG), however, its precise mechanisms of action remain to be elucidated. This study integrates network pharmacology with molecular dockings to identify the underlying mechanisms of HWD in the treatment of CAG. Then, immunohistochemistry assay analyzed the gastric mucosal lesions before and after treatment with HWD in CAG patients. The efficacy and mechanism of key active compounds in the treatment of CAG were validated using a 1-methyl-3-nitro-1-nitrosoguanidine (MNNG)-induced GES-1 cell in vitro model. A total of 165 active compounds from HWD were identified, along with 169 targets associated with CAG. Gene oncology (GO) analysis, Kyoto Encyclopedia of Genes and Genomes (KEGG) analysis, and Component-Target-Pathway network analysis revealed that the Toll-like receptor (TLRs) signaling pathway may play a role in HWD's regulation of inflammation in gastric mucosa. Molecular docking identified that luteolin, quercetin, and hederagenin potentially interact with key target proteins TLR4 and nuclear factor-kappaB (NF-κB). Experimental results validated that HWD significantly improved atrophic mucosa and inhibited the expression of TLR4, NF-κB, and cyclooxygenase 2 (COX2) proteins. The active compounds, luteolin, quercetin, and hederagenin, inhibit cell viability, migration and invasion, and reduce the expression of TLR4, NF-κB, and COX2. In summary, luteolin, quercetin, and hederagenin, the primary active components of HWD, can ameliorate the CAG by regulating the TLR4/NF-κB signaling pathway.