Managing a large campaign - eviltoast

I have been running a DnD campaign which is only getting longer and more complex as time goes on. Keeping track of every bit of lore, every NPC that is relevant to the party and major events that have happened is getting increasingly difficult. I am currently mostly trying to just keep everything in mind while taking notes here and there, but I am finding linear text documents to be hard to maintain and look through.

The thing that has made me especially interested in better tools is that I have been planning to do a homebrew campaign once this one has wrapped up and I would like to start planning it out.

What tools do you use to document info on worldbuilding, story and lore?