Hong Kong (CNN Business) Traffic used to be a frequent headache for residents in Hangzhou, the eastern Chinese city that's home to Alibaba.

The metropolis of 7 million people once ranked fifth among China's most congested cities, but it has now dropped to 57th on the list.

Alibaba ( BABA ) says that's because of one of its inventions, dubbed the City Brain, which uses artificial intelligence to gather information across Hangzhou, such as video from intersection cameras and GPS data on the locations of cars and buses.

The platform analyzes the information in real time as it coordinates more than 1,000 road signals around the city with the aim of preventing or easing gridlock.

After two years of testing, the system appears to be working. Alibaba says the City Brain has shortened commutes and also helped first responders by enabling fire trucks and ambulances to halve the amount of time it takes to get to the scene of emergencies.