Gambogic acid(GA)is a natural compound that exhibits strong antitumor activity against a variety of tumors. However, its poor water solubility, low specificity, and high toxicity lead to inevitable systemic adverse effects. To minimize side effects, combining gambogic acid (GA) with delivery systems such as nanohydrogels to develop an in situ vaccine system (ISV) shows great promise. In this study, we loaded GA into a novel in situ nanocomposite hydrogel vaccine system (Gel-NPs@GA) along with a near-infrared (NIR) fluorescent dye, IR-1061. The Gel-NPs@GA system allowed for temperature-triggered gelation, simplifying injection and the in vivo formation of a drug-releasing gel, with near-infrared monitoring for drug metabolism. Slow, continuous release of gelatinase-targeted GA nanoparticles from the hydrogel occurs, followed by cleavage of mPEG-peptide-PCL conjugates by gelatinase, causing particle aggregation for endocytosis by tumor cells. This approach tackled solubility issues and curbs excessive GA release, boosting therapeutic drug levels. The sustained GA release induces tumor cell apoptosis, releasing tumor antigens and reprogramming the immune-suppressive tumor microenvironment. In the CT26 colorectal cancer mice model, this in situ vaccine system significantly inhibited tumor growth. By integrating information about immune cell clusters within the tumor microenvironment with RNA sequencing results, we hypothesized that Gel-NPs@GA could synergistically stimulate the immune response through various pathways, promote the maturation of dendritic cells (DCs), increase the infiltration of T cells, and thereby remodel the tumor's immune microenvironment.