A polyelectrolyte-confined aqueous ionic memristor demonstrated a range of neuromorphic functions with high energy efficiency.