The dysfunction of tumor infiltrating lymphocytes (TILs) directly correlates with out of control of tumor growth and metastasis. New approaches and insightful clarity for rescuing TILs dysfunction are urgently needed. Here, we design two heterogenous antigens based on MHC-I epitope and MHC-II epitope from tumor, and assemble heterogenous antigens by electrostatic interactions and π-π stacking into heteroantigen-assembled nanovaccine (HANV). HANV not only significantly increases the abundance of CD8+ and CD4+ TILs, but also elicits stronger polyfunctionality of CD8+ and CD4+ TILs in vivo. Enhanced polyfunctionality of CD8+ and CD4+ TILs positively correlate to suppression of tumor growth and metastasis in melanoma-bearing mouse models. We also validate that nucleotide-binding oligomerization domain-containing protein 2 (NOD2) dominantly enhances anti-tumor capacity of TILs in a temporal immunoregulation manner. This work presents a new insight in developing HANV as a rational strategy to shape TILs polyfunctionality for tumor growth and metastasis.