The library is where you assign various heroes you have and also your guild allies to gain bonus stats in battle.
Keep in mind that the bonuses you get are stacked and is cumulative. There is 3 levels for each union. You can check out the full graph here.
Assigning Your Mercenaries
At the bottom of the Library section, you are able to assign your own heroes to help your friends or guild mates by slotting in various heroes of each element. Just put in 5 of your strongest heroes for each element and you will be good to go.
When one of your heroes is used by your guild mates or friends, it will say “Fighting beside [friend/guildmate name] on the battlefield”. If not, it will just say, “Relaxing at the Library”.