President Reagan briefly visited a somber and subdued Indian Embassy yesterday to convey personal condolences on the death of Prime Minister Indira Gandhi, telling Indian Ambassador K. Shankar Bajpai that "no words can express" his feelings.

During his five-minute visit to the embassy on Massachusetts Avenue NW shortly after 10 a.m., the president was ushered into a first-floor reception room where he was the first to sign a condolence book, which sat next to a framed photograph of Gandhi on a table draped in black cloth.

As Reagan sat at the table signing the book, a hush fell on the group of embassy personnel who met the president and his party, which included Secretary of State George P. Shultz and White House chief of staff James A. Baker. The only sound was a ringing telephone that went unanswered in an upstairs office.

After speaking briefly with the ambassador, the president left. Afterward, Bajpai, who appeared shaken and tired, said that Gandhi's assassination "is a terrible loss in terms of leadership and personality. And it's going to be hard to replace her. It's also a great shock for the people of India that she should have been shot like this. The damage to the psyche is going to take some time to overcome."

Bajpai, a thickset, soft-spoken man, said he learned of Gandhi's assassination when he was called by an embassy employe late Tuesday night. He had been up most of the night and had already given several television interviews.

Early yesterday morning the embassy's telephone was ringing constantly as grim-faced officials came in with attache cases and newspapers. An official told staff members to put signs on the front and delivery doors saying the embassy would be closed for the day. Security guards at the door eagerly read a final edition of The Washington Post with details of the bloody assassination just outside Gandhi's home.

"It's the worst for the country," said one embassy staffer when asked how he felt. "But this shows her bravery. Despite what was happening, she kept Sikhs in her security guard. That shows her fearlessness and her courage."

Gandhi recently had received assassination threats.

"The country is a democracy. They will choose another man," the embassy employe said.

About 9:20 a.m. three men rushed in the front door and identified themselves as U.S. Secret Service to the official in charge. Ambassador Bajpai, who was out of the embassy giving an interview to a cable television network, was called and informed of the president's impending visit. At the embassy, quick but efficient preparations for the visit began.

Several employes removed a long conference table from the reception hall that would receive the president and placed it in a library across the hall. A small table covered with a black cloth was positioned in front of wall-to-ceiling frosted and stained glass windows.

An embassy employe stood on a chair in the lobby and removed the black-and-white photograph of Indira Gandhi. The employe wore a maroon turban and was unshaven, the distinguishing marks of a Sikh. He placed the photograph on a windowsill in the reception room next to the small table. Another portrait of the slain prime minister was placed on the table. An older embassy employe brought in newly bought flowers, but there was no time to place them on the table before the president arrived.

There were no tears, but the mood of those at the embassy was of quiet shock. Some were apprehensive at what might happen next.

"I'm mostly concerned, since this is a violent act, to not let it divide the community here," said Satish Survanshi, an investment broker who has been in the United States for 12 years. He said he and other Indian Americans want "to try to contain any racial tensions here, . . . to make sure we don't create any ill will toward the Sikh community."

Survanshi said his wife's parents' home was burned in the violence that followed Mohandas K. (Mahatma) Gandhi's assassination in l948 because they belonged to the same caste as the assassin. He said he hoped this kind of retaliation would not be repeated now against Sikhs.

Survanshi and several other local Indians had come to the embassy to convey their sympathy to the ambassador and were milling about in the lobby, where a painting of Mahatma Gandhi hangs on one wall and a large photograph of the country's first prime minister, Jawaharlal Nehru, Indira Gandhi's father, graces another.

Shultz had arrived at the embassy about 15 minutes before President Reagan. He and the ambassador sat and talked quietly on a yellow sofa in the reception room while they waited for the president. After the president left Shultz and Baker signed the book.

Only a British television crew, filming for Indian television, was permitted to record the president as he signed the condolence book.

Next to his signature, President Reagan wrote, "May I offer my deepest sympathy to the people of India on this sad day. The world has suffered a great loss. To our friends in India: accept our pledge of continued friendship as we share your sorrow."

Throughout the day people entered to sign the condolence book as the Indian flag flew at half staff. Many people sent flowers. And the shock began to turn to sorrow. An embassy employe sitting at a desk in the library answered a call, then began to sob quietly.