Most dyes present in wastewater from the textile industry exhibit toxicity and are resistant to biodegradation. Hence, the imperative arises for the environmentally significant elimination of textile dye by utilising agricultural waste. The achievement of this objective can be facilitated through the utilisation of the adsorption mechanism, which entails the passive absorption of pollutants using biochar. In this study, we compare the efficacy of the response surface methodology (RSM), the artificial neural network (ANN), the k-nearest neighbour (kNN), and adaptive neuro-fuzzy inference system (ANFIS) in removing crystal violet (CV) from wastewater. The characterisation of biochar is carried out by scanning electron microscope (SEM) and Fourier transform infrared (FTIR). The impacts of the solution pH, adsorbent dosage, initial dye concentration, and temperature were investigated using a variety of models (RSM, ANN, kNN, and ANFIS). The statistical analysis of errors was conducted, resulting in a maximum removal effectiveness of 97.46% under optimised settings. These conditions included an adsorbent dose of 0.4 mg, a pH of 5, a CV concentration of 40.1 mg/L, and a temperature of 20 C-degrees. The ANN, RSM, kNN, and ANFIS models all achieved R-2 0.9685, 0.9618, 0.9421, and 0.8823, respectively. Even though all models showed accuracy in predicting the removal of CV dye, it was observed that the ANN model exhibited greater accuracy compared to the other models.