Biomass, as a renewable and sustainable energy resource, can be converted into environmentally friendly and practically valuable biofuels and chemical materials via pyrolysis. However, the process optimization and pyrolysis efficiency are restricted by the limited perception of the complicated mechanisms and kinetics for biomass pyrolysis. Here, to establish an in-depth mechanism model for biomass pyrolysis, we presented a novel investigation for the thermal evolutions and pyrolysis kinetics of the functional groups in peanut shell matrix by using in-situ Fourier transform infrared spectrometry (in-situ FTIR) and thermogravimetric analysis-Fourier transform infrared spectrometry-mass spectrometry (TG-FTIR-MS). The in-situ FTIR spectrum deconvolution for the solid matrix was innovatively introduced to identify and quantify the real-time evolution and thermal dynamics of the functional groups during peanut shell pyrolysis. The result for the first time proposed that the pyrolysis mechanisms of total OH at 20-380 degrees C, aliphatic C-H-n groups at 20-500 degrees C, C=O groups at 260-500 degrees C, and C-O groups at 300-500 degrees C were dominant by diffusion and order-based chemical reactions. The TG-FTIR-MS analysis was conducted for the online monitoring of the released volatiles and gases, the amounts of which were in the sequence of C=O > CO2 > aliphatic C-O-(H) > C-O-(C) in esters > aromatics > H2O > phenolic hydroxyl > aliphatic hydrocarbons > CO. The study established a novel methodology to evaluate the biomass pyrolysis mechanisms at the molecular level, which provided valuable information for developing advanced pyrolysis techniques on a large scale for sustainable ecosystem.