In my campaign, I want to have an NPC group that is gathering intelligence by kidnapping people while they sleep, scanning their memories, and returning them before morning. I know that I could just rule that they can do this, but I wanted to see if there was a spell that could be used for the purpose.
So far, I have looked at detect thoughts and modify memory, but neither of them has the exact effect I'm looking for. A related question asked about encode thoughts suggests that spell could be used, but it's also from the Guildmaster's Guide to Ravnica (p. 47), and my campaign doesn't take place in the setting.
Are there spells, class features, or racial features that can do what I'm trying to accomplish? I would prefer to look only at PHB and XGtE, but if there are spells, class features, or racial features in other source books, I would be happy to consider those as well.