[ CASE STUDY · 6 MIN READ ] ⌄

How we built LegalEase: hybrid search and RAG for Pakistani law

How the Cloudiqo team built LegalEase, an AI legal research engine using semantic embeddings, vector search, BM25 and retrieval-augmented generation.

RAG.

By Umair Aslam ·

LegalEase began as our final year project at FAST-NUCES. The problem: legal research in Pakistan still means long keyword searches across judgments and statutes, and keyword search misses cases that use different words for the same idea.

Why keyword search isn't enough

A lawyer searching "eviction without notice" may miss a judgment that talks about "ejectment of a tenant". The meaning is the same; the words are not.

Hybrid retrieval

We combined two kinds of search. Semantic search turns text into embeddings and finds passages with similar meaning using a vector index. BM25 keyword search still matters for exact terms such as section numbers, names and citations. LegalEase runs both and merges the results, so it finds documents by meaning without losing precision.

Retrieval-augmented generation

On top of retrieval, an AI assistant answers legal questions in context. It is given only the retrieved passages and must answer from them, with sources shown. This approach, called retrieval-augmented generation (RAG), keeps answers grounded in real documents instead of the model's memory.

Case briefs

LegalEase also turns a long judgment into a structured case brief: facts, issues, holding and reasoning, so a researcher can decide in seconds whether a case is relevant.

What we took from it

  • Retrieval quality decides answer quality. Most of the work is in cleaning and chunking documents.
  • Showing sources builds trust and makes answers easy to check.
  • Hybrid search beats either method alone on real questions.

The same engine now powers Cloudiqo Brain, which answers staff questions from a company's own documents. Read the LegalEase case study.

→ [ SERIOUSLY ] ←

Ready to put AI to work?

Book a free 20-minute AI audit. We'll show you what to automate first and send you a clear plan.

No pitch. No obligation. Just a clear next step.