To hit the 4,767 threshold, you need a balance of flat mana bonuses and scaling upgrades. Neutral (Mercenary is best for precise control).
research or specific faction upgrades. Since building counts affect mana (via the Fairy heritage and specific upgrades), you will need to "buy 1" at a time as you get close. The "Standard" Method (Early Game) Select Fairy Faction. Purchase Fairy Heritage: mana matrix realm grinder guide