It would certainly seem that Rahim Khan's primary function is as a peaceful liaison between Baba and Amir and, later, to reconnect Hassan's son with Amir. Unlike Baba, Rahim never loses faith in Amir's possibilities as both a writer and a man. He tries to convince Baba to be patient with his son.
"You just need to let him find his way," Rahim Khan said. (Chapter 3)
When Baba refuses to read Amir's first short story, Rahim "rescued me" and Baba "looked relieved as if he too had been rescued by Rahim Khan." When Baba and Amir are forced to leave Kabul, Rahim remains to look after Baba's home. Rahim later travels to Bamiyan to find Hassan, bringing him back so he can look after Ali's son; so Hassan can care for the house; and so they can both await Amir if he should ever decide to return. Rahim indirectly reconnects Hassan with his mother, Sanaubar, who returns to Baba's house to live out her final years in happiness with her son and grandson. Rahim makes his final push to reunite Baba's family when he assures Amir that "there is a way to be good again." Though only Rahim knows about Baba's secret--that Baba is Hassan's father--he is also confident that the young Amir who left Afghanistan will be enough like his father to accept the mission of finding Sohrab and returning him to safety. Rahim's final part of the plan--lying to Amir about the nonexistent Caldwells who he claims will take care of Sohrab--is correctly based on Rahim's faith that Amir will return to America with Hassan's son. As an intermediary, Rahim covers all the bases: trying to connect Baba and Amir, and Hassan with Amir; successfully reuniting Hassan with his mother; and, finally, bringing Sohrab and Amir together.