In terms of power quality, the rising number of nonlinear loads in modern use has caused warning signs for power system and power engineering professionals. Every day, utilities have to deal with harmonic distortion caused by a growing number of non-linear power electronic equipment. To keep the system's power supply in good condition, a shunt active filter is used to filter out unwanted harmonics in the signal. This study presents a practical and low-cost method for reducing harmonics and enhancing distribution network power quality by means of the use of PV-integrated Shunt Active Power Filters (SAPF). With a teaching-learning-based optimized artificial neural network controller (TLBO-ANN) and the required DC power is extracted from the PV module. SAPF's TLBO-ANN algorithms are intended to increase system performance by reducing total harmonic distortion (THD). Here, the research work was performed in three stages to mitigate grid current harmonics. The first-stage SAPF system comprises a three-prong voltage source converter and uses DC power derived from photovoltaic panels. The P&O algorithm is used to get the maximum power out of a photovoltaic array. In the second stage, the BBO algorithm is used to fine-tune a conventional PI controller, resulting in values for and that increase the controller's performance. Furthermore, it is intended to use the BBO-PI controller's input and output values as training data for the ANN controller. This ANN controller is currently being tuned with the TLBO algorithm to find optimal values for the weight and bias parameters. In the third stage, the converter in PV-SAPF will inject the active power required by the load by using active current control theory, which means the inverter of SAPF is working like DG as well as the active power filter. Employing MATLAB simulations, we concluded that the proposed method is extremely adaptable and highly efficient in lowering harmonic currents that are brought on by non-linear loads.