On June 10, 2011, a grainy, homemade video appeared on YouTube. With the Syrian flag draped across the wall behind him, Lt. Col. Hussein Harmoush held his identification card up to the camera, then announced in Arabic that he was splitting from the Syrian army and joining the opposition forces.
The video—which showcased in real time one of the first public breaks from the Syrian regime—caught the attention of a young intern at the Carter Center, an Atlanta nonprofit founded by former President Jimmy Carter and his wife, Rosalynn.
“By the summer of 2012, there were thousands of documented defectors on YouTube,” says Chris McNaboe, now manager of the Carter Center’s Syria Mapping Project. McNaboe started painstakingly entering information gleaned from each upload into a spreadsheet. A single video could hold upwards of 70 different data points. “You could see the names of the [rebel] groups, their location, their weapons of choice, uniforms, and other symbols,” McNaboe explains.
Through a Carter Center donor, McNaboe and his boss connected with Palantir (for more, read our feature story “Palantir Connects the Dots With Big Data”), and the two organizations partnered. As Syria’s civil war and refugee crisis raged, a joint team within the two organizations plugged data from at least 3,000 YouTube videos into Palantir’s Gotham software tool. Eventually additional data sources, including news reports of government attacks on rebel-held areas, were also fed into Gotham, creating a robust, real-time map that indicated which civilian populations were getting hit hardest.
The abundance of data gave the Palantir team an idea: Why not create an early-warning system that uses pattern recognition to predict the next violent escalations? The team found that airborne “barrel bombings” by the government are harbingers of a wider attack and can increasingly determine where those follow-up attacks are likely to be. The end goal: To anticipate assaults and send aid workers and supplies where they’ll be needed most by refugees.
Today another Carter Center partner, Mercy Corps, is getting its humanitarian-aid teams up and running on the system. (The Carter Center does not have its own teams in Syria.) “We’re still at the start of this relationship,” says Karin Knox, head of Palantir’s philanthropy engineering team. “But there is a lot we can do, like triage who needs what and where.”
For more on philanthropy, watch this Fortune video:
As for Harmoush, he eventually recanted his opposition to the Syrian government, and then vanished. In war there are some mysteries even Palantir can’t solve.
A version of this article appears in the March 15, 2016 issue of Fortune with the headline “Software for Syria.”