In The Fellowship of the Ring, Book II, Chapter 2 "The Council of Elrond", Gandalf tells of his search for information.
Gandalf told how he and Aragorn had long searched for Gollum to interrogate him about how he gain Bilbo's ring and eventually despaired of ever finding him.
...And then in in my despair I thought again of a test that might make the finding of Gollum unneeded. The ring itself might tell if it were the One. The memory of words at the Council came back to me: words of Saruman. half-heeded at the time. I heard them now clearly in my heart.
"The Nine, the Seven, and the Three," he said, "Had each their proper gem. Not so the One. It was round and unadorned, as it were one of the lesser rings; but its maker set marks upon it that the skilled, maybe, could still see and read."
What those marks were he had not said. Who now would know? The maker. And Saruman? But great though his lore may be, it must have a source. What hand save Sauron's ever held this thing, ere it was lost? The hand of Isildur alone.
With that thought, I forsook the chase and passed swiftly to Gondor...And Boromir, there lies in Minas Tirith still, unread, I guess, by any save Saruman and myself since the kings failed, a scroll that Isildur made himself...
And that scroll had the description of the One Ring - and a transcription or tracing of its inscription - that Gandalf sought.
So that is what Gandalf came to the archives at Minas Tirith to find: any record or description of the One Ring which Isildur might have left in Gondor. Gandalf used logic to deduce the only method and place where Saruman could have learned what the One Ring looked like.