LiveIndependent · Legal AI2026

Nizam نظام

Arabic-first legal assistant · live and open to try

100%of questions found the right article in the top 5
01The problem

Why it exists

Ask Saudi regulations in Arabic or English and get an answer cited to the exact article. It covers 335 articles across the Personal Data Protection, Labor, Anti-Cyber Crime and E-Commerce laws.

02The system

What I built

Saudi law textcurrent amended articles
Query translationEnglish to Arabic wording
Hybrid retrievalBM25 + bge-m3, RRF
Cited answerevidence meter, refusals
  1. Parsed the official Bureau of Experts text into 335 articles, keeping only current (amended) wording
  2. Hybrid retrieval: Arabic-normalized BM25 plus multilingual bge-m3 embeddings, merged with weighted RRF
  3. Cross-lingual query translation so English questions match Arabic legal wording
  4. Streamed, cited answers with an evidence meter, grounded refusals, a law library and a bilingual RTL/LTR interface
  5. A second-stage re-ranker: hybrid search picks the six articles the model reads, dense similarity orders them
  6. Comparison answers across two laws, and a PDPL compliance checker that matches privacy-policy clauses to the articles to read them against
03The result

What it achieved

100% Hit@5 on a 60-question Arabic/English evaluation, 100% citation accuracy, and every out-of-scope question declined. The metrics are published in the app. Re-ranking lifted the right article to first place from 86.7% to 90.0% on the same 60 questions, with all six-article sets unchanged.

Stack

JavaScriptPythonCloudflare Workers AILlama 3.3 70Bbge-m3BM25RAGSSE

Timeline

2026

My role

Solo build