Two aromatic polyimides bearing triphenylamine (TPA) derivatives with reasonably high molecular weights were synthesized: poly(N-(2,4,6- trimethylphenyl)-N,N-4,4′-diphenylene hexafluoroisopropylidenediphthalimide) (6F-TPA-Me3 PI) and poly(N-(4-dimethylaminophenyl)-N,N-4,4′-diphenylene hexafluoroisopropylidenediphthalimide) (6F-TPA-NMe2 PI). These polymers were thermally and dimensionally very stable, providing high-quality nanoscale thin films using a conventional solution coating process. The film densities, optical properties, and electrochemical properties were determined. The polymers displayed a different nonvolatile memory behavior that depended on the substituents of the TPA unit. The 6F-TPA-Me3 PI film showed a unipolar write-once-read-many-times (WORM) memory behavior, whereas the 6F-TPA-NMe2 PI film revealed unipolar and bipolar switching memory behavior. All PI films displayed excellent retention in both the OFF- and ON-states, even under ambient conditions. The ON/OFF current ratio was high, up to 108-109. All memory behaviors were governed by a mechanism that involved trap-limited space charge limited conduction and local filament formation. The memory characteristics may originate from the electron-donating TPA and substituents and from the electron-accepting hexafluoroisopropylidenyl and imide units in the polymer backbone, which acted as effective charge-trapping sites. The film density was found to significantly influence the memory behavior. This study demonstrated that the thermally and dimensionally stable 6F-TPA-Me3 and 6F-TPA-NMe2 PIs are suitable active materials for the low-cost mass production of high-performance programmable memory devices that can be operated with very low power consumption. Moreover, the memory mode and its polarity may be tuned by changing the substituent on the TPA unit.