President Reagan, recalling the attempt on his life nearly two years ago and the "brave efforts" of two Secret Service agents who protected him, paid tribute yesterday to 13 federal law enforcement officers killed in the line of duty in the last six months.

"Two years ago, I saw close up, very close up, two profiles of courage," Reagan said at a memorial service in the Justice Department's Great Hall. Among others, the service was attended by about 50 relatives of the federal agents who died. "Were it not for the brave efforts of Secret Service agents Jerry Parr and Tim McCarthy, I might not be speaking to you here today," the president said.

Parr shoved Reagan into his limousine and McCarthy was shot in the abdomen when John W. Hinckley Jr. fired at the president outside the Washington Hilton Hotel on March 31, 1981. Police officer Thomas Delahanty, presidential press secretary James Brady and Reagan also were injured in the attack.

"Jerry Parr realized before I did what was going on and literally threw me into a waiting car," Reagan said. "And Tim McCarthy deliberately took a bullet that was intended for me."

Reagan eulogized the 13 federal agents killed in the line of duty, including four FBI agents who died in a plane crash outside Cincinnati Dec. 16 and three Secret Service agents who died March 5 in an auto accident in California during the visit of Queen Elizabeth II.

He also paid tribute posthumously to two Bureau of Prisons employes, a Drug Enforcement Administration agent, a Bureau of Alcohol, Tobacco and Firearms agent and two federal marshals.

" . . . Each of these men died as few men do--a hero," Reagan said.

After the ceremony, Reagan spoke privately to the families of the men.

Later this week the White House plans to send Congress a new, broader package of anti-crime proposals that are similar to those that met with partial success on Capitol Hill last year. Although the details of the package are still being worked out, the president and Attorney General William French Smith briefed congressional leaders on it yesterday.

Senate Judiciary Chairman Strom Thurmond (R-S.C.) said after the briefing that Reagan considers the package "very urgent." Among other things, Reagan is expected to propose restrictions on the use of the "insanity defense." Hinckley was found not guilty by reason of insanity in the shooting of the president.

Reagan is also expected to seek changes in the "exclusionary rule," which prohibits the use of illegally obtained evidence in court. Reagan has complained that the rule allows criminals to escape prosecution on a technicality.

In the ceremony yesterday Reagan recalled that as governor of California he had been assigned Secret Service agents. He said he was at his ranch with the agents, target shooting at tin cans, when one agent explained to him that agents do not crouch when shooting, as Reagan thought was proper.

"Governor," Reagan said he was told, "if we're ever shooting at anyone, we're between him and his target."

"It was quite an awakening," the president said yesterday.