The Trump administration said Tuesday it is developing long-lasting medications that wean people off opioids — while slashing the odds of relapse — and overdose-reversing drugs that can compete with synthetics that kill faster than regular heroin.

About half of all patients in recovery will slip up within six months, so medications that force patients to comply with their treatment schedules will make a real difference, said Nora D. Volkow, director of the National Institute on Drug Abuse.

If scientists develop medicines that last for six months, patients only need to make a good decision twice a year, instead of taking doses every day or week.

Mr. Trump also wants to make naloxone, which can revive people who overdose, as widely available as possible, so addicted persons have the chance to get help and turn their lives around.

However, scientists said synthetic opioids like fentanyl act faster and last longer than heroin, so first responders are clamoring for better formulations of the drug to jump-start overdose victims.

“So many people are dying, there’s clearly an urgency to improve the tools that we have to help them,” Dr. Volkow said.

National Institutes of Health Director Francis Collins said the effort is part of his agency’s broader push to understand how the brain responds to pain, hoping it leads to therapies that don’t involve opioids at all.

Dr. Collins said his agency has been in contact with nearly three dozen pharmaceutical companies that are interested in partnering with NIH on a “very exciting” work plan that will allow scientists to share information and set up a clinical trial network to swiftly test out alternatives.

NIH supported efforts to develop a six-month form of buprenorphine, to treat people who are already addicted, though it would like to fund companies interested in six-month formulations of other drugs.

Dr. Collins said its plans will hinge in part on whether Congress frees up funding this week through an omnibus spending plan that calls for $6 billion to combat opioids in 2018 and 2019.

“So stay tuned,” he said.

Dr. Collins and Health and Human Services Secretary Alex Azar II touted the softer, science-driven side of the administration’s opioids strategy one day after President Trump alarmed public health experts with his push to execute drug kingpins, where allowable under current law.

Mr. Azar said Mr. Trump’s push for the ultimate penalty reflected the urgency behind efforts to stem the crisis, though cautioned it is “one portion of a comprehensive plan.”

Opioid overdoses killed 42,000 people in 2016 and showed no signs of abating last year, driven by the number of people who turned to heroin laced with powerful fentanyl after they got hooked on prescription pills.

The Energy and Commerce Committee said between 2007 and 2012, drug distributors shipped more than 780 million hydrocodone and oxycodone pills to West Virginia alone.

About 9 million opioid pills were distributed over two-year span to a single pharmacy in Kermit, West Virginia — population 406.

Acting DEA Administrator Robert W. Patterson testified Thursday he does not think that type of pill-dumping would occur again, because the mentality around the epidemic has changed and the DEA is able to process data faster.

Nearly a decade ago, the agency sifted through data on pill shipments through its Automation of Reports and Consolidated Orders System — or ARCOS — manually, resulting in months-long delays in processing the data.

Typically, it would have to catch up with problems after someone reported a potential problem.

“We were using it very much as a reactive tool,” Mr. Patterson told the commit.

Mr. Patterson said a lot has changed since then, with better communication among distributors to understand which areas are getting too many pills, plus better coordination between the DEA and federal prosecutors in the field.

And, he said, “we are proactively looking at data.”