Two different aromatic diamines monomers (3, 5-diamino-N-(4'-phenyl-4''-triphenylamino)-N-(4''-benzyl-4'''-triphenylamino)benzamide (DPTBTB) and 3, 5-diamino-N-(4'-3'', 4'', 5''-trifluorobiphenyl)-N-(4''-benzyl-3''', 4''', 5'''-trifluorophenyl)benzamide (DTBTB)) containing flexible linkages were designed and synthesized, respectively. Four organo-solubility polyimides (PI-a, PI-b, PI-c, and PI-d) were prepared via a two-step procedure with pyromellitic dianhydride (PMDA) and 3, 3', 4, 4'-biphenyltetracarboxylic dianhydride (BPDA), respectively. The four PIs performed excellent thermal stability with the temperature of 5% weight loss in range of 370–420 ℃ at N2 atmosphere. The Al/PI-a/ITO and Al/PI-b/ITO memory devices exhibited binary write-once-many-read (WORM) and rewritable (Flash) behavior, respectively. But the Al/PI-c/ITO and Al/PI-d/ITO memory devices showed ternary WORM and Flash behavior due to the deeper charge traps came from the fluorinated groups in the structure of PI-c and PI-d, respectively. The memory switching mechanism could be demonstrated through molecular simulation. The results gave an effective strategy that adjusting the structure of PI to achieve different memory effects.