I posted twice about trying to make rules that actually encourage more interaction with NPCs here and here. I've used the card system outlined in those posts to generate backgrounds for some of my NPCs but never did much more with those ideas. Here's an idea for a simpler if more mechanistic method:
NPCs are Locks
Some set of topics will "open" them. Opening them will mean different things depending on who they are. A merchant could give a discount or offer black market goods. A guard allows entry into restricted areas or gives gossip on crime in the area. You get the idea.
I would keep the "keys" to three topics or less and record them along with what it unlocks in your DM notes. Something like:
Prophet of the Pot - ask about his health, ask about his sons = reveals location of a new temple risen from the sea.
You could check off each "tumbler" in your notes after players have engaged the topic. If it's been a really long time you might decide they have to start over and ask again about his sons, which makes sense if weeks and weeks have passed.
A great DM could probably do this in their head, but I'm interested in anything that can make my life as DM simpler. And if you keep in mind that you might have to talk to other NPCs to even know what the Prophet of the Pot cares about, this could give a reason for your players to interact with the folks milling about your imaginary cities.