Indians look forward to a new era of improved relations with the United States following what was seen here as a highly successful U.S. visit by Prime Minister Rajiv Gandhi.

But the recently retired Indian foreign secretary, Maharaj Krishna Rasgotra, cautioned against putting too much emphasis on possible arms sales that would attempt to wean India from its military supply relationship with the Soviet Union.

He said Gandhi is unlikely to enter into large-scale arms purchases that would jeopardize New Delhi's relationship with Moscow, which is "important because the Soviet Union is an Asian power" that shares long borders with neighbors of India such as China, Iran and Afghanistan.

Rasgotra and other commentators here said Washington's arms supply relationship with Pakistan remains a major irritant between the United States and India. Gandhi, during a visit that ended Saturday, focused in his talks with the Reagan administration on what his country sees as the danger to it from a Pakistan armed with sophisticated U.S. weapons.

Even with the Pakistani cloud hanging over improved U.S.-Indian relations, Rasgotra -- who laid the groundwork for the meeting between Reagan and Gandhi -- in office seven months following the Oct. 31 assassination of his mother, Indira Gandhi -- concluded that "the visit has gone well."

Almost every event of the Gandhi trip was seen live and in color on Indian television, the first time such broad coverage of a prime minister's visit to the United States has been available here. In addition, the leading newspapers each carried four to five daily stories on the Gandhi trip, including articles on how the U.S. press treated the prime minister.

The papers have not yet made any editorial comments on the impact of the meeting between the leaders of the world's two largest democracies, which have carried on a love-hate relationship with each other for most of the past 25 years.

Rasgotra said Gandhi was attempting to head off a new round of U.S. arms sales to Pakistan following completion of the current Reagan administration commitment of $1.6 billion in credits for American weapons, including 40 F16 fighters partly paid for by Saudi Arabia. "A bigger package is bound to come," he said. India and Pakistan have fought three wars since they gained independence in 1947.

India is especially concerned that Pakistan might be able to buy the E2 Hawkeye airborne early-warning radar surveillance plane, which was used by Israel three years ago to control its jet fighters in their attack on Soviet-made Syrian MiGs. The Israelis shot down 75 MiGs in one day with help of the Hawkeye, Pentagon officials visiting here last month said.

According to U.S. and Indian sources, the Reagan administration told New Delhi that the best way to keep Hawkeyes out of Pakistan's hands is to persuade Moscow to ease its troops' pressure on the Pakistani-Afghan border and to stop its jets from attacking Pakistani border villages.

Gandhi, in a meeting with U.S. reporters here before his trip, blamed U.S. aid to Pakistan-based Afghan resistance fighters for much of the tension. Pakistan, reacting to Gandhi's attack on its arms relationship with the United States, accused India of trying "to drive a wedge" between it and Washington.

Rasgotra said the seeds for better relations between the United States and India are likely to come from an agreement allowing the sale to this country of U.S. high technology, including sophisticated computers Gandhi wants to upgrade the Indian economy. The Indians assured Reagan administration officials, including Undersecretary of Defense Fred Ikle, that they would not allow that technology, which has potential military uses, to slip into Soviet hands.

The Pentagon, moreover, sees that agreement as a way to sell India the technology to build its own high-performance weapons, thus reducing its dependence on the Soviet Union. During a visit here two weeks ago, for example, Sen. Orrin G. Hatch (R-Utah) and Assistant Undersecretary of Defense Michael E. Pillsbury brought a letter from Lockheed officials offering to help India design and build its own light combat jet fighter -- a goal defense specialists here have been aiming for with little success.