Abstract Electronics based on natural materials have the advantages of simple preparation procedures, low cost, ecofriendliness, and biocompatibility. In this work, the synthesis of silver-doped citrus pectin using the solution method at 2 mg/ml of citrus pectin was investigated, and its simple fabrication method ensured uniform distribution of Ag in citrus pectin thin film. A RRAM device with the Al/Ag-doped citrus pectin/ITO/glass structure was fabricated through the spin-coating method. The results indicate that the best set and reset voltages of the Ag 10 %-doped device were 1 and −1.2 V, respectively. The Ag 10 %-doped device could switch 517 times with an on/off ratio of 2×103 and could be maintained for more than 104 s, indicating excellent stability and reliability. Furthermore, the characteristics of the multilevel storage of the Ag-doped citrus pectin device were investigated. By adjusting different compliance currents, four different resistive states could be formed in a single device with high stability and reliability. In other words, the device could store two bits in a single cell.