This is a story I read as a teenager, if I remember correctly, more than 40 years ago and I only remember vague glimpses that I find hard to put into words, so I do realise it may be a very tall order. As far as I remember, it was a novel, but not a long one. It may have been part of a series, but as far as I remember, it was readable as a stand-alone novel. I didn't entirely understand the story back then, and but I remember enjoying it and now I'd like to find it again.
The main thing I do remember was that the main character was a young woman, who loses her memory for a longish time because something like a bird(?) comes flying and inserts a silver(?) needle into her head, but she regains her memories when it is removed. The setting of the story is on the moon(?), which has been terraformed, and I seem to remember that it was slightly 'medieval' in some ways, with kings(?) and a kind of magic or similar.