The gracilis is a long, slender muscle located in the medial compartment of the thigh, primarily responsible for hip adduction and knee flexion. It plays a crucial role in stabilizing the pelvis and assisting in movements that require bringing the legs together, such as crossing the legs or balancing on one foot.