The dynamics of the legal market continue to amaze me. India has lakhs of jobless lawyers sitting around exterminating houseflies in district courts around the country. In any random sample, less than 10% make a living wage. As has always been the case, without a daddy or uncle in the profession, few are likely to beat the headwind. At the same time, cost related entry barriers to legal self-employment are rising.

There was a time you could put up a wooden table under a tree and "set up" a law practice, which is what I did. Today, membership to an entry level database costs Rs. 47,000/- annually. Then there is a computer and a printer and a roof over it! Yet, year after year, new law colleges continue to sprout unseen in the desert sands. What are we going to do with this new tsunami of hopefuls when they hit Law Street?

I am totally clear in my view. In a nutshell, it is a good time to be careful what we pray for because we may just get it. This is why I have stopped telling truly tasteless jokes about killing all the lawyers. Jobs for lawyers around the world are disappearing fast and sooner rather than later, it looks like the lawyers wouldn't need any killing. How did this happen? In two words: Artificial Intelligence!

I am not joking. Look at it from the view point of the services lawyers render. Less than 10% of lawyers in India have flourishing litigation practices. More lawyers than we care to admit make a living providing what are in truth bureaucracy facilitation services. You will find them in Tehsil offices, District level offices, Sub Registrar's offices, offices of municipal authorities, electricity 'nigams', water boards and so forth. They help people with compliance rules, especially in processing the plethora of approvals for which our license permit raj is world renowned. Thanks to AI, a lot of these facilitators are having the rug pulled from beneath their revenue models.

There are two reasons for this. First, administrations around the country are digitizing their services. This means that if you need to check something or investigate a record or find out about a new policy or notification, it's a web address you need, not a service provider. Second, the bureaucracy is progressively taking its application and approval process on-line which means you don't need a fixer in order to interact with a babu. Even the Reserve Bank of India asks you to approach it digitally for the many approvals it dispenses as part of its regulator function.

Gaggles of 'facilitations agents' are losing business. The problem is especially critical in the offices of the Sub Registrars where lawyers wrote up legal documentation and then helped get them registered. Thanks to sophisticated tools now on the web, even property agents have begun to write adequate legal documentation too. Artificial Intelligence is marching resolutely into the very innards of compliance processes in a way that is difficult to resist and as it does, it's running the lawyers out of town!

For my money though, this is the peripheral tip of the problem. Artificial Intelligence is taking a quantum leap in capability, threatening lawyers at all levels. It started with Legal Process Outsourcing, when someone realized that a lot of low end legal tasks could usefully be done cheaper, better and faster employing assembly line production processes. Suddenly, law firms woke up to the fact that Customers began to move these processes to LPOs. This was completely understandable. Market capitalism operates on constant market expansion and continual cost reduction to maintain profits. No matter what inviolability they attach to themselves, lawyers are subject to the same market forces as other service providers in the market.

Curiously, it seemed at the time that LPOs would continually expand the scope of their operations and progressively cannibalizing law firm revenues. As it turned out, the real threat lay elsewhere. On-line documentation drafting support services showed the way. If a machine can quickly and efficiently deliver a quality contract, it can do the same with a complex court case too.

This should surprise no one. Even back in the mid-1980s, I had standardized my Bank recovery suits to a point where I used 'cyclostyled' format petitions with only a dozen blanks or so I needed to fill. In a world before computers, my key witness affidavits were standardized too. Computer allow for far greater complexity and sophistication. It's only a matter of time before we use products which churn out entire case briefs with supporting documents using basic inputs from the machine operator for even the most complex cases. It seems inevitable that a lot of young lawyers are going to be ejected from the justice machine.

It's going to be the same in the world of corporate lawyers. To illustrate, in the M&A world, the Due Diligence was a tedious but critical process. If you did not understand the key risks of a business, you could never be certain if it was worth buying at any specified price. In this process, teams of lawyers, engineers, accountants and financial experts troll the target's records, looking for vulnerability. Increasingly, more and more of these processes are being given over to algorithms. This is as it should be. If Google can determine with a high statistical certainty what product I will likely buy next, another algorithm can determine what risk is likely to hit a business in the foreseeable future.

I must admit LPOs bothered me not in the least. No matter how abysmal our service standards, I assured myself, LPOs can slice processes all they like but they can't hire smarter people than I can and this is after all a people business. I told myself I don't have to worry till the day someone finds a way to make AI that can 'think', whatever that means. Low and behold, it seems that day is coming our way too.

For me it all started with EBay's dispute resolution process. The data required to resolve every dispute is finite [was an order placed/paid for/dispatched and delivered?]. The rules are simple too [payment is buyers responsibility, delivery is sellers responsibility]. Ebay holds on to payments till delivery of the goods is confirmed by the buyer. Dispute resolution is simplicity itself. How long is it before machines will be able to handle more complex disputes?

To understand what machines will do in complex disputes, lets break down the process. First there is document discovery, then drafting, then case law research and then filing. What is document discovery but trolling through bundles of electronic documents using key words to determine relevance? What is drafting but the modification of formats using bespoke key inputs? What is case law research but compilation of a legal data base that has been digitized? As for filing, Delhi High Court has turned to E-filing already and doubtless others will follow. The rules that govern the creation of a case are the same as govern the formulation and delivery of a defense of a case.

Now, you could argue that we would still need lawyers to define strategy and figure out how to win the case. Do we? What do we mean when we talk about machines that 'think'? If I want to sell you something, I have to think about what I am going to say that will make you buy it. We call it a USP. I need to know you, your desires and aspirations and your goals. That allows me to figure out a pitch. But machines do it another way. They don't try to understand my mind. They focus instead on my behavior. Thus, if I buy 3 white shirts and a black coat from Amazon, Google makes sure to have such products permanently on display in small advertisements as I surf the web. Algorithms are collating and 'interpreting' my behavior all the time, culminating in making reliable prediction on what I will do in what circumstances. How long is it before algorithms will compile every available piece of information about every judge and determine what kind of case presentation has the greatest chance of getting a favorable judgment? When this day comes to pass, exactly what will a lawyer contribute to the proceedings?

We seem to be heading to a place where we will only need judges who needs to think through the issues and deliver a judgment. Will this be a world where there will be very few lawyers but very many judges? Let's think this through. Ebay's dispute resolution program does not need a human judge. Paypal's dispute resolution program does not need human intervention. Wouldn't our logistic compulsions drive a radical paradigm shift? Given the growing backlog of cases in our courts, how long is it before cases files will be compiled by machines and fed into justice machines where algorithms will determine what would be just in the circumstances?

If this strikes you as outlandish, consider what can possibly be complex about say a medical insurance claim and why you need a human judge to resolve one? The insurance policy is digitized, the insured's medical history is digitized, and the hospital's records are digitized too. How many open issues are there? Someone just needs to write the algorithm.

It's a matter of time before the same principle will apply to the most complex of disputes. As the situation stands today, at the highest level, the Constitution of India is the algorithm on the foundation of which a large population of Apps - also called lawyers and judges - deliver justice to citizens. When the whole process has been programmed and automated, how weird will it be for the Chief Justice of India to be a main frame computer with a giant data base and a truly amazing ethical framework programmed into its innards. At that point, the only question we would need to ask ourselves is this: Who controls the program? Will it be a collective of 'right minded people', the software programmers, or, like the Skynet in Terminator movies, the Chief Justice of India program would have achieved self-awareness?

The author is Managing Partner of the Gurgaon-based corporate law firm N South. His bestselling expose' of the real world of Indian courts "Legal Confidential", released in November 2015.