In this paper, a variety of biological phosphorus-nitrogen synergistic flame retardants were synthesized from the perspective of molecular design. At the same time, tannic acid (TA) modified graphene (GE) and multiwalled carbon nanotubes (MWCNTs) nanomaterials were prepared by combining nanocomposite technology. Then, the flame retardant was applied to expandable polystyrene (EPS) through a coating process to prepare toughened composites. And the effect of the synthesized high-efficiency phosphorus-nitrogen flame retardant on the flame retardancy efficiency and brittleness of EPS was studied. The flame retardant (PAU) was synthesized by complexing phytic acid (PA) and urea (U) in an aqueous medium, and then using polydopamine (PDA) as an adhesive. Next, on the basis of PAU, using GE and MWCNTs as tougheners, EPS-PAUCG composites were prepared by coating method. Research has found that in the UL-94 test, the flame-retardant EPS-PAUCG composites could reach V-0 level. In the CCT experiment, compared to pure EPS, the PHRR, THR, PSPR, and TSP of EPS-PAUCG2 decreased by 88.4 %, 72.3%, 74.9 %, and 80.9 %, respectively. Through mechanism analysis, it has been proven that PAUCG undergoes thermal decomposition to form a dense expandable protective carbon layer, preventing further degradation of the matrix. In addition, compared to EPS, the compressive strength of the EPS-PAUCG2 composites have increased by 22.5%. This was because the composites contained GE and MWCNTs with high molecular chain structure rigidity and specific surface area, which had a toughening effect of ductile particles.