Israel Prime Minister Menachem Begin and Egyptian President Anwar Sadat will join President Carter at Camp David on Sept. 5 in an attempt to revive the momentum toward peace in the Middle East, the White House announced yesterday.

The U.S. initiative, which grew out of decisions by Carter and his foreign policy advisers at the Maryland mountain retreat a week ago Monday, was taken "not because the prospects for peace were so good, but because the risks [of failure] have, in fact, risen," reporters were told by a high administration official at the White House.

Administration officials made no attempt to gloss over the serious hazards involved in convening a summit meeting under these circumstances with no assurance of success. But without prompt presidential action, they said, the slowdown in momentum and the intensified polemics threatened a collapse of the peace process, with grave dangers for the Middle East and serious political and economic consequences for the world at large.

There was no claim here yesterday that either Begin or Sadat has agreed to make major changes in his existing position on the fundamental issues of the Israeli-occupied West Bank and Gaza Strip, which have frustrated the peace effort since the two leaders last met in Ismailia, Egypt, last Christmas.

The man hope is that the two leaders, in the presence of the U.S. president, will be able to agree on substantive compromises, a statement of principles or at least the framework for future negotiations. "When the top guys get together, it means a totally different ball game," said a high official.

The formal objective at Camp David, set forth in the brief announcement by White House press secretary Jody Powell, will be "to seek a framework for peace in the Middle East."

In preparation for the Camp David summit, consideration is being given to a return Middle East trip later this month by Secretary of State Cyrus R. Vance, who is to head some from the Mideast today. His separate conferences there will Begin and Sadat produced their willingness to accept the U.S. invitation.

Other options under consideration include new meetings in the United States with the Israeli and Egyptian foreign ministers, and renewed efforts in the area by special U.S. Ambassador Alfred L. Atherton Jr.

When Begin and Sadat arrived at Camp David the day after Labor Day, Carter plans to hold a separate substantive meeting alone with each one. He then hopes to arrange a face-to-face negotiating session between the two Mideast leaders without his presence, according to administration thinking. The final stage would be a joint meeting of the three leaders, probably the crucial moment in the summit sessions now expected to last at least two days and possibly more.

Officials were cautious about spelling out details of Carter's likely, role, which was described by Vance in Egypt yesterday as that of "full partner" in the negotiations. But there was little doubt that U.S. suggestions, proposals and persuasion will be necessary to break the deadlock between the two Middle East leaders.

American officials have consistently said that Sadat has been more flexible in private than in public about the minimum requirements for an Eguptian-Israeli agreement. Begin, on the other hand, reportedly has said precisely the same thing in both private and public discussions.

The U.S. hope is that Sadat will renew his flexibility in the moment of truth and that Begin, confronted with high stakes and a historic opportunity, his position in order to restart the momentum toward a negotiated peace.

To minimize the bureaucratic and political inhibitions and maximize the personal nature of the Camp David diplomacy, the United States is seeking to limit participation to Begin, Sadat and what the White House announcement called "a small number of their principal advisers." Officials said this would include Foreign Ministers Moshe Dayan of Israel and Mohammed Kamel of Egypt and probably the two defense ministers, Ezer Weizman and Gen. Mohammed Gamassi, respectively.

Administration officials said that early indications from the Middle East were that both the Israeli and Egyptian leaders were quite "positive" in their reactions toward the Camp David meeting. The slide of the peace negotiations in the three weeks since the Leeds Castle talks of foreign ministers brought the possibility of failure, with a resulting blow to political prestige and popular hope, in both camps.

Beyond the personal stakes for the leaders involved, the collapse of peace efforts would threaten another Arab-Israeli war, massive radicalization of the Arab world and the reentry of the Soviet Union to a key role in Egypt and the region at large, in the White House view. Carter can be expected to point out the dangers in forceful terms when Begin and Sadat go to Camp David.

A high-level official who briefed reporters on condition that his name not be used said the United States has "no illusions" that the Camp David meeting can itself produce a settlement. But he said it can help a great deal in surfacing existing areas of agreement produced by Carter's efforts to encourage a comprehensive peace settlement and in narrowing remaining differences.

The personal contact, the official said, can "encourage the parties to resume more direct negotiations themselves" and "contribute to removal of the obstacles" that have blocked the movement toward peace. CAPTION: Picture 1, Prime Minister Begin: "a vote of thanks" to Carter, UPI; Picture 2, JODY POWELL, . . . "framework for peace" sought