Thailands armed forces yesterday ovethrew the civilian government that they had installed in power two days short of a year ago.

The coup, which ousted Prime Minister Thanin Kravichien and his Cabinet, appeared to be bloodless. Troops armed with rifles and machine guns took up positions around government buildings and key installations. But traffic moved normally through Bangkok's streets and there was no sign of trouble.

A "Revoluntary Group" headed by Adm. Sangad Chaloryu, defense minister in Thanin's government, said it had seized power because the civilian government was "weak" and its foreign investment policies were "uncertain."

Sangad also critized Thanin's 12 year plan for returning the country to full democracy as "too slow", and announced that a general election would be held next year.

Today's coup was the seventh major shift of power in this nation of 45 million people in less than six years. Since the end of the war in Indochina 2 1/2 years ago. Thailand has become the most unstable country in Southeast Asia.

Thanin was initially reported under detention at Government House, but four hours after the coup, he left the building, apparently for home. Some reports said he would remain under house arrest.

King Bhuibol Adulyadej and Queen Sirkit, who reportedly were informed last night of the inpending coup, were declared under the "protection" of the armed forces.

A 1-to-4:30, curfew which has been in force for moe than a year was continued. A ban was also placed on gatherings of more than five people.

The military evidently moved against Thanin, a rigidly anti-Communist former SUpreme Court justice, because he had refused to comply with mounting pressure from the armed forces to get ride of at least nine of his Cabinet ministers.

The military has been especially anxious to remove Home Minister Samak Suntoravej. Samak, brash and outspoken, had fallen into particular disfavor with military officers floowoing a bomb attack on the King and queen in souther Yala Province on Sept. 22. The royal couple escaped unhurt, but 41 persons were injured in the attack.

The bombing, which took place during a ceremony at which the King and Queen were presiding, was blamed on Moslem separaties. The Moslems, ethnically different from Thailand' Buddhist majority, have been agitating for years for autonomy in the south.

THe new government was expected to introduce few major shifts in policy. "The Revolutionary Group will change as little as possible," the official announcement declared. "All military and civil-servants will continue their work and no orders are to be changed.

Today's coup was preceded by an effort to topple Thanin seven months ago. On March 26, a small band of army officers attempted to oust the civilian government and its military backers, but that effort failed and the leader, Gen. Chalard Hiranyasiri, was executed.

Thailand has been turning from one weak government to another ever since a student led revolt toppled the ruling military government in October 1973.

For three years, the country was run by a sucession of wobbly elected governments. Then on October 6, 1976, he military seized back power after students at bangkok's Thammasat University fough a bloody battle with heavily armed police.

Since then, the three dictators who ran Thailand until the 1973 revolt have returned from exile, and one of the three. Thanom Kittikachorn, has been reported involved in an effort to remove Thanin.

Many observers flet tonight that Adm. Sanged was only the nominal head of the new junta. While it was not clear where the real power lay, speculation focuses on Gen. Kriangsak Chamanan, possibly with Thanom pulling the strings.