A mobile electronic device, comprising: a memory device (220; 660); a memory controller (210; 600; 601) comprising a processor and an internal memory and configured to operate the memory device (210; 600; 601), wherein the memory controller (210; 600; 601) further comprises: an error correction code, ECC, encoder (605; 1005) configured to encode data for programming to the memory device (210; 600; 601); a constrained channel encoder configured to encode an output of the ECC encoder (605; 1005) based on one or more constraints for programming to the memory device (220; 660); a reinforcement learning pulse programming, RLPP, component configured to identify a programming algorithm for programming the data to the memory device (220; 660); a constrained channel decoder configured to receive a constrained vector and produce an unconstrained vector; and an ECC decoder configured to decode the unconstrained vector, wherein: the RLPP component comprises a wordline agent, a level agent, and a block agent, and wherein: the block agent is configured to receive a wordline voltage vector as input from the memory device (220; 660) and to output a block policy for a target wordline to program, the wordline agent is configured to receive a constrained vector from the constrained channel encoder and the block policy from the block agent and to output a wordline policy for a target level to program, and the level agent is configured to receive the wordline policy from the wordline agent and to output a level policy to the memory device (220; 660) storing voltage levels to represent bits of information. a memory device (220; 660); a memory controller (210; 600; 601) comprising a processor and an internal memory and configured to operate the memory device (210; 600; 601), wherein the memory controller (210; 600; 601) further comprises: an error correction code, ECC, encoder (605; 1005) configured to encode data for programming to the memory device (210; 600; 601); a constrained channel encoder configured to encode an output of the ECC encoder (605; 1005) based on one or more constraints for programming to the memory device (220; 660); a reinforcement learning pulse programming, RLPP, component configured to identify a programming algorithm for programming the data to the memory device (220; 660); a constrained channel decoder configured to receive a constrained vector and produce an unconstrained vector; and an ECC decoder configured to decode the unconstrained vector, an error correction code, ECC, encoder (605; 1005) configured to encode data for programming to the memory device (210; 600; 601); a constrained channel encoder configured to encode an output of the ECC encoder (605; 1005) based on one or more constraints for programming to the memory device (220; 660); a reinforcement learning pulse programming, RLPP, component configured to identify a programming algorithm for programming the data to the memory device (220; 660); a constrained channel decoder configured to receive a constrained vector and produce an unconstrained vector; and an ECC decoder configured to decode the unconstrained vector, wherein: the RLPP component comprises a wordline agent, a level agent, and a block agent, and wherein: the block agent is configured to receive a wordline voltage vector as input from the memory device (220; 660) and to output a block policy for a target wordline to program, the wordline agent is configured to receive a constrained vector from the constrained channel encoder and the block policy from the block agent and to output a wordline policy for a target level to program, and the level agent is configured to receive the wordline policy from the wordline agent and to output a level policy to the memory device (220; 660) storing voltage levels to represent bits of information. the block agent is configured to receive a wordline voltage vector as input from the memory device (220; 660) and to output a block policy for a target wordline to program, the wordline agent is configured to receive a constrained vector from the constrained channel encoder and the block policy from the block agent and to output a wordline policy for a target level to program, and the level agent is configured to receive the wordline policy from the wordline agent and to output a level policy to the memory device (220; 660) storing voltage levels to represent bits of information.