Inspiration
In Pakistan, the law exists — but understanding and accessing it is often a privilege. A legal notice arrives, an FIR doesn't get registered, a property dispute flares up, an employment issue lands — and an ordinary person is suddenly staring down legal terminology, unfamiliar procedure, and the cost of a consultation, with no clear idea where to even start.
As a technologist and educator, that gap kept raising the same question: why can't technology at least help someone understand their situation before they walk into a lawyer's office? Wakeel.org was never meant to replace lawyers — if anything, building it made that clearer. AI should help people show up to a lawyer more prepared, not convince them they don't need one. That's the philosophy the product is built around: plain-English and Urdu explanations of Pakistani law, with source verification and human legal judgment kept firmly at the center.
What it does
Wakeel.org is a Pakistan-focused legal AI — live on Android, iOS, and Web — that helps citizens, law students, lawyers, and judges understand legal questions, documents, and procedure in plain English or Urdu.
For lawyers, judges, and advocates, Wakeel runs a real ReAct tool-calling agent loop (up to 5 iterations per turn), live in production today. Rather than answering in a single retrieve-and-generate pass, the client plans its next step and calls out — via API — to a set of legal research tools (search_statutes, search_case_law, search_precedents, analyze_document, compare_documents, prepare_argument) backed by our hybrid-retrieval service, before composing a final, cited answer. Every response surfaces its sources and a "verify with a licensed advocate" disclaimer. Wakeel is explicitly positioned as legal information and research support — not a replacement for a lawyer.
How we built it
The system is split across three parts that evolved independently:
Client (live app — wakeel2025):
Flutter + Dart, GetX for state/DI, on Android, iOS, and Web. Firebase (Cloud Functions, Firestore, Auth, Storage, Cloud Messaging) handles app infrastructure. This is where the agentic ReAct loop actually runs, orchestrating tool calls and composing the final answer.
Backend (wakeel_2026):
Python, FastAPI, PostgreSQL, Redis, Celery, SQLAlchemy/Alembic — the service the client's tools call out to. Hybrid retrieval combines vector search (Pinecone in production, Qdrant in dev) with PostgreSQL full-text search, merged and reranked with a sentence-transformers cross-encoder. Embeddings are OpenAI text-embedding-3-large, with a local Sentence-Transformers fallback for outages.
Generation:
Google Gemini as the primary model, with NVIDIA NIM and Hugging Face Inference API as fallback providers, proxied through a Firebase Function — necessary because some providers are blocked from direct calls originating in Pakistan.
Marketing site (standalone):
wakeel.org itself is a separate, static front door with a scripted sample question (not a live API call) — it exists to explain the product and route people to the real app, not to demo the live AI in-browser.
The architectural shift that mattered more than any single technology choice was moving from thinking of Wakeel as "a chatbot" to thinking of it as a legal research system with an AI interface — one that plans research steps and verifies before answering, rather than generating a single guessed reply.
Challenges we ran into
We assumed the hard part would be building the chatbot. It wasn't — the hard part was making the system trustworthy. Embeddings, chunking, retrieval strategy, reranking, and prompting all interact, and a small change anywhere could swing answer quality significantly. The bigger realization: retrieving a relevant passage isn't the same as answering a legal question correctly — that requires understanding the question, identifying the relevant law, retrieving the source, interpreting it in context, verifying authority, and only then composing an answer. That's exactly what pushed Wakeel from a single-pass RAG pipeline toward the agentic, tool-calling architecture running today.
We also learned that in legal tech, accuracy is a product feature, not just an engineering metric — a confidently wrong citation has real consequences. So the product is designed around uncertainty: citations, disclaimers, source verification, and a consistent nudge toward a licensed advocate for anything consequential.
Accomplishments that we're proud of
Wakeel has crossed 550+ organic installs, with zero paid marketing spend. Over a recent 28-day window: ~154 average active devices, ~107 average MAU, ~6–8 average DAU, 141 of 149 installed audience based in Pakistan, and a 29.4% store-listing conversion rate.
We're also proud that Wakeel has its first paying customers — 4 students currently on paid plans. That's a strong signal on its own: before spending a rupee on acquisition, people in Pakistan found the problem real enough to install the app, use it, and pay for it.
We're equally proud of shipping a genuinely agentic system in production — not a demo of one. The ReAct tool-calling loop for lawyers, judges, and advocates is live today, planning multi-step research across statutes, case law, and precedents rather than answering in a single guessed pass, with every response grounded in retrieved sources and citations checked before being returned to the user.
The MAU-vs-DAU gap taught us something too, and we count understanding it as its own small accomplishment: Wakeel is used like an on-demand utility, not a daily-habit app — which tracks with how legal problems actually work. We've stopped judging it by social-app retention expectations and instead ask the more honest question: when someone actually has a legal problem, do they remember Wakeel and come back?
Challenges we faced
Data sourcing.
Pakistan's legal information ecosystem is fragmented. Getting laws into a form that's reliably structured, versioned, and retrievable — amendments, section numbering, OCR quality, source authority, duplicate material — became one of the biggest hidden costs of the project.
App Store / Play Store review.
Apple flagged Guideline 2.1(a) (an iPad login crash from LSRequiresIPhoneOS forcing iPhone-compatibility mode) and Guideline 3.1.2(c) (missing Terms/Privacy links on the subscription screen). Google Play raised a Misleading Claims concern — both traced back to language implying "AI lawyer" meant licensed legal advice. That pushback directly reshaped our positioning toward legal information and research support, not advice.
LLM cost and reliability.
Long legal documents and multi-step tool calls get expensive fast, and some providers are inaccessible directly from Pakistan — which is why generation routes through a proxied, multi-provider fallback chain (Gemini → NVIDIA NIM → Hugging Face) instead of depending on one model.
What's next
Hardening the link between the agentic client and the retrieval backend, expanding structured coverage of Pakistani statutes and case law, and growing organically from the current base toward broader reach across citizens, law students, and legal professionals.
What we learned
We started out trying to build an AI that could answer legal questions, and ended up realizing the real product is a system that helps people understand, verify, and navigate Pakistani law more responsibly. The hardest question was always: can we build something a person can actually trust when the subject is their rights, their property, their family, or their future?
What's next for Wakeel.org — Agentic AI for Pakistani Law
Hardening the link between the agentic client and the retrieval backend, expanding structured coverage of Pakistani statutes and case law, and growing organically from the current base toward broader reach across citizens, law students, and legal professionals.
Built With
- alembic
- celery
- dart
- fastapi
- firebase
- firebase-auth
- firebase-cloud-functions
- firebase-storage
- firestore
- flutter
- getx
- google-gemini-api
- hugging-face-inference-api
- node.js
- nvidia-nim
- openai-embeddings
- pinecone
- postgresql
- python
- qdrant
- redis
- sentence-transformers
- sqlalchemy
Log in or sign up for Devpost to join the conversation.