A learning machine with monologue