Based on the character of the same name from Doctor Who
Because of time travel, she grew up alongside her parents, and was their childhood best friend (they obviously did not know at this point that their best friend was their daughter)
Anyway, point is because of this, when Amy had a daughter, she named her Melody after her childhood best friend... who as it turns out was actually her daughter.
"You named your daughter... after your daughter??"
Played by Nina Toussaint-White