The inner circle drew comfortably around President Carter three weeks ago, a half dozen advisers sinking into the sofa and easy chairs of his small study for what proved to be an unusual session of brainstorming.

They were there, officially, to decide what Carter should say in his State of the Union address.

They wound up, in fact, poring over just what it was they had been doing for the past two years -- in search of, at long last, a theme for the Carter presidency.

It was here that the "new foundation" was born. More or less. Nobody is sure that anybody in the room actually said "new foundation" back on that cold, gray afternoon, just two days before Carter was to leave for the Guadaloupe summit. But everyone is sure that it what they eventually came around to talking about.

New Foundation. As the Carter advisers came to see it, the theme stands for a new approach to today's problems. A new way to taking a longrange look at what is wrong and anew way of solving things on a long-range basis -- heavy on concept but spare on promises.

New Foundation. The Carter advisers hope it will take its place alongside the New Deal, the New Frontier, the Great Society and the New Federalism.

New Foundations. Not since Howard R. Hughes designed that cantilevered strapless superstructure for the formidable Jane Russell has the term taken on such importance in conceptual reform.

It may eventually turn out that the process of putting together this State of the Union address proved more beneficial for the president and his advisers than the final message was for the nation.

That session in Carter's study took on a dynamic all its own. As the president and his men talked, the two years of the Carter presidency passed in review. They were looking for a theme -- a way of telling the country about where Jimmy Carter would be taking them. But in the process they learned a lot about where they had been.

The president, sitting behind his desk and wearing his suit jacket, spoke at length as those around him listened and took notes. Among the scribblers: Vice President Mondale, Hamilton Jordan, Stuart Eizenstat, Jerry Rafshoon and executive speech-writer Bernard Aronson.

"It was a monologue -- almost stream-of-consciousness," recalled one who was there. Carter talked of his view of the world and the times. He talked about his feeling that problems are so much more difficult now than before. They are different: more and more complex. Yet politicians seem to be trying to solve them in traditional ways. He talked about how today's problems require changes in attitude on the part of the public. How people must be willing to tackle an energy crisis before the lines form and the pumps run dry.How inflation must be dealt with through restraint, but not controls.

He talked about how it is hard to lead in these times -- that a president cannot lead by executive fiat, and that these are times when society is suspicious of power. Then he talked about how America's global role would come not from raw power, but from subtle leadership.

Cater said the nation is on "the crest of a wave."

The session moved through the uplift of optimism, as often happens when presidents and their advisers sit to review how they are doing.

Mondale emphasized that the theme they were looking for was not just about the future of the Carter presidency, but one that summarized what had been the approach in the past.

They began reviewing what had been done. An energy policy. Reorganization of government. Efforts to control inflation without mandatory controls. Pushing human rights in international affairs.

Eizenstat said that what the administration was doing were not the sort of things that would yield immediate results, but were the underpinnings of an approach to be felt 10 or 12 years from now.

Some say Eizenstat used the word foundation; others don't recall that. But the dialogue shifted to center around this theme -- with a brief digression when Hamilton Jordan offered the political observation that "Getting results in 10 or 12 years won't help us now.... Can't we come up with something that will get us some good results for 1980?

Carter went into that meeting knowing basically what he wanted for his State of the Union address and what he did not. In October, Rafshoon, Carter's media adviser, gave him a memo on the choices he had for his then-distant address.

Rafshoon said Carter could have a message that: (1) would be clear in tone and theme but limited in substance -- he suggested SALT at the foreign topic and inflation as the domestic one; or (2) would be broadened into the usual grocery list of programs the administration intended to push in 1979.

Carter answered that there was really no choice -- especially as Rafshoon had weighted the selections. The president opted for the limited verson. He said he wanted the international theme to be peace, although sprinkled liberally with SALT; a second theme would be the economy; a third would be government.

By the time of that Jan. 2 meeting, an intitial draft had been prepared. But Carter did not care for it, according to several sources, which was why the discussion quickly turned to themes.

The meeting in the study concluded with Rafshoon saying he would draft a memo summarizing what had occurred. Back in hs office, Rafshoon talked with other adviser and worked on what had been said: new era, new stability, new era of stability... But they kept coming back to that thought Eizenstat had expressed about how Carter had been laying foundations for a new way of dealing with things. Rafshoom wrote a memo to the president spelling out the "new foundation" theme and suggesting outlines for how it could be applied to the ceonomy, government and foreign policy.

The next day, in a meeting in the Oval Office attended by most of the same advisrers, Carter gave his approval. He told his aides to work on the speech via Mondale, and then took off for a week of meetings and a vacation in Guadaloupe.

One week an several drafts later, the impact of a new, unofficial adviser was felt. Pollster Patrick Caddell, non-staff adviser on public opinion for the Carter White House, sent over new figures from a poll done for a commercial client.

The poll showed Carter to be suffering from two problems more than the rest: public confidence in the economy seemed genuinely shaken (people thought prices were ising twice as fast as they are), and trust was low in all leaders -- the president, Congress, businessmen. and labor.

A section was added to the economy portion of the speech to emphasize "confidence." And the section on why people can have greater trust in their government was expanded.

There were seven major drafts -- and each, the president's advisers say, came back with Carter's extensive revritiings, additions and deletions, all done in a precise script.

So it was, last night, to modest applause, that Jimmy Carter stamped himself as the president of the new foundation. For years, in the mid-1970s, he had directed his vision mainly at getting where he wanted to go, which was the White House. And he brought himsef up from nowhere to get there.

Once in the Oval Office, he had begun to deal with problems one at a time, more like an engineer than a statesman. It has always seemed to many on the outside -- and even to some of his most senior advisers -- that Carter never had sat back and put together a clear vision of his presidency and his times, where he was going and how he would get there.

"People may quarrel with the slogan, and they may question the concept," said one who was involved in the State of the Union process.

"The New Foundation may bring on some jokes about the Macy's underwear section, and it may give the cartoonists some fun. But this president and his administration have set out a clearly defined approach to how we will work to solve the problems of the present.

"It has been, for us all, very worth-while."