During the early 70s, in the wealthy commuter backwater of West Byfleet in Surrey, a small but rather remarkable experiment took place. In the potting shed of a house called Firkins, a teenager named Simon Beer, using bits of radios and pieces of pink and green cardboard, built a series of electrical meters for measuring public opinion. His concept - users of his meters would turn a dial to indicate how happy or unhappy they were with any political proposal - was strange and ambitious enough. And it worked. Yet what was even more jolting was his intended market: not Britain, but Chile.

Unlike West Byfleet, Chile was in revolutionary ferment. In the capital Santiago, the beleaguered but radical marxist government of Salvador Allende, hungry for innovations of all kinds, was employing Simon Beer's father, Stafford, to conduct a much larger technological experiment of which the meters were only a part. This was known as Project Cybersyn, and nothing like it had been tried before, or has been tried since.

Stafford Beer attempted, in his words, to "implant" an electronic "nervous system" in Chilean society. Voters, workplaces and the government were to be linked together by a new, interactive national communications network, which would transform their relationship into something profoundly more equal and responsive than before - a sort of socialist internet, decades ahead of its time.

When the Allende administration was deposed in a military coup, the 30th anniversary of which falls this Thursday, exactly how far Beer and his British and Chilean collaborators had got in constructing their hi-tech utopia was soon forgotten. In the many histories of the endlessly debated, frequently mythologised Allende period, Project Cybersyn hardly gets a footnote. Yet the personalities involved, the amount they achieved, the scheme's optimism and ambition and perhaps, in the end, its impracticality, contain important truths about the most tantalising leftwing government of the late 20th century.

Stafford Beer, who died last year, was a restless and idealistic British adventurer who had long been drawn to Chile. Part scientist, part management guru, part social and political theorist, he had grown rich but increasingly frustrated in Britain during the 50s and 60s. His ideas about the similarities between biological and man-made systems, most famously expressed in his later book, The Brain of the Firm, made him an in-demand consultant with British businesses and politicians. Yet these clients did not adopt the solutions he recommended as often as he would have liked, so Beer began taking more contracts abroad.

In the early 60s, his company did some work for the Chilean railways. Beer did not go there himself, but one of the Chileans involved, an engineering student called Fernando Flores, began reading Beer's books and was captivated by their originality and energy. By the time the Allende government was elected in 1970, a group of Beer disciples had formed in Chile. Flores became a minister in the new administration, with responsibility for nationalising great swathes of industry. As in many areas, the Allende government wanted to do things differently from traditional marxist regimes. "I was very much against the Soviet model of centralisation," says Raul Espejo, one of Flores's senior advisers and another Beer disciple. "My gut feeling was that it was unviable."

But how should the Chilean economy be run instead? By 1971, the initial euphoria of Allende's democratic, non-authoritarian revolution was beginning to fade; Flores and Espejo realised that their ministry had acquired a disorganised empire of mines and factories, some occupied by their employees, others still controlled by their original managers, few of them operating with complete efficiency. In July, they wrote to Beer for help.

They knew that he had leftwing sympathies, but also that he was very busy. "Our expectation was to hire someone from his team," says Espejo. But after getting the letter, Beer quickly grew fascinated by the Chilean situation. He decided to drop his other contracts and fly there. In West Byfleet, the reaction was mixed: "We thought, 'Stafford's going mad again,' " says Simon Beer.

When Stafford arrived in Santiago, the Chileans were more impressed. "He was huge," Espejo remembers, "and extraordinarily exuberant. From every pore of his skin you knew he was thinking big." Beer asked for a daily fee of $500 - less than he usually charged, but an enormous sum for a government being starved of US dollars by its enemies in Washington - and a constant supply of chocolate, wine and cigars.

For the next two years, as subordinates searched for these amid the food shortages, and the local press compared him to Orson Welles and Socrates, Beer worked in Chile in frenetic bursts, returning every few months to England, where a British team was also labouring over Cybersyn. What this collaboration produced was startling: a new communications system reaching the whole spindly length of Chile, from the deserts of the north to the icy grasslands of the south, carrying daily information about the output of individual factories, about the flow of important raw materials, about rates of absenteeism and other economic problems.

Until now, obtaining and processing such valuable information - even in richer, more stable countries - had taken governments at least six months. But Project Cybersyn found ways round the technical obstacles. In a forgotten warehouse, 500 telex machines were discovered which had been bought by the previous Chilean government but left unused because nobody knew what to do with them. These were distributed to factories, and linked to two control rooms in Santiago. There a small staff gathered the economic statistics as they arrived, officially at five o'clock every afternoon, and boiled them down using a single precious computer into a briefing that was dropped off daily at La Moneda, the presidential palace.

