Joseph Nawar APPLIED AI · MACHINE LEARNING
All selected work
PROJECT 02 / ARABIC NLP + RAG

Kawaneen

An Arabic legal AI platform designed around hybrid retrieval, reranking, citation-grounded answering, and safe abstention.

Explore the case study
Role
Applied AI / retrieval engineering project
Stack
Python · FastAPI · Qdrant · Streamlit · Docker · MLflow
Focus
Retrieval evaluation · citations · abstention
Illustrative Arabic legal search interface with grounded citations.

Original explanatory illustration, not a screenshot of the application.

0.684nDCG@10 · frozen retrieval dataset
0.639Comparison baseline nDCG@10
0/40Citation-contract defects in controlled DEV test, down from 29/40
01 / THE PROBLEM

Legal answers need their evidence attached.

Arabic legal document collections are difficult to navigate with basic keyword search alone. A useful legal assistant needs to retrieve the right source text, answer only when supported, and make its citations inspectable.

Kawaneen is an Arabic legal AI and retrieval-augmented generation platform with Search, Ask, and Extract workflows. It combines retrieval, reranking, structured extraction, citation-grounded question answering, and safe abstention.

02 / THE SYSTEM

Retrieval quality is part of answer quality.

01 / INDEXChunk and store legal source material
02 / FINDCombine BM25 and dense retrieval
03 / RANKRerank relevant source passages
04 / ANSWERGround with citations or abstain

The application uses Python, FastAPI, Streamlit, Qdrant, Docker Compose, and MLflow. Hybrid lexical/semantic search helps cover the different ways legal concepts may be expressed, while reranking improves the order of supporting passages.

The citation contract is treated as an engineering requirement, not just a nice formatting detail. Unsupported output should be rejected or abstained from rather than presented with invented references.

03 / MEASURED RESULTS

Evaluate the retriever and the answer contract separately.

On a frozen retrieval evaluation dataset, structure-aware chunking improved nDCG@10 from 0.639 to 0.684. In a controlled development evaluation, citation-contract defects fell from 29 of 40 to 0 of 40.

Evaluation scope: The citation result is from a controlled DEV set; it should not be interpreted as a guarantee of zero citation errors in unrestricted production use. The retrieval metric is specific to the frozen evaluation dataset.
04 / DESIGN DECISIONS

Why these choices?

  • Hybrid retrieval: combine exact lexical matching with semantic retrieval instead of relying on either alone.
  • Structure-aware chunking: keep source divisions meaningful, then measure whether ranking actually improves.
  • Grounded answering: make citation correctness and abstention part of the response contract.

The result is an application that demonstrates retrieval evaluation and trust boundaries—two important concerns in applied LLM systems.

Next case study
RuralStroke Triage ↗
View publications ↑
04 / LET'S CONNECT

Let’s build AI
that matters.

Hiring for applied AI or machine-learning engineering? I’m interested in remote-first teams, research collaborations, and carefully scoped engineering work. My inbox is open.

[email protected]

Elsewhere on the internet

Based in Cairo, Egypt.
Interested in remote-first opportunities.