The invention provides a triterpenoid saponin compound, a synthesis method of the triterpenoid saponin compound and an application of the triterpenoid saponin compound in preparing medicaments for treating cancers and dementia. The triterpenoid saponin compound is shown in the following chemical general formula, wherein any two of R1, R2 and R3 are methyl, and the other one is hydrogen atom, R4 is pent-or hexa-monosaccharide, or disaccharide formed by the pent-or hexa-monosaccharide, or disaccharide formed by the pent-or hexa-monosaccharide, or glycosyl formed by aldehyde acid derivatives of the monosaccharide or the disaccharide, and R5 is hydrogen atom, or pent-or hexa-monosaccharide, or disaccharide formed by the pent-or hexa-monosaccharide, or substituent group formed by aldehyde acid derivatives of the monosaccharide or the disaccharide. The invention also provides a medicament with the functions of treating cancers and dementia.