"After losing in the first round in Monte Carlo, I was seriously considering quitting tennis for good," Medvedev said.
"With these thoughts I walked into a night club where I met Agassi and Andre gave me dozens of valuable lessons and was able to convince me to keep on playing.
"It was very important to me to know what he had felt when he dropped to the bottom of professional tennis, but then was able to get back to the top."
The Ukranian, who turns 26 on Friday, was ranked as high as number four in 1994 but four years later he had slipped out of the top 100.
Last summer, after many thought his career was all but finished, Medvedev reached the final at Roland Garros where he lost to Agassi in a five-set match after taking a two-set lead.
Medvedev also credits last year's turnaround to sorting out his personal life with German tennis number one Anke Huber. But the liaison did not last.
"Last year our romance reached a new height. I even gave Anke a new ring, not as an engagement ring but rather as a symbol of making peace with her," he said.
"But last autumn we broke off again."
Medvedev said he had changed his attitude towards playing in the Olympic tennis tournament. Four years ago, he turned down a spot on the Ukrainian Olympic team.
"I didn't feel like killing myself for a non-prestigious medal in tennis," he said.
This year, Medvedev said he was hoping to be fit for Sydney after missing this week's US Open with a leg injury.
"I'm ready to sacrifice a Grand Slam tournament so I can better prepare myself for Sydney," he said.
"No matter what they say about tennis as an Olympic sport, to win the Olympic title there is 100 times more important than winning any other professional tennis tournament." - Reuters