This is a fairly long SF story, probably a novella. I read it in the 80's in Spanish in a multi-author collection book. It's probably much older, maybe from the sixties. I remember lots of details about the story but I can't remember the author or the title.
The title might have been "A Midnight Summer Dream", "A Long Summer's Lost Love" or something like that. I'm positive that the title included the word "Summer". Maybe I'm way off with the title and that's why I can't find any information about it.
The protagonist is a contemporary lone inventor creating a new type of radiotelescope that by his calculations should be revolutionary, but can only catch local stations. He climbs into it to see if he can find a defect, slips and falls in. The world fades around him and he finds himself to a cave in the distant future.
His mind has been projected ages into the future, and has been captured by a machine that serves as an oracle of sorts for a primitive species of human. The machine is a terminal for another larger computer that hosts an advanced mind that has gone a bit crazy, called the "Quint" or something similar. Now the machine hosts both and they compete for control.
Throughout the story we learn that the world has evolved and birds have taken control as the primordial sentient species.
The protagonist learns how to let his mind escape out of the machine into the mind of humans and to control them. He uses this to escape the terminal and physically travel in a long journey to the main computer to defeat the "Quint".
Eventually he gets there and mentally battles the "Quint" and finds the way to win and takes over the main computer. He intends to use it to help humans rebuild civilization.
He finally learns over millennia that the Quint was the fifth cycle of sanity/insanity for the other mind. The other mind's purpose was to maintain civilization but eventually would lose its sanity and let civilization decay for long periods. Any mind in his situation will go through those cycles as well, including the protagonist's. But now that there are two minds in the computer, they alternate - with the "sane" mind taking over and keeping the "crazy" one in check while it recovers. The combined. entity is able to protect civilization continuously bringing a continuous age of prosperity.