This question already has an answer here:
I need help identifying a fantasy novel that I read in 2005. I seem to recall it was written by a male author, and I believe it was his first novel (although a trilogy was in the works).
Here is the gist of what I remember:
There was a civilization of people who had floating orb companions; these orbs were conscious beings and each person had their very own assigned orb, which could communicate telepathically with them.
I think the orbs might have had the ability to heal their companions of diseases or injuries, too.
There was a quarantined part of the city, surrounded by a giant Wall, where they kept people who had lost their orbs. I seem to recall if a person's orb was destroyed, they would become mentally unhinged (due to grief and emptiness) and eventually kill themselves. They were also a threat to others. So these damaged people were kept locked away inside the Wall.
The protagonist was a princess (or someone of noble birth) who was betrothed to somebody she didn't want to marry, of course.
Somehow she decided to "lose" or secretly disguise her orb, so she could venture into the forbidden walled portion of the city... because she was curious....
She had to quickly learn to fight & defend herself against the crazy bloodthirsty people inside.
All the quarantined people had to fend for themselves, because the people outside the Wall didn't want to take care of the sick people inside. I remember one chapter where they threw rotten food over the Wall, and watched the starving captives fight to the death over it.
At the end of the book, she had somehow managed to establish order inside the Wall, and I think she tapped into some kind of magic to cure people of their mental illness.
I believe they had also been suffering physically, as without their orbs, any injury or disease couldn't be healed and would grow worse??
So in the end, she made some kind of sacrifice to heal the people. That is all I can remember.