This manuscript presents a reinforcement learning (RL) agent method to optimize the geometry of a coaxial magnetic gear using a 2D finite element magnetic (FEM) simulation. The proposed optimization algorithm aims to improve the maximum torque within given boundaries of the magnetic gear geometry by adjusting parameterized radii. A linear actor–critic gradient algorithm is implemented, where the actor learns a policy to adjust and discover the values of five geometric parameters of the magnetic gear model, and the critic evaluates the performance of the resulting designs. The RL agent interacts with an environment integrated with a 2D FEM simulation, which provides feedback by calculating the total torque of the new geometry discovered. The optimization algorithm uses a greedy exploration method that uses the total torque as a reward system, which the RL agent aims to maximize. The results obtained for the magnetic gear optimization demonstrate the effectiveness of the proposed RL algorithm, which can be applied to automate multiparameter geometric optimization using artificial intelligence systems.