There’s a concept in Hinduism called the atman. You might find this interesting. It says that you are not the mind or the body, you are the spirit, and consciousness is a level on top of the spirit. https://iskconeducationalservices.org/HoH/concepts/key-concepts/atman-the-self/
The given set of memories that determines this unique consciousness is powered by one’s karama