How Pakistan LawBot Answers Legal Questions With Real Citations

● The short answer

Pakistan LawBot answers legal questions with retrieval-augmented generation: it searches more than 200,000 indexed Pakistani court judgments and 430+ statutes for the passages that match the question, then has a language model answer only from those passages and cite them. New judgments are collected, parsed and validated automatically before they are indexed.

Pakistan LawBot is an AI legal platform for Pakistan that I founded and run as product owner. It offers legal chat in English and Urdu, legal research, drafting, case management and a lawyer marketplace. It has grown to more than 14,000 users, over 500 of them paying. This post explains how it answers a legal question, and the product decisions behind it. The case study has the wider story.

The problem: the law is public, but not accessible

Pakistani law is public, but it lives in decades of judgments and statutes that most people cannot search, let alone read in a hurry. A tenant with a notice from a landlord, a student preparing for a moot court, and a lawyer checking precedent all need the same thing: the relevant law, explained plainly, with a source they can verify.

A general chatbot does not solve this. It answers from whatever it absorbed in training, cannot tell you where an answer came from, and may invent a case that sounds right. In law, an answer you cannot check is worse than no answer.

How an answer is made

Every question goes through four steps:

  1. Ask. The user asks in English or Urdu, by text or voice.
  2. Retrieve. The system runs a vector search across indexed judgments and statutes to find the passages most relevant to the question.
  3. Answer. A language model writes the answer using only those passages, and cites the judgments and sections it relied on.
  4. Act. From the answer, the user can draft a document, analyze one they already have, or book a lawyer.

This pattern is retrieval-augmented generation (RAG). The model is the writer; the retrieved law is the source. The citation is what turns a fluent paragraph into something a lawyer can check in a minute.

The part users never see: ingestion

Retrieval is only as good as what has been indexed. The knowledge base covers more than 200,000 judgments and 430+ statutes back to 1947, and it keeps growing on its own through an ingestion pipeline:

Step What happens
Collect New judgments and acts are gathered as they are published
Parse Each document is broken down: court, year, parties and citations
Validate Checks run before anything is indexed, so broken or partial documents never reach answers
Index Validated text is embedded and added to the retrieval store

The validation step is the one I would insist on for any RAG product. Retrieval surfaces whatever is in the index, confidently. If a garbled document gets in, it will eventually be quoted to a user.

Decisions that shaped the product

Citations first

The answer format was built around the source, not the prose. Showing which judgment or statute an answer came from is what makes a lawyer willing to use the tool, and what lets a non-lawyer take the answer to one.

Information, not advice

LawBot is explicit that it gives legal information, not legal advice. That line shapes the product: the assistant explains the law and points to sources, and when someone needs advice on their own situation, the lawyer marketplace connects them with a verified lawyer.

Language as people actually write it

Many users write Urdu in the Latin alphabet (Roman Urdu), or switch between Urdu and English in one sentence, or send a voice note. Supporting the way people actually ask mattered more than polishing any single feature.

Beyond chat

Once answers were trusted, the next features followed from the same knowledge base: legal drafting for plaints, petitions and contracts, a document analyzer that flags risky clauses, WhatsApp legal help, mobile apps and a hub for law students.

What I would tell another team building RAG for a regulated domain

  • Make the source visible. In law, health or finance, the citation is the product.
  • Validate before you index. Your retrieval layer will repeat whatever you feed it.
  • Design the boundary. Decide what the assistant must not do, and what it offers instead.
  • Meet users in their language. Including the informal one they actually type.
  • Grow on search. For LawBot, SEO and content-led growth have been the main acquisition channel: people look for legal answers on Google first.

Frequently asked questions

Is Pakistan LawBot a replacement for a lawyer?

No. LawBot gives legal information, not legal advice. It helps people understand the law and find relevant judgments and statutes, and it includes a marketplace to book a verified lawyer when someone needs advice on their own case.

Which languages does Pakistan LawBot support?

English and Urdu, by text or voice. Many people in Pakistan write in Roman Urdu, so the assistant is built to understand questions however they are typed.

How many judgments and laws does Pakistan LawBot cover?

More than 200,000 court judgments and over 430 statutes, going back to 1947. New judgments are added by an automated pipeline that collects, parses and validates them before indexing.

Why use RAG instead of fine-tuning a model on Pakistani law?

Because the law changes. Retrieval lets the knowledge base grow every day without retraining, and it lets every answer point to the exact judgment or section it relied on, which is what lawyers need to trust it.

Keep reading