NEW DELHI, JULY 25 -- Veteran south Indian leader Ramaswamy Venkataraman was sworn in as India's president today, replacing Zail Singh, who had become a political thorn to Prime Minister Rajiv Gandhi.

Following months of political setbacks for Gandhi, his aides have expressed hope that Venkataraman's inauguration and a Cabinet reshuffle that followed may begin to improve the government's domestic position. Meanwhile, Gandhi spoke cautiously about hopes, raised suddenly yesterday, for a settlement to one of his major problems: the civil war in neighboring Sri Lanka.

Sri Lankan officials announced yesterday that they had agreed with India on the outline of a peace accord to end the four-year insurgency by Sri Lanka's minority Tamils, and Gandhi was said to be preparing to meet with the top Tamil rebel leader to encourage him to accept the plan.

Sri Lankan President J.R. Jayewardene announced today that Gandhi would fly to Colombo Wednesday to sign the agreement, which would be implemented on Aug. 3. But Gandhi would not confirm any such plans, saying, "Let us wait and see."

Gandhi said he had not yet met with Velupillai Prabhakaran, leader of the main guerrilla group, the Liberation Tigers of Tamil Eelam. Without the group's approval, no accord could work, and political observers here have questioned how hard Gandhi is willing to push the rebels to agree.

Sri Lanka experts also cautioned that, despite Jayewardene's optimism, he faces a difficult task selling the proposed accord to his country's majority Sinhalese population. Jayewardene threatened today to dissolve Parliament if it did not approve the peace plan.

The plan would meet a central Tamil demand by linking the mainly Tamil Northern Province with the Eastern Province, which is slightly more than one-third Tamil. The regions would share a provincial assembly and chief minister. Tamil also would be recognized as a national language.

India, which has both supported the Tamil guerrillas and tried to mediate between them and Sri Lanka's government, apparently is to act as guarantor of the accord.

Gandhi's aides hope that the optimism over a settlement to the Sri Lankan war can help Gandhi domestically, especially in the south, which is dominated by Indian Tamils who back their Sri Lankan cousins.

In his first act as president, Venkataraman swore-in a top Gandhi political aide as the new minister for steel and mines. The rest of a much-discussed Cabinet shuffle, however, was largely housekeeping to replace ministers who quit to protest Gandhi's perceived failure to respond vigorously to charges of corruption that have plagued his administration in recent months.

Foreign Minister N.D. Tiwari was named to head the Finance and Commerce ministries. Gandhi himself will head the Foreign Ministry.

The scope of the changes was far more limited than Gandhi's aides had been hinting at only a week ago, leaving observers to speculate that the prime minister may be having difficulty organizing a broader Cabinet shake-up.

Speaking to journalists after today's swearing-in ceremony, Gandhi said more changes would come after the next session of Parliament was over.