Some days the robot future feels closer than others. At the annual Google developer jamboree in California last week, the tech giant wowed the audience with the language skills of its virtual assistant software, now so fluent it can make calls without the recipient realising the voice does not belong to a human.

It’s a long way from Silicon Valley to Swansea, where less than a fortnight ago nearly 800 call centre workers were blindsided by Virgin Media’s surprise decision to pull out of Wales’s second-largest city in 2019. While Virgin did not blame the march of technology for the decision to close its Swansea base, the move is symptomatic of dramatic changes sweeping the UK customer services industry.

Carolyn Harris, the Labour MP for Swansea East, said that the loss of a prominent employer was a blow to the local economy that, over the years, has become reliant on call-centre jobs.

“I am absolutely devastated for my city,” said Harris. “There are people who have built their lives and employment with the company.”

There are currently about 6,200 customer-service centres in the UK employing nearly 1.3 million people. But that workforce is increasingly finding itself facing the vanguard of structural change in important sectors such as retail, as companies and consumers embrace the new digital technologies that firms such as Google are pioneering.

ContactBabel, the customer-service centres expert, predicts that 45,700 jobs will disappear from the sector between now and 2021. Of those, 20,000 are projected to go from the 168,000 employed to handle customer relations by high street retailers and distribution firms, as shoppers increasingly buy and interact online.

The prediction for the finance sector – which with nearly 230,000 staff is the biggest customer-service centre employer – is also grim. Nearly 13,000 jobs are expected to go as banks and insurers reconfigure their businesses. The digital revolution is also expected to affect utility companies, with 11,000 jobs expected to go as challenger brands such as Lumo offer cheaper gas and electricity deals to customers willing to manage their accounts via an app.

Last year a study by the IPPR thinktank warned that jobs generating a third of annual pay in the UK were at risk of being automated. The study said 44% of UK jobs could feasibly be automated, equating to more than 13.7 million people who together earn about £290bn. Without giving a timescale, it suggested that middle-income jobs such as call-centre staff, secretaries and factory workers were likely to bear the brunt.

Scott Huffman of Google at the I/O developer conference last week: ‘With advancements in AI … we can now create new voices in just a few weeks and are able to capture subtleties like pitch, pace, and all the pauses that convey meaning.’ Photograph: Stephen Lam/Reuters

Widespread automation could be decades away but Google’s virtual assistant is an example of a technological leap that will soon be taken for granted by consumers. “Up until now, creating a new voice took hundreds of hours in a recording studio,” said Scott Huffman, one of the Google software engineers working on the project said last week. “But with advancements in AI … we can now create new voices in just a few weeks and are able to capture subtleties like pitch, pace, and all the pauses that convey meaning.”

Last year, deputy Labour leader Tom Watson set up the Future of Work Commission to look at how the workforce would be affected by automation. “Call centres are an example of a sector that looks set to be changed dramatically by [automation] with traditional jobs potentially being lost,” he said. “The government should be thinking urgently about how we respond to these changes, especially if job losses are concentrated in particular communities or regions.”

The majority of customer-service workers are concentrated in a few hundred large operations around the country, each employing 250 staff or more. So when they close job losses are significant: Virgin’s Swansea site had 792 staff while the closure of Tesco’s Cardiff call centre in February eliminated 1,100 jobs.

“The further you get away from London, the bigger the contact centre will be because of the salary differential,” explained Steve Morrell, managing director of ContactBabel. “In the south-east they are more expensive to run, so the big ones are in Scotland, Wales and the north-east.”

Morrell said retail-related jobs were the most at risk as the cocktail of rising store costs and the growth of e-commerce triggered the closures of high-street stores and company closures and also has an impact on back office operations amid a widespread culture of cost-cutting. A factor for the whole industry would be the potential fallout from the final Brexit deal struck by the government.

“Pressure on margins has increased for many companies, with price-comparison sites adding to consumer power,” said Morrell. “The result is that retailers need to cut the cost of contact [with customers] over the next few years, with telephony seen as a higher-cost channel for them.”

Every couple of years there’s a bogeyman that’s going to take jobs, but we are not seeing it Anne-Marie Stagg, Call Centre Management Association

“The use of web chat as a relatively cheap and immediate channel will continue to grow strongly, meaning that retail contact centres could replace telephony agents with chat agents both real and virtual,” he added. “In retail, interactions are short and simple – it’s not like talking to an insurer or telecoms provider. If a process can be automated, why would they not?”

Anne-Marie Stagg, chief executive of the Call Centre Management Association, said machine-learning was the latest stick being used to beat a resilient industry.

“It’s is the current bogeyman,” said Stagg. “Every couple of years there’s a bogeyman that’s going to take jobs,but we are not seeing it. Call volumes are declining but those that come through are more complex and take longer to resolve. If there is an area finding it tough it’s retail, as the industry has been impacted by online shopping.”

She added that the digital boom had radically changed the job description, with the image of a headset-wearing phone operator now outdated as staff straddled multiple web chats, social media posts and emails, as well as answering calls. The complexity pushes up wages as employers seek multiskilled staff. “The job is getting tougher,” she said. “Businesses are having to pay more, because the work is more complicated.”

The decline of heavy industry created a gap that call-centre jobs helped to fill, but now this sector also looks vulnerable to market forces.

“I’d like to see more industry,” said Harris. “Historically Swansea and south Wales was an industrial area, with steel and copper works and the mines. We have seen a big decline in skilled manual labour [jobs] and call centres replaced that. For young people call centres has been the work that is available to them.”

The stereotyped image of a headset-wearing phone operator is now outdated as staff straddle multiple web chats, social media posts and emails, as well as answering calls. Photograph: Colin McPherson/The Guardian

A brief history of the British call centre

The birth of the modern call centre can be traced back to the 1960s and the creation of automated telephone exchanges that could handle huge call volumes.

The Birmingham Press and Mail is credited with opening the first one in 1965, according to the website Callcentrehelper. In the 70s Barclaycard and British Gas were among the early adopters of this efficient new technology.

In 1985, the entrepreneur Sir Peter Wood kickstarted the call-centre boom when he founded Direct Line, becoming the first company to sell insurance entirely over the telephone.

The industry was coming of age as the sun was setting on Britain’s coal industry, with pit closures accelerating in the 1990s. The government’s now-defunct regional development agencies offered companies inducements to set up in high-unemployment areas. A legacy of that initiative is the number of call centres now based in places such as Wales and north-east England.

By the turn of the century companies had begun to look for new ways to cut costs and the industry was gripped by the offshore bug. Customer relations suffered as calls were routed overseas when customers tried to contact the AA or even National Rail Enquiries. More recently, companies including BT and Vodafone have made a virtue of repatriating call-centre jobs.

Today the US is the biggest player in the industry, with 40,000 centres employing 6 million people.

Some of the customer tensions created by offshoring were captured in a scene from the hit 2008 film Slumdog Millionaire. When the main character, Jamal, who is a teaboy in a Mumbai call centre, is forced to answer an irate Scotswoman’s call, she berates him when he can’t pronounce the name of her home town, Kingussie.

“Where are you from?” she yells. “Abroad, I bet!” His attempt to make her believe he lives in Scotland fails when he says his address is “Loch Big Ben, next to Sean Connery’s flat”.