Herein, a functional hyperbranched polyimide, denoted as ATPP-HBPI, was synthesized by termination of polyamic acid with 5-(4-aminophenyl)-10, 15, 20-triphenylporphyrin (ATPP) and chemical imidization. Subsequently, ATPP-HBPI was coordinated with Zn ion to give Zn-ATPP-HBPI. In the HBPIs, the porphyrin terminals acted as the electron donor (D) and the 6FDA moieties acted as the electron acceptor (A) to promote the electron transition. Both ATPP-HBPI and Zn-ATPP-HBPI exhibited good organo-solubility and high thermal stability. They were used as the electroactive layer to fabricate the memory device with a configuration of indium tin oxide (ITO)/HBPI/Al to evaluate their bistability. The devices exhibited different memory behaviors, WORM for ATPP-HBPI and SRAM for Zn-ATPP-HBPI, respectively. Optical and electrochemical experiments and molecular simulation were carried out to illustrate this phenomenon of performance transformation. The results show that the metallization of terminal of the HBPIs provides a strategy for tailoring the memory characteristics of the devices. V C 2018 Wiley Periodicals, Inc. J. ory characteristics of the devices.