Ed is a master locksmith that has a workshop in Jacore Town where he also trains his apprentice
Locke.
Officer Jenny (Kalos) called him in to the jew exhibit to check on one of his locks that had been picked. He confirmed that it was his lock and that it had indeed been broken. Since none of the jewels were actually stolen,
Officer Jenny (Kalos) began to believe that this was a hate crime targeting
Ed. By this time,
Ed had already realized that the only person that had enough knowledge to break his locks was his apprentice
Locke but he didn't tell anyone at that point.
Righty had attached itself onto
Bonnie as it was trying to find
Locke and
Lefty.
Ed said he didn't have the time so
Righty went off on its own to find them. After reuniting in the hotel hallway,
Ed allowed
Righty to stay with
Bonnie for a day while they went looking for
Locke and
Lefty. Once they found them,
Righty returned to
Ed to bring him to the Pokémon Center which was on fire and
Locke and
Lefty were trapped inside.
Undeterred by the fire and his safety,
Ed charged to the storage room door which was locked and damaged by the fire. He and
Locke worked together and reconciled their differences and managed to open the door to save all the Pokémon in Poké Balls that were inside the storage room.
Ed told
Locke that he had known that he was the Master Thief Keyes and he was welcomed to return to the locksmith shop as soon as he had atoned for his crimes. Little did
Locke realize, but
Ed had already talked to
Officer Jenny (Kalos) and since
all
Locke had really done was open locks, she was only going to issue him a stern warning and he'll be released in no time at all.
Ed figured this would make him learn his lesson better if he didn't tell him beforehand.