Endometritis is one of the main diseases which harm sheep husbandry. Astragalin and chlorogenic acid (CGA) are common active ingredients of traditional Chinese medicine (TCM) with immunoprotective, antioxidant, and anti-inflammatory properties. In the present study, sheep endometrial epithelium cells (SEECs) were successfully purified and identified, and the in vitro inflammation model of SEECs induced by Escherichia coli (E. coli) was successfully established. To explore the effect of astragalin and CGA on the inflammation induced by E. coli and its potential mechanism, six groups were set up, namely, group C, M, astragalin, CGA, BAY, and STR. Cells in group C were incubated with DMEM/F12 for 6 h, while cells in group M, astragalin, CGA, BAY, and STR were incubated with DMEM/F12, astragalin, CGA, BAY, and STR for 3 h, respectively, followed by E. coli infection at a multiplicity of infection (MOI) of 1 E. coli per cell for 3 h. Subsequently, the cells and the supernatant were collected to detect the expression of genes in the toll-like receptor 4 (TLR4)/nuclear factor-kappa B (NF-κB) pathway by ELISA, qPCR, and western blot. The results showed that E. coli could induce inflammation of SEECs in vitro, while astragalin and CGA could alleviate the inflammatory response induced by E. coli via inhibiting the activation of the TLR4/NF-κB signaling pathway, which provides a theoretical and experimental foundation for preventing sheep endometritis clinically.