Persistent challenges in the nanofabrication of optoelectronic memory elements with ready size-scalability, multibit data storage, and ultralow optical writing energy have limited progress toward the construction of optical data storage/buffering elements in high-density photonic-electronic circuits. Here, a multibit programmable optoelectronic nanowire (NW) memory is described that operates with an ultralow optical writing energy [ca. 180 aJ bit−1 (ca. 330 photons bit−1)] and a low standby power consumption (<1 pW) at room temperature. In this system, photoionized charged defects behave as surface trapped charges to achieve the electrical memory effect. As a result of the high surface electric field, the rate of dissociation of the photoexcited charge is amplified, thereby decreasing the optical writing energy. Moreover, the extremely high dynamic photoconductive gain (ca. 1010) makes it possible to write multibit optical data bit-by-bit into the NW. These findings should open new opportunities in next-generation multifunctional nanochips for optical data storage/buffering, optical data processing, and optical sensing purposes.