AutoMem: Automated Learning of Memory as a Cognitive Skill — ThinkLLM