I have a lot of what I believe to be correct memories regarding this book, and it has recently been bothering me extremely that I am unable to find what the book (or book series) actually is.
From what I can remember, the main character's name was Rat (something with R I think), and he lives on a planet that is generally in like medieval/rustic society. Regions around the planet are separated by walls that make it difficult for people to explore the world. Somehow along the way, he ends up finding some sort of alien technology group that, under some sort of time constraint, is trying to come up with a solution to save the world. There was a giant library that he could use his mind to find books in. At some point in the book, he ends up getting infected by a parasite in a river that becomes symbiotic with him and enhances his senses. He then, I believe, finds a future version of himself who is in cryosleep and ends up killing him. There's a vague memory of him and some other people doing something with a bank, very hazy so I cannot remember well. They discover that it was an alien planet of some kind that he ended up travelling to and colonized humanity there.
For reference, I was reading this book in like early to mid 2010s. Fantasy/sci-fi book,it was in English and I think it was a book series.