Vital pulp therapy (VPT) is considered a conservative treatment for preserving pulp viability in caries and trauma-induced pulpitis. However, Mineral trioxide aggregate (MTA) as the most frequently used repair material, exhibits limited efficacy under inflammatory conditions. This study introduces an innovative nanocomposite hydrogel, tailored to simultaneously target anti-inflammation and dentin mineralization, aiming to efficiently preserve vital pulp tissue. The L-(CaP-ZnP)/SA nanocomposite hydrogel was designed by combining L-Arginine modified calcium phosphate/zinc phosphate nanoparticles (L-(CaP-ZnP) NPs) with sodium alginate (SA), and was characterized with TEM, SEM, FTIR, EDX, ICP-AES, and Zeta potential. In vitro, we evaluated the cytotoxicity and anti-inflammatory properties. Human dental pulp stem cells (hDPSCs) were cultured with lipopolysaccharide (LPS) to induce an inflammatory response, and the cell odontogenic differentiation was measured and possible signaling pathways were explored by alkaline phosphatase (ALP)/alizarin red S (ARS) staining, qRT-PCR, immunofluorescence staining, and Western blotting, respectively. In vivo, a pulpitis model was utilized to explore the potential of the L-(CaP-ZnP)/SA nanocomposite hydrogel in controlling pulp inflammation and enhancing dentin mineralization by Hematoxylin and eosin (HE) staining and immunohistochemistry staining. In vitro experiments revealed that the nanocomposite hydrogel was synthesized successfully and presented desirable biocompatibility. Under inflammatory conditions, compared to MTA, the L-(CaP-ZnP)/SA nanocomposite hydrogel demonstrated superior anti-inflammatory and pro-odontogenesis effects. Furthermore, the nanocomposite hydrogel significantly augmented p38 phosphorylation, implicating the involvement of the p38 signaling pathway in pulp repair. Significantly, in a rat pulpitis model, the L-(CaP-ZnP)/SA nanocomposite hydrogel downregulated inflammatory markers while upregulating mineralization-related markers, thereby stimulating the formation of robust reparative dentin. The L-(CaP-ZnP)/SA nanocomposite hydrogel with good biocompatibility efficiently promoted inflammation resolution and enhanced dentin mineralization by activating p38 signal pathway, as a pulp-capping material, offering a promising and advanced solution for treatment of pulpitis.