Absolutely they learn through reinforcement (well, and other techniques), but not all bots remember what you said. ChatGPT for example doesn't, so saying "thank you" helps, but only in the course of the conversation itself.