> Is the ability to form and retain long-term memories a necessary precondition for rights in humans though?
For a species / class of being yes it is necessary. Some members of that species / class being exceptions does not make the generalization invalid.
Without the ability to form and retain long-term memories we wouldn't have developed language and abstract concepts like rights.
Whether people like it or not, rights aren't natural or god-given. Rights are only enforced or protected by the tip of a spear (or point of a gun, or hover of a drone). There are no rights in nature and they are no where to be found when social order breaks down.
Animals can't make war for their rights, so they only get the rights we deign to give them. It's not nothing, but its not the same. There is no question to me that my dogs are conscious, but its not at the same level as humans.
There is no question for me that LLMs lack consciousness as they are stateless.