Dye-sensitized solar cells (DSSCs) have attracted attention due to their efficiency, and researchers are exploring various techniques to enhance their performance. Graphene nanoribbons and doxorubicin with their specific structures can improve these cells' performances. This study is the first application of doxorubicin-functionalized graphene nanoribbons (DF-GNR) as an electrolyte additive in DSSCs. One of the most innovative parts of this research is applying doxorubicin as an expired medicinal drug to embrace the circular economy. The graphene-oxide nanoribbon (GONR) synthesis began with carbon nanotube oxidation, followed by GONR and doxorubicin reacting in 1-butyl 3-methyl imidazolium bromide (as a solvent and catalyst) and triphenyl phosphate to generate DF-GNR. The electrolytes were composed of various amounts of DF-GNR and ionic liquids, including 1-butyl-3-methyl imidazolium iodide and 1-ethyl-3-methyl imidazolium iodide. The results showed that adding an optimum amount of DF-GNR increased the open-circuit voltage (VOC) from 0.713 to 0.749 V, the short-circuit current density (JSC) from 8.559 to 13.781 (mA/cm2), and the DSSCs' efficiency from 4.276% (the standard cells based on a graphene-free electrolyte in which DF-GNR is not added) to 7.126%. Furthermore, density functional theory studies revealed that the adsorption of DF-GNR electrolyte additives onto the TiO2 surface induced the formation of midgap states within the electrode’s bandgap. These states facilitated electron transport by lowering the energy barrier, leading to a reduction in the bandgap caused by additive adsorption. This change also resulted in a redshift in the absorption edge and a significant enhancement in the efficiency of DSSCs.