Legal Tech · AI
Lexa

Pakistan's first AI legal chatbot, grounded in real law.

An AI assistant that turns plain-language questions into clear, sourced legal guidance — built on a retrieval pipeline so answers stay anchored to actual statutes, not model hallucinations.

Lexa — Legal Tech · AI live site screenshot
Industry
Legal Tech · AI
Platforms
Web · Conversational AI
Status
Live in production
The challenge

What needed to be true

Legal help in Pakistan is expensive, slow, and intimidating for ordinary people. Most never speak to a lawyer until a problem has already become a crisis, and generic chatbots are worse than useless on law — they invent confident-sounding answers with no basis in statute.

The goal was a public-facing assistant people could actually trust: conversational enough for a non-lawyer, but anchored to the real legal corpus so every answer could be traced back to a source.

How we approached it

The approach, step by step.

01

Ground the model

We built a retrieval-augmented (RAG) pipeline over the legal corpus so the model answers from retrieved law, not from memory — the difference between a useful tool and a liability.

02

Engineer the conversation

Heavy prompt engineering and guardrails keep responses scoped, cite their basis, and decline gracefully when a question needs a human lawyer.

03

Ship a public product

A fast Next.js front end made the assistant accessible to anyone with a browser — no app install, no signup wall between a person and a first answer.

What we built

Shipped, not slideware

Every line below is built and running — the features that make Lexa a real product, not a prototype.

Conversational AI assistant that answers legal questions in plain language.
Retrieval-augmented generation (RAG) pipeline grounding answers in the legal corpus.
Prompt-engineering layer with guardrails, scoping, and safe-refusal behaviour.
Source-aware responses so guidance can be traced back to its legal basis.
Fast, responsive Next.js web front end — no install, instant access.
Designed for a general audience, not lawyers — readable, calm, approachable.
Tech stack

The tools behind it

Chosen for the job, not the résumé. The stack that Lexa actually runs on.

LLMGPTPrompt EngineeringRAGConversational AINext.jsPython
Results & impact

Where it landed

Lexa is live at lexa.lawyer as Pakistan's first AI legal chatbot — putting first-pass legal guidance in front of anyone with a browser, grounded in real law rather than guesswork.

Live at lexa.lawyer
Pakistan's first AI legal chatbot
RAG-grounded answers
Build something similar

Got a project like Lexa? Let's talk.

A 30-minute call with the founder — no slide decks, no sales reps, just an engineer thinking through your problem with you.