It's my mother in law who is like that @familymember .... she will pull you close, then saboutage your life, then push you away .... recurrent pattern. I have learned (the long and hard way) to keep her at arm's length. I am polite with her, but a little bit formal. I will respond to what I need to, and occasionally offer her small gifts, becasue material things are a substitute for feelings and affection in her world .... so it is speaking her language if you like, and takes the edge off the fact that I have her at arm's length. If I didn't do that, there would be a constant hostile tension.
I had to make the decision whether to keep the relationship, or remove myself from it (as other people who know her have chosen to do), but there would have been too many other relationships affected, and there are aspects of knowing her that are positive .... they just need to be managed. It's superficial, but that was a situation not of my making. She is unwell in a similar way to your mother, and she has suffered traumatic life experiences which mean she has probably lived with untreated PTSD for most of her life.
Here are some articles I found that I hope are useful for you, but there are many more if you want to go looking. There is not a 'one size fits all'. There will probably be bits and pieces in different articles that you will relate to, and begin to build into your way of thinking, and your responses to other people by trial and error and by practice.
🌷 F&H
https://psychcentral.com/blog/5-ways-to-maintain-boundaries-with-difficult-people/
https://www.johnshopkinshealthreview.com/issues/spring-summer-2018/articles/how-do-i-set-healthy-boundaries-with-difficult-people
https://psychcentral.com/blog/when-people-cross-your-boundaries/