Haki Legal: Building Legal AI in Kenya

20 March, 2026 | Martin Wagah

close up of judges gavel

In May 2025, a court submission in Kenya was found to contain legal citations that did not exist. Cases fabricated whole cloth. Statutes that had never been enacted. Arguments dressed in the language of law but anchored to nothing. The Judiciary’s Committee on Innovation responded with a directive: until guidelines are developed, avoid AI altogether.

Five months later, the problem surfaced from the other side of the bench. In APEDA v Krish Commodities Limited, the Court of Appeal cited a “Geographical Indications Act, 2019”: legislation that does not exist in Kenyan law. Neither party had referenced it. The hallucination had entered not through a lawyer’s submission but through the court’s own judgment. A correction was issued within days, acknowledging that no such Act exists. However, the episode had revealed something that a blanket prohibition on AI could not address: the technology was already inside the system, and the system did not yet know how to handle it.

The directive was understandable. The diagnosis was incomplete. The problem was not that lawyers and courts had used AI. The problem was that the AI they had used knew nothing about Kenyan law. General-purpose language models are trained on the open internet, a corpus dominated by American and European legal traditions, by common law as practised in jurisdictions that are not ours. When asked for Kenyan case law, they invent. When asked about Kenyan statutes, they improvise. At best, frontier models may search briefly online before they respond. They do not retrieve, they generate. And generation without grounding is hallucination.

This essay is about what it means to solve this problem from inside Kenya, and what that solution reveals about the broader project of building AI in Africa.

The Justice Gap

There are fifty-seven million Kenyans, all of whom need access to justice. Unfortunately, Kenya has approximately seventeen thousand practising lawyers. That represents one lawyer for every three thousand Kenyans. The Judiciary at large is also staffed at about seven thousand personnel, which is only sixty-four per cent of its required establishment. That figure comprises forty-six Kadhis, two hundred and two judges, five hundred and sixty-six magistrates, and the administrative and legal staff who hold the system together.

In the 2024–25 financial year, the Judiciary was allocated KSh 22.78 billion — half of its requirement of KSh 44.90 billion. That year, six hundred and twenty-one thousand cases were filed. Through judicial reform and digitisation, the Judiciary achieved a hundred and four per cent clearance rate, resolving more cases than were filed and denting its backlog for the first time. Real progress. But the backlog remains vast — over six hundred thousand cases pending, with a hundred and seventy-seven thousand older than a year — and the key structural constraint is capacity. Not enough lawyers, not enough judges, not enough magistrates, not enough money.

The Judiciary recognises that courts alone cannot absorb this demand. It has scaled alternative pathways: Court-Annexed Mediation now operates across eighty-two registries in forty-two counties, and Alternative Justice Systems have been launched in ten. These mediators and alternative justice practitioners offer faster, less adversarial resolution — but they, too, need grounding in the law that governs the disputes they mediate.

These statistics reveal an architecture of exclusion. Justice exists, but access to justice does not: not meaningfully, not equitably, and not at the scale that fifty-seven million people demand. Technology cannot close this gap alone, but no answer that excludes technology can close it either. A citizen in Garissa who needs to understand their rights under the Constitution should not have to travel to another town to access what the law already grants them.

Therefore, if the legal corpus of Kenya can be made searchable, retrievable, and interpretable through a system that anyone with a phone can query in plain language, then access to legal knowledge ceases to be a function of factors like location and income that reinforce marginalisation. It becomes what it should always have been: a right. And the same system that empowers a citizen to understand the law also empowers the lawyer to practise it better, the mediator to ground their work in statute, and the legal student to learn from the corpus itself. The gap narrows from every direction at once.

The Policy Environment

Two main documents anchor the policy environment in which AI operates in Kenya. The first is the Kenya National Artificial Intelligence Strategy 2025–2030, launched in March 2025. It establishes three foundational pillars for the Kenyan AI revolution: digital infrastructure, a national data ecosystem, and AI research and innovation; alongside enablers in governance, talent development, investment, and ethics. Critically, it calls for reviewing public procurement regulations to prioritise local AI solutions: a provision that, if implemented, would structurally advantage Kenyan-built systems over foreign alternatives in government contracts. It also proposes an AI Bill for Parliament, which would give legislative force to commitments that are currently aspirational.

The second is the Judiciary Artificial Intelligence Adoption Policy Framework, announced in August 2025. It targets AI deployment across case management, legal research, predictive analytics, and administrative support, operating on a human-in-the-loop principle: judges retain ultimate oversight over AI-driven recommendations. The framework is still under development, but its existence signals that the Judiciary recognises AI not as a threat to be prohibited but as a capability to be governed.

Together, these policy instruments describe what should exist. They do not build it. A procurement policy that favours local solutions presupposes the existence of local solutions worth procuring. A framework that governs the use of AI in courts presupposes the existence of AI worth using in courts. The question that no policy document answers on its own is who builds what the policies describe.

Haki Legal

We are building it.

Haki Legal is a legal AI research assistant designed and built in Kenya by Haki Artificial Intelligence Africa Limited, a company formed by the founders of Songhai Limited and Vanguard Business Intelligence. It is designed to do what the general-purpose models that hallucinated their way into courtrooms cannot: answer questions about Kenyan law accurately, transparently, and with citation to actual sources.

