I have a very sweet 3 year old male rag doll and I adore him. However last year was difficult because I lost a baby and went into a severe depression that I am still recovering from. Thankfully my roommates stepped in and have given him the attention and affection he craves and needs. I feel awful because prior to this he has been my constant companion. I work from home and he used to follow me around all day. Now he's following my roommates all day (totally understandable). He'll meow and ask for attention and I'll pick him up and snuggle him until he's ready to be let go from the embrace. How can I rebuild my relationship with him?
You should take a step back, take a deep breath and think about what your actual goal is here.
Do you want your cat to only interact with you, follow you around all day and ignore anyone else in the house or do you want him to be happy and have relationships with the people around you?
Of course it feels a little like you betrayed your cat and are a little betrayed by him now because he chooses to follow another person around. But if you manage to view the situation from a neutral perspective your cat actually found new friends. He has not stopped interacting with you, so he is still your friend, but now you aren't his only friend.
Follow the advice given by Bella Swan and offer more interaction without forcing yourself on him. In time, you might notice that you become the best friend of your cat again, but I think it's good for him to have more than just one friend. He probably won't stop interacting with your roommates anyways, unless you force him to.
How can I rebuild my relationship with him?
I don't think your relationship is broken in any way. It changed a little, but your cat still comes to you for affection, so he still likes you.
He has developed a habit of your room mate's company, so I don't think that he will stop following them now. But you can spend more time with him. Try feeding him food yourself, playing with him, and not just for one day but continuously for a few weeks. And try to make sure that the time spent with him would be spent only between you two. No one else should interrupt either of you.