Managing Relationships and Information
It sounds like this is your biggest issue, from the phrasing of the question, but there are several other associated issues that might come up. If you're worried about keeping things straight such as what NPC knows what other NPC, who likes who, who hates who, that sort of thing, then you are worried about managing relationships.
The right visual tools for this are tree structures and graph structures.
For example, if you're trying to keep track of who is who in a city watch or police force, you probably want a chief-- guy in charge at the top, people who report to him, people who report to them, etc. If it's anything like a modern hierarchy, it will end up as a tree because people only report to one other person. Each NPC name is a node, and each line from one to the other should go upward.
On the other hand, if it's a more fluid organization like politicians in a city council, there might be lots of arcs from node to node. Also, these arcs can be labeled with the really important information: A pines for B, B scorns A. C is blackmailing D about D's theft from E. All of these relations can be summed up in a word or two on the arcs.
Three ideas may end up in tension, here:
First, these little graphs probably should not have every NPC listed on them, and do not even need to be 'complete' in the mathematical sense of every node connecting to every other node. Life doesn't work like that, and neither should your notes.
Second, but sometimes, people from one group or another will have legitimate and important connections to the outside-- don't be afraid to show this.
Three, don't get caught up in modelling everything. Just model what is important. It is probably a good idea to leave areas to fill in later as your game develops. And if your setting is really complex you can make this a little meta, with a graph where organizations are the notes-- criminal underground at war with the city guard but allied with some third group, etc.
Managing Individual NPCs and Information
If you're worried about managing information specific to individual NPCs-- what they have, what they do, what they can do-- then you are no longer in the territory of relations, you're worried about individual NPCs. There is no way around this except to make a file of some sort (note card, text file, spreadsheet entry, something) about each one.
I would keep them simple, just bullet points or half sentences.
Managing Time and Information
Finally, you don't ask directly about this, but it may become a concern: Games are dynamic, and NPCs are taking actions or changing from session to session.
One piece of advice is to do whatever you decide to do, fairly quickly after each game or just before the next one, while things are fresh in your mind (or so they stay fresh in your mind.)
A second piece of advice is to use whatever graph tools you come up with to help manage this, while remembering that for the most part, the game is about the PCs, and that if the NPCs are too dynamic you run the risk of focusing on the NPCs more than the players. Yes, the mayor is probably important, but he is probably also mostly (mostly!) in something like stasis due to his opponents and responsibilities. NPCs have a certain scope, which you've mostly sketched out with your graphs. Is it realistic that each and every one of them takes note of everything the PCs do? Probably not. Keep it minimal and simple.
And third, once you do figure out how each NPC changes from session to session, you will have to figure out how to update your other representations. It could be as simple as updating your computer files or as tedious as xeroxing physical copies of your graphs or something similar.
Software Tools
If you are looking for software tools to help, what you probably want is something called a Mind Map which will help you draw the types of node-arc graphs I'm talking about, and may let you link nodes to other text files or short internal text descriptions. I don't use them myself (I lack the discipline to update them in a timely fashion) but I know many people who get great use from them. Some of these are free or effectively free, and solve most or all of the problems I describe above, including the update issues-- just save a new version after every session.