After seven weeks of intense political negotiations, five of Italy's six major parties have agreed to form a new cabinet that will give the country its first government with formal Communist support in 31 years.

At a day-long meeting here yesterday, the ruling Christian Democrats, the Communists and there smaller parties initialed a new agreement that gives Premier-designate Giulio Andreotti a green light to form a new Christian Democrat minority government to replace the one that resigned Jan. 16.

While the agreement does not give the Communists, who have the second biggest bloc of seats in parliament, any cabinet positions, it does give them increased say in policy-making and in monitoring the government's performance - more formal power than at any time since 1947.

The agreement in Italy comes only a few days before elections next Sunday in France, where a coalition of Socialists and Communists is given a good chance of winning a majority in the National Assembly.

The new agreement reached yesterday in Italy could be seen as a set-back for U.S. policy. A controversial State Department declaration last Jan. 12 said the United States was not only opposed to participation by the Communists in a future Italian cabinet but also wanted to see a reduction in the Communists' influence here.

The outcome of yesterday's negotiations here was widely regarded as a victory for the powerful Communist Party which, after an initially demanding Cabinet posts, made "explicit and recognized" participation in a voting majority its bottom-line request for its continued government support.

The Communists brought down Andreotti's earlier 17-month old government in January with a request for its continued government support.

The Communists brought down Andreotti's overnment in January with a request for full government partnership. Since the summer of 1976 Western Europe's most powerful Marxist party and five other parties had given crucial parliamentary backing to a Christian Democratic party too weak to form a majority alone.

In early December the Communists, who have had trouble selling their policy of cooperation to their rank and file, decided that their rank and file, decided that their continued support deserved a higher price.

The Communists' victorious bid for a greater political role here represented a defeat for a group of about 100 Christian democratic members of parliament who vigorously opposed any concessions.

Some observers, however, praised the leadership of the Christian Democratic Party for pushing a compromise settlement through over the objections of a large group of younger party leaders while at the same time keeping the Communists out of the cabinet.

Top Christian Democrats were able to do this by persuading their critics that Communist support is necessary to solve Italy's current problem but that the arrangement is only temporary and subject to change after presidential elections in December. After a new president is elected, indirectly, by the Italian parliament, the government in office normally offers its resignation. Usually the resignation is rejected, but this need not be the case at the end of 1978.

The alternative to a negotiated settlement would have been early general elections less than two years after the last national vote. Opinion polls predicted increases for the Christian Democrats and the Communists, and losses for Italy's smaller political groups. This would have brought the country's two political rivals into even more of a confrontation.

The precise structure and composition of the new minority Christian Democratic government will be worked out during the next few days. Andreotti has to decide whether to agree to a Communist suggestion that the new Cabinet include several technicians with ties to the four parties for a vote of confidence in parliament that will support the government's bid but will not be represented in the cabinet.

What is known now is that the new government will be able to count on a majority of 569 seats out of 630 in the lower house, the Chamber of Deputies, and 299 out of 322 seats in the Senate. The parties remaining in the opposition will be - from right to left - the Neo-Fascists, the National Right, the Liberals, the Radicals and the Democratic Proletarians.

The agreement paying the way for the formation of Italy's 41st government since the fall of fascism will make the Communists responsible for drumming up support for controversial government economic and law-and-order measures among the labor unions and social classes in which they are influential.

In return, it will give them added "legitimacy," what party leader Enrico Berlinguer has called "a function of national leadership," and formalized contacts with other party leaders to monitor the implementation of policy.