What with one thing or another, the world's most populous democracy has only occasionally cut much of a figure in the American consciousness or in U.S. policy preoccupations. India is no threat and no part of our cultural heritage. It is South (as in North-South), poor and nonaligned. Any right-thinking cold warrior knows the proper focus has to be East-West in the real world, and that right-thinking nations, wherever they are, must choose sides.

For those reasons and more, the U.S.-India relationship has ranged more often than not from distant to downright hostile in the nearly 40 years since India's independence. In his memoirs, Henry Kissinger described the encounters in 1971 between Richard Nixon and Indira Gandhi as "the two most unfortunate meetings Nixon had with any foreign leader." When Mrs. Gandhi died at the hands of Sikh assassins last year, her untested 40-year-old son Rajiv succeeded as prime minister. Only a few optimists thought anything good would come of it for U.S.-Indian relations.

So how do you explain last week's extravaganza: the young prime minister's acclaimed address to a congressional joint session; the star-studded state dinner, the president proclaiming this "the year of India," the gushing accounts of how well the two leaders had "hit it off" in their talks? To begin with, you wait for the oohs and aahs to subside. You then proceed carefully -- bearing in mind the trendy and transitory impact of modern communications on American interests and concerns.

Even before the engaging young Gandhi burst upon this town, India had been looming increasingly large on our screens as entertainment ("Gandhi," "A Passage to India," "The Jewel in the Crown") and as tragedy: the mother's violent death, the Bhopal catastrophe. The "Festival of India" road show of Indian culture will be feeding the vogue. India is "in." That's a good thing; India is too big and too important to U.S. security to be as little known or cared about as it has been by most Americans.

The bad thing would be to proceed from heightened awareness of India to heightened expectations -- to engage, that is, in the popular fancy that now, somehow, this newly discovered India can be "weaned away" from the Soviet Union. To insist on applying the East-West test to a developing relationship with the government of Rajiv Gandhi is to invite failure.

With his cool, collected charm and self-confidence, Gandhi made that point clear enough while he was here. India's long frontiers with the Soviet Union, China and Pakistan will determine his policy as it did his mother's and her father's. Nonalignment and noninterference in the internal affairs of sovereign states will be his creeds.

But if a sensible awareness of the limits imposed on India by geography is taken into account, it can rightly be said that last week's public and private exchanges between U.S. and Indian leaders did much to define some opportunities for easing strains.

Gandhi chose the congressional setting to express more active interest than he has in the past in ending the brutal Soviet occupation of Afghanistan and the reestablishment of independence and "nonalignment" to that tormented land. U.S. diplomats applauded this "shift." What difference it will actually make hinges on Gandhi's willingness to work toward some way to ease the darkly distrustful state of relations between India and Pakistan.

It is one thing for Gandhi to talk of an effort to resolve the Afghan conflict. But his rule on nonintervention specifically extends to the role of Pakistan as a conduit for "covert" U.S. aid to the Afghan rebels -- a role which puts Pakistan at considerableith the Soviet Union. Hence the rationale for U.S. military aid to Pakistan.

Gandhi professes to see neither the risk nor the rationale. That is to say, he is for settling the Afghanistan war but not for continuing the pressure on the Soviet Union that might provide some incentive for settlement.

Or so it sounds now. The question is whether the relationship struck up with the Reagan administration will clear the way for something constructive later on. Gandhi conveyed an interest in acquiring U.S. military technology, and may get some. He didn't push for U.S. arms. That's just as well, given the likely congressional and/or administration reception while he remains dependent for 70 percent of his weaponry on the Soviet Union.

But his interest in military high tech reflects a longer term Indian goal. By becoming increasingly its own arms supplier, India lightens its dependence on whatever outside sources.

You get the idea: the governments of two vastly different nations, making what appear to behonest efforts to work their way around their differences. Gandhi let it be known that he got what he wanted. He had arrived convinced that the nuts and bolts of aid and trade and even policy issues are of no relevance "without basic understanding." He left saying that's what was achieved, which is a lot more than could be said for the meeting his mother had with another American president in another time.