Allende himself was enthusiastic about the scheme. Beer explained it to him on scraps of paper. Allende had once been a doctor and, Beer felt, instinctively understood his notions about the biological characteristics of networks and institutions. Just as significantly, the two men shared a belief that Cybersyn was not about the government spying on and controlling people. On the contrary, it was hoped that the system would allow workers to manage, or at least take part in the management of their workplaces, and that the daily exchange of information between the shop floor and Santiago would create trust and genuine cooperation - and the combination of individual freedom and collective achievement that had always been the political holy grail for many leftwing thinkers.

It did not always work out like that. "Some people I've talked to," says Eden Miller, an American who is writing a PhD thesis partly about Cybersyn, "said it was like pulling teeth getting the factories to send these statistics." In the feverish Chile of 1972 and 1973, with its shortages and strikes and jostling government initiatives, there were often other priorities. And often the workers were not willing or able to run their plants: "The people Beer's scientists dealt with," says Miller, "were primarily management."

But there were successes. In many factories, Espejo says, "Workers started to allocate a space on their own shop floor to have the same kind of graphics that we had in Santiago." Factories used their telexes to send requests and complaints back to the government, as well as vice versa. And in October 1972, when Allende faced his biggest crisis so far, Beer's invention became vital.

Across Chile, with secret support from the CIA, conservative small businessmen went on strike. Food and fuel supplies threatened to run out. Then the government realised that Cybersyn offered a way of outflanking the strikers. The telexes could be used to obtain intelligence about where scarcities were worst, and where people were still working who could alleviate them. The control rooms in Santiago were staffed day and night. People slept in them - even government ministers. "The rooms came alive in the most extraordinary way," says Espejo. "We felt that we were in the centre of the universe." The strike failed to bring down Allende.

In some ways, this was the high point for Cybersyn. The following year, like the government in general, it began to encounter insoluble problems. By 1973, the sheer size of the project, involving somewhere between a quarter and half of the entire nationalised economy, meant that Beer's original band of disciples had been diluted by other, less idealistic scientists. There was constant friction between the two groups. Meanwhile, Beer himself started to focus on other schemes: using painters and folk singers to publicise the principles of high-tech socialism; testing his son's electrical public-opinion meters, which never actually saw service; and even organising anchovy-fishing expeditions to earn the government some desperately needed foreign currency.

All the while, the rightwing plotting against Allende grew more blatant and the economy began to suffocate as other countries, encouraged by the Americans, cut off aid and investment. Beer was accused in parts of the international press of creating a Big Brother-style system of administration in South America. "There was plenty of stress in Chile," he wrote afterwards. "I could have pulled out at any time, and often considered doing so."

In June 1973, after being advised to leave Santiago, he rented an anonymous house on the coast from a relative of Espejo. For a few weeks, he wrote and stared at the sea and travelled to government meetings under cover of darkness. On September 10, a room was measured in La Moneda for the installation of an updated Cybersyn control centre, complete with futuristic control panels in the arms of chairs and walls of winking screens. The next day, the palace was bombed by the coup's plotters. Beer was in London, lobbying for the Chilean government, when he left his final meeting before intending to fly back to Santiago and saw a newspaper billboard that read, "Allende assassinated."

The Chilean military found the Cybersyn network intact, and called in Espejo and others to explain it to them. But they found the open, egalitarian aspects of the system unattractive and destroyed it. Espejo fled. Some of his colleagues were not so lucky. Soon after the coup, Beer left West Byfleet, his wife, and most of his possessions to live in a cottage in Wales. "He had survivor guilt, unquestionably," says Simon.

Cybersyn and Stafford's subsequent, more esoteric inventions live on in obscure socialist websites and, more surprisingly, modern business school teachings about the importance of economic information and informal working practices. David Bowie, Brian Eno and Tony Blair's new head of policy, Geoff Mulgan, have all cited Beer as an influence.

But perhaps more importantly, his work in Chile affected those who participated. Espejo has made a good career since as an inter- national management consultant. He has been settled in Britain for decades. He chuckles urbanely at the mention of Pinochet's arrest in London five years ago. Yet when, after a long lunch in a pub near his home in Lincoln, I ask whether Cybersyn changed him, his playful, slightly professorial gaze turns quite serious. "Oh yes," he says. "Completely."

· Andy Beckett's book Pinochet in Piccadilly is published by Faber.