Drug-drug interactions (DDIs) area significant challenge in modern healthcare, especially in polypharmacy, where patients are given more than one drug at the same time. Accurate prediction of DDIs plays an important role in reducing adverse effects and improving recovery inpatients. In this study, we propose GAINET, a derivative of the graph-based neural network model enhanced with attention mechanisms, to accurately improve the prediction of drug-drug interactions. The model effectively learns interaction models by focusing on critical features in drug structures and their interactions with each other through molecular graph representations. For the performance evaluation of GAINET, which is trained on the DrugBank dataset containing 191,870 DDI examples, basic metrics such as AUC-ROC, F1 score, precision and recall are used. The obtained accuracy of 0.9050, F1 score of 0.9096 and AUC-ROC of 0.9505 indicate that GAINET outperforms many state-of-the-art models and has good generalization ability even on previously untested data. Moreover, the molecular attention mechanism enables interpretable predictions by highlighting the interaction-specific molecular substructures. All these findings indicate that GAINET, our proposed model for DDI prediction, can serve as a valuable and useful tool and advance the development of reliable pharmacological treatments.