Polyimides containing triazole or imidazole functionalities have been synthesized. Poly(3,3',4,4'-benzophenone tetracarboxylic dianhydride-3,5-diamino-1,2,4-triazole) (BTDA-TADA) contains triazole groups as repeat units and poly(4,4'-oxydiphthalic anhydride-1,3-aminophenoxybenzene-8-azaadenine) (ODPA-APB-8-azaadenine) consists of triazole (8-azaadenine) groups as the end caps. While the BTDA-TADA polyimide starts to decompose at 350°C, the ODPA-APB-8-azaadenine polyimide is thermally stable at 400°C. The peel strength of copper to BTDA-TADA polyimide without surface modification is 200-400 J/m2. For the adhesion of polyimide to copper, ODPA-APB-8-azaadenine polyisoimide (1.0 µm) and poly(pyromellitic dianhydride-oxydianiline) (20 µm) were coated onto the copper substrate and then the two layers were cured together to polyimides at 400°C. Peel strengths of 500-800 J/m2 were obtained. The failure of the copper/polyimide interface by peeling either the copper or the polymer layer occurred in the near-interface region of the polymer. Both PI/Cu and Cu/PI adhesion was enhanced due to the formation of Cu-polyimide complexes. In the case of PI/Cu adhesion, the polymer chain flexibility of ODPA-APB-8-azaadenine polyimide also plays a significant role in improving adhesion.