The best lore game I played is Nier.
Drag-on Dragoon was release in 2003, later titled Drakengard, was created by Yoko Taro. Later it was followed by a sequel, then pre-sequel, and a lot of spin-offs.
And Nier started as a spin-off from this Drakengard series, later getting a series of it's own. From this small description itself we can say for sure that this one's a lore-rich game!
But don't worry you can enjoy Nier as it's own, but the world building is so rich that we need to have atleast the basic idea regarding it's history and lore to spot all the references and make all the connections.
Welp I'm not getting into it too much, inorder to avoid spoiling the fun incase if you haven't already experienced the world of this franchise.
Also apart from it's rich history and story, almost everything about it is simply marvelous... The graphics, art style, gameplay, those perfect soundtracks, characters...
Another awesome thing is that, we get to experience and learn different characters from their own perspective, like there are different routes for each character, where we can see them express their feelings and thoughts regarding the situation/events, which is an experience in itself and it allows us to immerse even further into this world and it's story.
It's one of my favourite game and is obviously a total masterpiece.
Dayum... I miss those good old days! Bye lemme go cry in the corner now, while reminiscing those times. Before I finish this off, here catch some awesome artworks from Nier!