In 1878, Yanmei and her family came to America from the Canton District of China seeking political freedom and a better life. The nine of them gained safe passage on a steamship and her father and grandfather opened up a business in the Barbary Coast with their savings. However, the Tiandihui, led by Bo Long, were already there and expected protection money. Her father, Wei Tsen, refused to pay the money and went to Bo Long to make his own agreement. Bo Long wanted to make an example of Wei for defying him and killed him. Immediately after, one of her brothers went for revenge and killed one man and was then shot. By the end of two weeks, her five brothers had all gone for revenge and were killed, taking eight of Bo Long's men. Knowing Bo Long was angry her mother and grandfather were going to leave San Francisco. However, her mother stayed behind to pay some venders and was attacked by Bo Long's thugs. Yanmei and her grandfather found the house burned down and decided to take action. They set it up so that when they were attacked by Bo Long's men, their house exploded making the thugs believe they were dead.
As the Barbary Ghost, Yanmei sought vengeance by killing Bo Long's men. This made Bo Long fearful and he went into hiding. However, some of his thugs led Yanmei to his location and she killed his men, with Bo Long barely escaping. After questioning one of his slave girls, Yanmei learned that her mother was alive and also where Bo Long was heading. Bo Long was on a train and Yanmei sat with him and told him who she is and that she was going to kill him. He doesn't believe that she would kill him in the middle of the train but she explained that she is the Barbary Ghost. He became terrified and she shot him and then lept out of the window onto her horse. She rode off knowing that she would be needed as the Barbary Ghost elsewhere.