History repeated itself in Iowa today as a presidential candidate promised Democrats here that, if elected, he would not impose an embargo on American grain exports.

But the promiser today was not President Carter, who made that pledge as a candidate in Iowa four years ago, but his Democratic challenger, Sen. Edward M. Kennedy, who has been touring the state for two days condemning Carter's decision last week to partially embargo grain sales to the Soviet Union in protest of the invasion of Afghanistan.

At a meeting this morning with about 200 Democrats in this little farm town, Kennedy raised the point again to appreciative nods from his audience. But one skeptical listener pressed the point: Where do you stand on embargoes, he asked Kennedy, and what assurances are there that you won't switch the way Carter did?

"I can say that now, and I do say, that I would not embargo grain in the future," Kennedy replied.

"I can say that as a candidate," he went on, "and you could say, 'Well, we heard a candidate say that before.' What I can say is that in 17 years in the U.S. Senate on the issues on which I have made commitments, I have kept those commitments. We haven't always been successful on some of the issues [in the Senate] . . . but when I've said something, I've meant it."

At the White House, Carter's chief spokesman offered a predictably different interpretation of the embargo dispute.

Accusing Kennedy of inconsistency, presidential press secretary Jody Powell said that a search of Kennedy's record had found "not one word of criticism" from the Massachusetts senator when former presidents Nixon and Ford imposed agricultural embargoes in 1973 and 1975.

"The conclusion is inescapable," Powell said. "He [Kennedy] has opposed the most punitive step the president ordered against the Soviet Union because he hopes to make political hay in Iowa."

Kennedy's press secretary, Thomas Southwick, retorted, "You'll never find him supporting food as a weapon. He's opposed it over the years."

Kennedy's stop at Perry was part of a 21-town salute to rural Iowa this week that will bring the candidate and his enormous traveling retinue of family (his wife, Joan, and two eldest children are with him), staff, security men, reporters and photographers sweeping from small town to small town in a mini-air force of small planes.