Memory worm

A memory worm, also rendered 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 was deleted appeared to vary; Strax appeared to lose only a few minutes, (TV: The Snowmen) whereas the Twelfth Doctor, Clara Oswald and Saibra appeared to have hours, if not days, worth of memories deleted. (TV: Time Heist)

History
When River Song crossed paths in Atlantis with a version of the Tenth Doctor who was travelling with Martha Jones and hadn't met her yet, River "slapped a Memory Worm on him while [he was]n't looking" in order to make him forget her, thus preserving the timeline. She was aware that he was only slated to meet her properly during his travels with "the ginger girl". (GAME: Lost in Time)

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, enough of a loss that it allowed the Great Intelligence to possess his body through the vacancy of his mind. (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)

The Twelfth Doctor also used a memory worm to wipe the Monk's memory of a plan to depopulate Earth with a time scoop. (PROSE: The Persistence of Memory)