This manuscript proposes a novel hybrid artificial intelligence (AI) approach for a unified power quality conditioner (UPQC) designed specifically for electric vehicle charging stations (EVCSs). The aim is to integrate multiple vehicle-to-grid (V2G) functionalities, thereby mitigating the challenges associated with electric vehicle (EV) grid integration and the incorporation of distributed energy resources (DERs). The hybrid technique presented in this manuscript combines the gradient boosting decision tree (GBDT) algorithm and the jellyfish search (JS) algorithm, referred to as the GBDT–JS technique. This innovative approach involves utilizing the charging station to offer EV charging services and facilitating the discharge of EVs to the power grid. Integration of the UPQC with DERs, such as photovoltaic (PV), is implemented to decrease the power rating of converters and fulfill power demand requirements. The initial converter within the UPQC is employed to manage the direct current (DC) voltage, while the second converter oversees the power charging or discharging processes of EVs. Additionally, it mitigates the impact of battery voltage fluctuations. The UPQC with vehicle-to-grid functionality minimizes the load pressure on the grid, preventing over-current issues. The presented approach regulates the UPQC converters to mitigate power quality issues such as harmonic currents and voltage sags. Subsequently, the effectiveness of this technique is demonstrated using the MATLAB/Simulink operating platform. The evaluation of GBDT–JS performance involves a comparative analysis with existing techniques. This assessment reveals that the proposed method effectively alleviates power quality issues, specifically reducing total harmonic distortion (THD), and delivers optimal outcomes.