In law, a confident fabrication is dangerous. It does not just embarrass its author, it corrodes the integrity of the judicial process itself. Haki Legal’s design philosophy begins from this understanding. Its architecture builds on the science of knowledge retrieval and knowledge representation, disciplines that allow the system to be designed, from the ground up, so that hallucination is not managed after the fact but prevented by construction.

The retrieval corpus that Haki Legal relies upon was sourced from the freely accessible repository of the National Council for Law Reporting (Kenya Law), which is the official source of law reports and consolidated laws of Kenya. When a user poses a question, Haki Legal retrieves the relevant material from our curated corpus, constructs its response on the foundation of what it finds, and cites its sources. This way, its reasoning is exposed. The user can verify it in real time.

Haki Legal is live here, and available on a subscription model with basic functionalities free. Its interface is a chat system, familiar, simple. The complexity lives in the architecture, not in the interaction. It serves senior advocates preparing submissions and citizens trying to understand their tenancy rights with equal facility.

Research First

Haki AI is a research company. This is not a branding decision. All of its founders are researchers from different domains. The technical challenges that legal AI presents — retrieving knowledge from large corpora, representing it in ways that preserve context and meaning, producing outputs that are not merely plausible but provenant — are not unique to law. They are the foundational challenges of deploying AI responsibly in any domain where accuracy is non-negotiable. Healthcare. Education. Finance. The problem is the same; the corpus simply changes.

Legal AI is the domain in which we develop and test these architectures. Our recent work on schema-light, ontology-free knowledge graph construction describes one of many techniques we are designing, and which transfer across domains. At Haki, local problems refine research. Research becomes product. Product generates data. Data identifies new problems. We believe that scientific inquiry should not be an isolated academic exercise but conducted in proximity with systems that can offer solutions.

Why Kenyans

No company in California is going to build a sovereign legal AI system for Kenya. The market is too small, the corpus too specialised, the legal tradition too particular. If such a system is to exist, and the Judiciary’s own trajectory suggests it must, then Kenyans must build it.

This is not a constraint. It is the advantage. The practitioner who has studied Kenyan law, who understands where access fails and why, knows what questions a citizen in Garissa actually needs to be answered and what the consequences of a wrong answer look like in a Kenyan magistrate’s court. This practitioner does not need a foreign framework to tell her where the risks are. She has lived them. That knowledge is not supplementary to the system. It is the system’s foundation, its first design constraint, and the reason it works where general-purpose alternatives do not.

The previous essays in this series argued that Africa’s AI advantage lies in building systems fit for African purposes: specialised, locally grounded, maintained by people who understand both the technology and the terrain. Haki Legal is that argument made concrete. Four Kenyan co-founders whose expertise was forged through academic research and commercial practice, building AI that serves Kenya because no one else will do it for us, and because no one else can do it as well.

The Government’s Role

The National AI Strategy calls for reviewing procurement to favour local solutions. The Judiciary framework invites AI into the administration of justice. These are the right instincts. But instinct must become action, and action must be directed with care.

Across the continent and throughout the history of technology, the pattern is familiar: a nascent industry emerges, driven by small teams with deep expertise and limited capital. The products are early, fragile, and full of potential. The founders are students, engineers, practitioners, people who chose to build because they saw a problem and possessed the skills to address it. These companies are not yet large, not yet powerful. And that is precisely when they are most vulnerable.

Governments that recognise the strategic value of homegrown AI capability must do more than draft policies that describe a future in which local companies thrive. They must actively identify the companies that are building now, in the present tense, and provide the conditions in which they can survive long enough to mature. This means supporting programmes that connect early-stage AI companies with government institutions that need their solutions. It means helping these companies protect their intellectual property. It means, where possible, investing directly in the companies whose success would serve the national interest. And it means ensuring that the path from innovation to government contract is navigable by the companies that did the innovating, not captured by those with proximity to procurement networks and political connections.

This is not an abstract concern. Kenya’s social environment is complex. The temptation for well-placed actors to create front companies that appropriate the work of genuine innovators is real, documented, and corrosive. Every time a nascent AI company is outmanoeuvred not by a superior product but by a superior connection, the ecosystem loses not only that company but the signal it sends to every other founder considering whether to build in Kenya. The countries that will lead in AI are the countries that protect their builders: not from competition, which sharpens them, but from predation, which destroys them.

The companies being built today, these small, four-person companies, are the companies that will anchor Kenya’s AI economy in a decade. The government’s role is not to build these companies itself. It is to ensure they are not consumed before they can grow.

What Comes Next

Policies create environments. Builders fill them.

Kenya’s policy landscape is now substantial: a national strategy with real funding, a judiciary framework with the right principles, and a growing recognition that AI is a present reality already shaping how law is practised and how justice is administered. What translates these instruments from aspiration into capability is the presence of companies and researchers building real systems, testing them against real users, and refining them through the unforgiving feedback of practice.

Haki Legal is one such system. What we learn from building legal AI in Kenya will shape what we build next, and for whom, and how. That is the builder’s wager: that competence compounds, that the knowledge gained from solving one hard problem equips you to solve the next, and that the best time to begin is before the world has decided you are ready.