This document discusses an adaptive method for improving power quality by minimizing harmonics in electric power systems, utilizing shunt active power filters (SAPF) and artificial intelligence techniques. The paper employs instantaneous power theory (p-q theory) and comparison of current distortion levels achieved with a PI controller and an artificial neural network (ANN). Simulations conducted in MATLAB/Simulink demonstrate the effectiveness of the proposed method in reducing total harmonic distortion in systems with nonlinear loads.