Galega officinalis products have been used for the control of diabetes (type 2) across the world. Experimental and clinical evaluations of galegine substance produced by a medicinal plant (Galega officinalis) provided the pharmacological and chemical basis for metformin discovery which was confirmed for diabetes therapy. In this paper, the molecularly imprinted polymer (MIP) was synthesized for galegine, using galegine as a template molecule, methacrylic acid (MAA) as a functional monomer, ethylene glycol dimethacrylate (EGDMA) as a cross-linker, azobisisobutyronitrile (AIBN) as a reaction initiator, and acetonitrile as a solvent. e assisted functional groups, morphology, topographic image of surface, and crystalline structure of synthesized MIP were characterized by FT-IR spectroscopy, field emission scanning electron microscopy (FE-SEM), atomic force microscopy (AFM) images, and XRD diffraction pattern techniques, respectively. Also, the performance of the mentioned electrode was quantified and qualified by the differential pulse voltammetry technique (DPV). e galegine amount was determined with the polarographic technique. In this research, the galegine extraction conditions were optimized and graphene nanoparticles were used to increase the adsorption. In addition, different parameters affecting extraction were investigated such as MIP adsorbent amount, pH of solution, effect of the surfactant, and ionic compound to achieve high recovery percent. e recovery percent, limit of detection (LOD), limit of quantification (LOQ), and relative standard deviation (RSD %) were 4.101 μg·mL − 1 , 12.427 μg·mL − 1 , and 1.199% (n = 3), respectively. e results show that the prepared MIP can be used as an effective and inexpensive adsorbent for preconcentration and galegine extraction from a natural sample. It is noteworthy that this developed method was used successfully to determine galegine extracted from Galega officinalis L.