Merck KGaA, in a multi-year project to improve demand forecasts, plans to deploy sensors and algorithms throughout its supply chains for pharmaceuticals and health-care products.

The goal is to create an autonomous supply operation where computers make more decisions about allocating materials and distributing products, said Alessandro de Luca, CIO of the health care division of the company, which is based in Darmstadt, Germany, and also known as The Merck Group. It is not affiliated with Merck & Co. in Kenilworth, N.J.

Financial forecasts, including predictions for product demand, are closely watched by investors and analysts, with regulations stipulating what information companies can disclose, and how. Whether companies meet their forecasts can affect stock prices minutes after an announcement.

While The Merck Group’s AI system doesn’t forecast revenues, specifically, more accurate data about product performance will lead to better and faster planning decisions, said Mr. de Luca, who joined the company in 2011 after more than 13 years in logistics and innovation at Procter & Gamble Co. He began AI tests at The Merck Company shortly after he arrived.

Ultimately, Mr. de Luca said, he sees a supply chain that functions like a self-driving car: A system that analyzes data continuously and makes decisions on its own about speed and resources. The system would predict spikes and lulls in demand for products and suggest ways to reroute raw materials accordingly, he said. This would allow The Merck Group to respond faster to changing conditions, he said.

“The supply chain will go from very intense human interventions to very digitally interconnected,” he said.

Recent pilots show that the algorithms developed for the system are more accurate than humans in 80% of predictions, he said. Employees currently doing demand planning, he said, could “evolve” to a more strategic role orchestrating the technology and algorithms for each product line.

A dashboard built on software from FusionOps Inc. displays real-time measures of supply chain performance, down to the stock keeping unit, drawn from sensors on factory machines and data collected from the company’s SAP SE enterprise software. Engineers at The Merck Group use FusionOps algorithms that use machine learning techniques to analyze the information, factoring in external data such as weather, natural disasters, trends in patient health and even the expansion plans of pharmacies that sell The Merck Group’s products, to produce forecasts about where and how much the company’s products will be needed, he said.

A key goal is to process orders in the shortest time possible by, for example, shifting production or materials to different sites, depending on local events, he said. If a fire at a hospital destroys its drug supply or a town needs certain medical supplies after a typhoon, the system could determine the most efficient way to produce or distribute products.

Mr. de Luca plans to move the AI system beyond tests to everyday use in 2017, supporting the launch of a new product due out next year, he said, declining to identify the product.