Developing highly efficient photocatalysts for converting CO2 into solar fuels is of great importance for energy sustainability. However, efficient photoreduction of CO2 over the heterogeneous catalyst is hindered by lack of precisely controlled active sites and poor contact between active sites and the semiconductor, which leads to low selectivity and poor photochemical stability of the catalyst. Herein, utilizing highly stable and readily tunable photoresponsive covalent triazine frameworks (CTFs) as intriguing platforms, the well-defined molecular catalysts are directly knitting into CTFs by an in-situ covalent-bonding strategy for the first time to afford photo-responsive single-site Ru CTFs. The robust chemical knitting of molecular catalyst with porous CTFs provides the atomically dispersed catalytic sites, providing enhanced light absorption and CO2 diffusion. Significantly, the resulting Ru-CTF can reduce CO2 to formic acid under visible light with excellent selectivity (98.5%) and activity (6270 μmol·gcat-1), which greatly outperforms most other polymer semiconductors reported so far. However, the homogeneous Ru counterpart (Ru(dcbpy)(CO)2Cl2, dcbpy=2,2'-bipyridine-5,5'-dicarbonitrile) exhibits a low activity and deactivates within 1 h. Systematic investigations reveal that the introduction of single sites (Ru-N2) can promote photoinduced charge separation and CO2 activation, thus significantly enhancing the photocatalytic performance. The combination of in-situ fourier transform infrared spectrometer (in-situ FTIR), density functional theory (DFT) calculations and luminescence quench experiments were particularly investigated to confirm the possible photocatalytic CO2 reduction mechanism over Ru-CTF. This work provides a new pathway and significant insights into the design of CTF-based single-site photocatalysts for highly selective CO2 photoreduction.