An Operating System (OS) approach to Democracy.
A Data Science based (Operating Systems) approach for Democracy
Look at a city from an aeroplane as you come in to land. Roads, buildings and industrial complexes: it looks remarkably like a CPU chip. So where is the instruction set? Where is the operating system? In my last article, I described language as the DNA of society— the communication link between people. Today, I want to look at the operating system.
César Hidalgo makes something close to this point in his fantastic book Why Information Grows, which I highly recommend as genuinely “eye-opening.” Hidalgo asks us to understand economies through information, computation and complexity: cities accumulate human know-how, then embody it in physical products. (Google Books). An algorithm in computer science has input-processing-output. A business is pretty much the same.
Think of a city as a computational unit:
Input: raw materials.
Processing: human knowledge, labour, machinery and increasingly AI.
Output: products, services, infrastructure and knowledge.
It resembles an algorithm, and the process scales: businesses aggregate into industries, and industries into an economy. Robert Solow’s growth framework formalised something related. Output depends on capital, labour and technological productivity—K, L and A. (Nobel Prize)
K is physical capital: machinery, factories and the means of production. L is labour—with a u, the correct English spelling. That’s right, American readers: I didn’t make a spelling mistake. A represents technology or ideas. AI makes A especially interesting because, theoretically, it should multiply our ability to generate, distribute and apply ideas.
So if we are prepared to model economic growth scientifically, why do we remain so imprecise about social policy?
Politics Has an Accountability Problem
For all the fantastic work supposedly undertaken by policymakers, “normal citizens” like me and you might reasonably conclude that they are coming up short. Over and over again. They are living in the “Stone Age” when it comes to technology. I don’t consider most “politicians” to have really any academic merit. Most of them won’t make the cut in any serious discipline – physics, mathematics, biology. Imagine a nuclear physicist from GE or an Aeronautics engineer from Rolls Royce becoming a Prime Minister. The field doesn’t attract the best talent. Homelessness, plastic pollution and crime remain major problems. People struggle to obtain food and medicine. Yet incredible resources go into war. Because theatrics > actual output.
Am I making this up? No. Consider cobalt mining in the Congo. In 2016, sales were estimated at $2.6 billion, yet a 2025 analysis reports that only around 3% returned to the country’s economy. Adult miners earned as little as $2.15 a day producing minerals for our electronics. (Think Global Health) Read the Congo mining analysis.
Contrast Afghanistan. Brown University estimates $2.313 trillion in US spending associated with the Afghanistan/Pakistan war zone through 2022, excluding some future veterans’ care and interest. (Costs of War) The cost was also reported by the BBC and Brown University.
Whether intervention was justified at its beginning is a separate question. But after twenty years, trillions of dollars and the Taliban’s return to power, citizens are entitled to ask: what objective was being optimised, and where was the stop condition? The graveyard for the Soviet Union almost became the graveyard for the US. If history taught anything, you simply don’t mess with the Afghans.
Give Leaders Invisible “Handcuffs”
It sounds harsh. Handcuffs? Why not “guidance”, a “framework”, “recommendations”. Because we tried, and it didn’t work.
So, I think democracy needs more handcuffs—not handcuffs that put politicians in jail cells, but constraints that make them work for the public rather than merely in the country’s name.
No other discipline allows so much leeway. If a business leader destroys value, the board shows them the door—Steve Jobs or Average Joe. A catastrophic surgical mistake can bring lawsuits and dismissal; a lawyer repeatedly making arguments outside the bounds of the law can lose a license.
Yet governments can make decisions affecting millions of lives, consume extraordinary quantities of national wealth and leave the consequences to their successors. Politics permits enormous discretion without an equally rigorous objective function. That is what I want to change.
The Constitution as the Constraint Layer
Every data-science model needs an objective and constraints. Data cannot tell us what society ought to value; that requires a normative framework. In a liberal democracy, the highest-order framework is the constitution: freedom of conscience, equality before the law, due process, political participation, expression and limits on executive power. I would not call a constitution a religion, but structurally it does something analogous to dīn in an Islamic religious legal worldview: it defines the highest commitments beneath which ordinary decisions must sit.
A government should optimise policy inside those constraints—not redefine them whenever politically convenient.
Islamic jurisprudence developed the Maqāṣid al-Sharīʿah, the higher purposes of law. Its classical formulation protects five fundamental goods: religion, life, intellect, lineage and property. Al-Ghazālī’s formulation was developed by scholars including al-Shāṭibī and Ibn ʿĀshūr. (Dar al-Ifta)
In a pluralistic democracy, religion becomes freedom of religion and conscience; life becomes healthcare and public safety; intellect becomes education, literacy and cognitive freedom; lineage becomes family and child welfare; and property becomes honest commerce, economic security and protection from corruption. That resembles a governmental dashboard.
Jewish law offers a parallel. Pikuach nefesh, preserving life, can override almost all other commandments. (My Jewish Learning) Tzedek commands: “Justice, justice shall you pursue” (Deuteronomy 16:20). (Sefaria) Kavod ha-briyot, human dignity, has jurisprudential force. (Berakhot 19b) Dina de-malkhuta dina recognises the state’s law within limits. (Sefaria)
Islamic maqāṣid derived by Faqihs from the Sharia, Rabbis from the Halakha and liberal constitutionalism are not the same legal system. But they share an important insight: law is not merely a pile of rules. It has purposes, priorities and constraints.
A Transparent Objective Function
Require every major policy to declare, before implementation: which social objective is this intended to improve? Then define the metric.
Housing: homelessness, overcrowding and affordability. Crime: homicide, recidivism and wrongful convictions. Education: literacy, reasoning and opportunity. Healthcare: preventable mortality, waiting times and unequal access. Religious freedom: restrictions, violence and citizens’ ability to practise or reject religion.
The skeleton is simple:
Policy → target variable → expected effect → cost → observed effect → uncertainty → review.
This is not rule by opinion poll. Democracy requires consent, but popularity and effectiveness differ. A policy can be popular and disastrous, or unpopular and necessary. W. Edwards Deming is associated with: “In God we trust. All others must bring data.” (IBM) IBM on Deming and data.
If a minister predicts that a policy will reduce crime by 20%, record it. If crime falls by 3%, investigate. If it rises, explain why. Do not let the objective mutate whenever the previous justification fails.
My framework therefore resembles a Maslow-style hierarchy for government. At its base are life and safety; food, water, shelter and healthcare; freedom of conscience; education; family and child protection; property and economic security; justice, dignity, political consultation and accountable government.
Some are hard constraints. A government cannot offset enslaving a minority with excellent GDP, compensate for torture with excellent schools, or average out religious persecution with higher incomes.
The open-source Democratic Maqāṣid Index would score countries transparently across those objectives. Every dataset, weighting and assumption—including uncertainty—would be public: United Kingdom: 78 ± 3, not a falsely precise 78.2471. Users could change the weights and see whether rankings survive. If success disappears when one reasonable assumption changes, that tells us something.
An Operating System for a Democracy
Given what a country claims to value constitutionally, what policies is it implementing—and does the evidence show that they improve the things society claims to preserve?
I have already made a start on GitHub. The intention is deliberately open-source: any government, city, researcher or citizen should be able to fork it, change the constitutional constraints and weights, connect its own datasets, and audit its government against the standards it publicly claims to uphold.
The most important feature may not be the ranking. It is transparency:
Every dollar of public money should tell us where it went, why, what outcome it was supposed to produce, and whether that outcome occurred.
Purchase a hospital? Show its cost, contractor, expected capacity and patients treated. Build a railway? Show projected demand, final cost, overruns and return. Launch a social programme? State its baseline, target population, success criterion and measured result. Build an enormous monument? Fine—but show what public objective it outranks.
What Would This Look Like?
Take homelessness. A government announces a five-year, £4 billion programme. Instead of arguing whether it feels compassionate or wasteful, publish an objective: reduce involuntary homelessness while preserving safety, dignity, fiscal sustainability and community stability.
Map it against the framework: reduce rough sleeping and exposure deaths; increase stable housing without arbitrary violations of property rights; improve addiction and mental-health services; reduce children in temporary accommodation; protect dignity; and apply eligibility consistently.
Publish the baseline and targets: rough sleeping down 60%; families in temporary accommodation down 40%; repeat homelessness below 15%; preventable deaths down 50%; and annual cost per sustainably housed person. Publish assumptions, confidence intervals and results.
If £2 billion is spent while homelessness rises, ministers cannot declare success “in other ways.” Change the programme. Explain the failure. Or stop funding it. That is not less democracy; it is democracy that must show its working.
Go to war? Citizens should see the objective, predicted human and financial cost, alternatives considered, success criteria and—critically—the exit condition. This cannot make war impossible. It can make unnecessary wars, vanity projects and “white elephants” harder to hide behind rhetoric. A government asking for another £50 billion should have to show what happened to the previous £50 billion.
The potential saving is not trivial. The World Bank estimates global public procurement at around $9.5 trillion annually and cites estimates that 10–25% of public-contract value may be lost to corruption. (World Bank) More recent World Bank work conservatively estimates around 8%—approximately $880 billion each year—lost to corruption alone. The OECD reports estimates that 8–25% of global public investment may be lost through mismanagement and corruption. (OECD)
Recovering only one-quarter to one-half of $880 billion means $220–440 billion annually. Rounded as an order-of-magnitude argument, a serious global transparency architecture could plausibly look for $250–500 billion a year from procurement integrity alone. This is not a forecast and excludes savings from failed megaprojects, uncontrolled overruns and disastrous wars. World Bank material cites 10–30% of publicly funded construction investment being lost through mismanagement and corruption in some contexts. (World Bank)
Even a fraction could build schools, hospitals, clean-water systems, housing, public transport and disease-prevention programmes—or remain in taxpayers’ pockets.
The principle is normal in business. From Rockefeller to Bezos, serious organisations monitor unit cost, productivity, return on capital, delivery time and failure rates. A chief executive cannot say, “Trust me, the strategy feels successful,” while hiding the accounts. Yet governments regularly ask citizens to accept something similar. This does not rule out “intuition” or when data gives results which don’t “make sense”. The only way to solve that is “more data”, not leaders running around like Napoleons.
The elected politician still decides. The constitution establishes the boundaries. Citizens determine political priorities. But the machine keeps the receipts.
Those may be the most useful handcuffs we could put on power: every policy mapped, every dollar accounted for, every promise measured and every failure visible.
I have already begun this GitHub project. Every country should fork it—or create its own open-source alternative—and publish the results continuously on GitHub or another platform for citizens to inspect. Every citizen has a right to this – not “theatrics”. Doesn’t matter who the leader is- less theatrics – more data.
In God we trust, everyone else show data.
Github link to a “sample dashboard” – https://ibrahimmukherjee-boop.github.io/Operating-System-for-Democracy/
Github repository for the project – https://github.com/ibrahimmukherjee-boop/Operating-System-for-Democracy
The data and the model remains experimental. This is supposed to be a “base kernel” which can be used to adapt and build on for every country. I will update it as regularly as I can, but it is no way as sophisticated as even the first version of Linux. Governments, NGOs and Think Tanks are invited to build on it.
Footnote :-
- This is still at an experimental stage – and this is the “initial scaffolding” – that governments should build on.
- Intellectual provenance – anyone who uses “Operating system for a Democracy” must attribute it back to me and this article at the Times of Israel.
3. Consultancies such as Accenture and Palantir sometimes aim to provide related services, but they are not close to this idea. Its defining metrics are transparency and a framework for every dollar spent and a ranked approach to competing goals or objectives and a live OS which shows every dollar in and out in a democracy, and every decision justified without people sitting around “discussing” it in government houses – lower or upper without any clear framework, metrics or data.
4. For more details on the Maqasid As Shariah, please refer here.
5. Advice is given sincerely to governments without “naming or shaming” any particular leader. This Hadith is particularly important :-
‘Iyad ibn Ghanam reported: The Messenger of Allah, peace and blessings be upon him, said, “Whoever has advice for the ruler, let him take his hand and give it privately. If he accepts it, then he accepts it. If he rejects it, the duty upon him has been fulfilled.”
Source: al-Sunnah li-Ibn Abī ‘Āṣim 1098
Grade: Sahih (authentic) according to Al-Albani
Imam Ibn Rajab commented, “The righteous predecessors, when they wished to advise someone, would admonish him privately, such that one of them said: Whoever admonishes his brother privately, then it is sincere advice. But whoever admonishes him in front of people has only humiliated and disgraced him.”

