Quantum adaptive agents with efficient long-term memories