MOSCOW (AP) _ The World Bank agreed today to devote $30 million worth of its expertise to help the Soviet Union restructure its food, banking, business and social security systems in the transition to a free-market system.

Russ Cheetham, director of the World Bank's Soviet department, said most of the assistance will be distributed through individual republics.

The $30 million could last roughly two years, he said, depending on how many experts come, how long they stay and what matching funds are available from other international donors.

Negotiations with the European Community will begin immediately on coordinating use of a $500 million fund set aside for technical and development assistance to the Soviet Union, Cheetham told reporters.

Any of the 12 republics can sign the Technical Cooperation Agreement, which provides diplomatic immunity for World Bank employees.

Experts will help in fields of local interest such as energy in Kazakhstan or transportation in Moldavia.

But much of the work involves reforming systems that cross republican boundaries, such as privatization of state-owned property, changing laws that regulate business and foreign investment, streamlining the banking system.

The first experts, to arrive within 10 days, are to work on improving ''the social safety net'' so children and the elderly are assured of access to afood when controls on prices are lifted.

The second team, to arrive in November, is to focus on how to allocate housing in a country where most dwellings belong to the state.

Russian republic President Boris Yeltsin wants prices on most food items to be allowed to rise to market levels before the end of the year - though there is no promise that wages will likewise rise.

Cheetham listed cash supplements, food stamps and school lunch programs as ways to keep the needy from going hungry as the country transforms its state- controlled economy to one driven by market forces.

The 1991 Soviet grain harvest will be 30 percent smaller than last year, when corruption, confusion and waste wiped out the benefits of a near record 261-ton harvest.

The World Bank program also includes training officials and managers to deal with the reformed structures, translating, printing and distributing Western books and pamphlets on how to make cost-effective decisions.

''We are not in a situation where we are contemplating lending any money to the Soviet Union,'' Cheetham said.

''If and when they become a member (of the World Bank), and only then, will we consider lending any money to the Soviet Union.''

The Soviet Union does not meet World Bank requirements for investment and development aid, and Cheetham had no estimate of when it might be able to join.