Background. Yuanzhi powder (YZP) has been extensively investigated as a natural prescription with therapeutic benefits for Alzheimer’s disease (AD). However, its active compounds and underlying immune mechanism for treating AD are still unclear. This study aimed to investigate the immune mechanism of YZP against AD through high-performance liquid chromatography (HPLC)-based network pharmacology and gene chip technology. Methods. Active components of YZP were obtained from HPLC and public databases. Subsequently, GSE5281, GSE28146, GSE29378, and GSE97760 from the Gene Expression Omnibus (GEO) database were downloaded to extract AD difference genes (DEGs). The active components-targets network and protein interaction network were then constructed by Cytoscape. The biological processes and signaling pathways, which implicate the targets of YZP for AD, were analyzed using the ClueGo Cytoscape plug-in. Molecular docking experiments were performed to verify the affinity of targets and ligands. Ultimately, the link between the hub genes and immune cell infiltration was assessed via CIBERSORT. Results. 83 YZP active compounds and 641 DEGs associated with AD, including quercetin, berberine, 3,6′-disinapoylsucrose, coptisine, and palmatine, were evaluated. We showed that FOS, CCL2, and GJA1 were the core targets and that the gap junction is an essential signaling pathway in YZP for AD. Furthermore, the AD group had a higher infiltration level of naïve B cells and resting CD4 memory T cells, as determined by the CIBERSORT. Notably, the immune cells-targets network demonstrates that GJA1 and GRM1 are intimately related to naïve B cells and plasma cells. Conclusions. YZP may help treat AD by targeting proteins with key active compounds to regulate naïve B cells and plasma cells. Our results demonstrate a new immune mechanism for treating AD with YZP.