Permanent magnets are a key technology for sustainable development. Currently, high-performance magnets used for motors and generators are based on Nd-Fe-B. To avoid rare earth shortages caused by the increased demand for electrification of transport and power generation, alternative permanent magnets with a significantly lower rare earth content are needed. Nanocomposite magnets combining magnetically hard and soft phases show excellent properties while reducing the rare-earth content. However, this requires a careful design of the magnet's nanostructure so that the exchange hardening of soft phases ensures a sufficiently high coercive field. Furthermore, the phase distribution depends on the shape of the magnetic grains. By combining fast, massively parallel micromagnetic simulations and artificial intelligence, we will optimize the nanostructure of high-performance permanent magnets to increase the energy density product and reduce the rare-earth content. An inverse neural network optimization loop with tailored optimization methods for small training sets will be developed. The optimization loop will enable application-oriented design of future permanent magnets beyond conventional design methods. A framework is developed to generate parameterizable finite element meshes and perform a large number of fast and highly efficient micromagnetic simulations, the results of which serve as training data for a neural network. A generative inverse design network is developed: Two neural networks, the predictor and the designer, cooperate in an active learning scheme to find new advantageous compositions. Higher-order learning methods are implemented and adapted for training. The design network is validated with simple, well-understood nanostructures. In a further step, we adapt the machine learning design to search for the optimal free-form distribution of hard and soft magnetic phases. We develop a generative neural network for the inverse design of high-performance, rare-earth reduced permanent magnets. Implementation of higher order methods for the neural network will enable learning with limited training data available. We will push the boundaries of nanostructural design strategies for permanent magnets towards the theoretical limit by finding the optimal material distribution. Our findings will provide new guidelines to produce competitive, eco-friendly permanent magnets for green technologies.