We have developed an organic-based resistive random access memory (ReRAM) by using spin-coated polyimide (PI) as the resistive layer. In this study, the chain distance and number of chain stacks of PI molecules are investigated. We employed different solid contents of polyamic acid (PAA) to synthesize various PI films, which served as the resistive layer of ReRAM, the electrical performance of which was evaluated. By tuning the PAA solid content, the intermolecular interaction energy of the PI films is changed without altering the molecular structure. Our results show that the leakage current in the high-resistance state and the memory window of the PI-based ReRAM can be substantially improved using this technique. The superior properties of the PI-based ReRAM are ascribed to fewer molecular chain stacks in the PI films when the PAA solid content is decreased, hence suppressing the leakage current. In addition, a device retention time of more than 10 7 s can be achieved using this technique. Finally, the conduction mechanism in the PI-based ReRAM was analyzed using hopping and conduction models.