Throughout the Star Wars universe, the question remains whether droids are sentient beings or not. In From a Certain Point of View: Return of the Jedi, Olivia Chadha's "The Key to Remembering" posits the theory that droids' ability to retain their memories and experiences can allow them to achieve self-determination, one of the key factors of sentience. In the Star Wars comics, the Second Revelation cult consists of droids who believe they have achieved enlightenment, which they associate with the freedom to determine their own path.
Source:https://www.cbr.com/ahsoka-huyang-droid-enlightenment/