This Study Proposes the novel four wire UPQC topology for Non-linear load and three-phase fault compensation. The electrical power quality is affected by many factors like harmonic pollution due to non-linear loads such as large thyristor power converters, rectifiers and the voltage/current flickering due to arc furnaces and also the sag and swell creation due to the switching of the loads. To overcome the above mentioned problems use of a combined system of shunt and active series filters like Unified Power Quality Conditioner (UPQC) topology. This device contains the integration of a shunt active filter together with a series active filter in a back to back configuration to simultaneously compensate the supply voltage and the load current. Also, it is used to mitigate any type of voltage and current fluctuations and power factor correction in a power distribution network. In this study a novel design of UPQC proposed for voltage sag compensation by using Adaptive Network based fuzzy inference system (ANFIS). This proposed controller has been provided the dynamic control of shunt and series converter operation. It has the combined operations of FL and Artificial Neural Network (ANN) relative advantages and also a powerful processing tool with both advantages can be obtained by combining them together. The simulation results have verified by using MATLAB/SIMULINK environment.