Around the time Mr. Mattis wrote his memo to Mr. Trump, thousands of Google employees were protesting their company’s involvement in Project Maven. After the protests became public, Google withdrew from the project.

The protests might have been a surprise to Pentagon officials, since big tech companies have been defense contractors for as long as there has been a Silicon Valley. And there is some irony in any industry reluctance to work with the military on A.I., given that research competitions sponsored by an arm of the Defense Department, called Darpa, jump-started work on the technology that goes into the autonomous vehicles many tech companies are now trying to commercialize.

But in the eyes of some researchers, creating robotic vehicles and developing robotic weapons are very different. And they fear that autonomous weapons pose an unusual threat to humans.

“This is a unique moment, with so much activism coming out of Silicon Valley,” said Elsa Kania, an adjunct fellow at the Center for a New American Security, a think tank that explores policy related to national security and defense. “Some of it is informed by the political situation, but it also reflects deep concern over the militarization of these technologies as well as their application to surveillance.”

The Joint Artificial Intelligence Center, officials hope, will help close that gap.

“One of our greatest national strengths is the innovation and talent found in our private sector and academic institutions, enabled by free and open society,” Brendan McCord, a former Navy submarine officer and an A.I. start-up veteran who will lead the center, said during a public meeting in Silicon Valley last month. “The JAIC will help evolve our partnerships with industry, academia, allies.”

The center, he added, will work with “traditional and nontraditional innovators alike,” meaning longtime government contractors like Lockheed Martin as well as newer Silicon Valley companies. The Pentagon has worked with more than 20 companies on Project Maven so far, but it hopes to expand this work and overcome the reluctance among workers.

This summer, a Pentagon researcher worked alongside a small but influential Silicon Valley artificial intelligence lab, Fast.ai, on a public effort to build technology capable of accelerating the development of A.I. systems.