Memory worm

A memory worm was an alien worm that could remove the memories of those it touched.

Biology
A memory worm was covered with a substance that could remove a short period of memory from any being who came in direct contact with it. The substance was also in the worm's fangs; if a worm bit an individual, the individual could lose decades worth of memories. (TV: The Snowmen)

Exactly how much memory is deleted appears to vary; Strax appears to lose only a few minutes (TV: The Snowmen), whereas the Doctor and Clara Oswald (or, at least, the Doctor) appears to have hours, if not days worth of memories deleted. (TV: Time Heist)

It appears not all memory worms are prone to biting, as the Doctor holds one up to his head for a period of time, and allows Clara and his other companions to touch worms without apparent concern for being bit.(TV: Time Heist)

History
A memory worm was in the possession of the Eleventh Doctor in 1892 London. He intended to use it to wipe Clara Oswin Oswald's memory of meeting him. However, his cohort Strax neglected to wear protective gauntlets while handling the worm, losing both his memory and the worm twice. Afterwards, Clara convinced the Doctor not to use the worm on her, as she needed to retain the memory of how to avoid conjuring the alien snowmen.

The memory worm was later recovered and used by the Doctor as part of a trap; the Doctor hid the worm inside a modern lunchbox, and gave it to Walter Simeon. The worm bit Simeon, causing him to lose the memories of his entire adult life. (TV: The Snowmen)

The Twelfth Doctor, Clara Oswald and Saibra used memory worms to wipe their memories as part of a heist of the Bank of Karabraxos. The Doctor later had his memory restored by The Teller. (TV: Time Heist)