A Source-Grounded RAG Framework for Egyptian Criminal Law: Domain-Adapted Semantic Retrieval and Evidence-Grounded Generation

Main Article Content

Aliaa Jamal
Aya Atef
Fawzya Said
Nouran Emad
Rania Ali
Mohammed Tarek
Shorok Osama

Abstract

Large language models can accelerate legal research, but legal deployment requires two properties that generic assistants do not guarantee: jurisdiction-specific retrieval and explicit grounding in authoritative text. This paper presents a retrieval-augmented generation (RAG) assistant specialized in Egyptian criminal law. The system constructs an Arabic legal knowledge base from scanned legal books and supplementary online legal materials, applies OCR cleaning and metadata-preserving chunking, and indexes dense representations for semantic retrieval. Its retrieval encoder is based on the Sentence-Transformers paraphrase-multilingual-mpnet-base-v2 model and is fine-tuned with corpus-derived anchor-positive-negative triplets using an InfoNCE objective. The generation pipeline is retrieval-gated: out-of-domain queries are rejected, retrieved passages are carried into the answer context with source metadata, and the system abstains when relevant legal evidence is not available. On the reported held-out in-domain evaluation, fine-tuning reduced validation loss from 0.51 to 0.04, increased MRR from 0.86 to 0.99, and increased ranking accuracy from 0.76 to 0.98. More importantly, the mean negative similarity decreased from 0.52 to 0.17, widening the positive-negative separation margin from 0.26 to 0.58. These results demonstrate improved legal-domain retrieval discrimination; they are not treated as a direct measure of end-to-end legal-answer correctness. The resulting architecture provides a reproducible foundation for source-cited Arabic legal research assistance while preserving a human-review boundary for high-stakes legal use.

Downloads

Download data is not yet available.

Article Details

How to Cite
Jamal, A., Atef , A., Said, F., Emad, N., Ali, R., Tarek, M., & Osama, S. (2026). A Source-Grounded RAG Framework for Egyptian Criminal Law: Domain-Adapted Semantic Retrieval and Evidence-Grounded Generation. SciNexuses, 3, 94-107. https://doi.org/10.61356/j.scin.2026.3676
Section
Original Research Articles

How to Cite

Jamal, A., Atef , A., Said, F., Emad, N., Ali, R., Tarek, M., & Osama, S. (2026). A Source-Grounded RAG Framework for Egyptian Criminal Law: Domain-Adapted Semantic Retrieval and Evidence-Grounded Generation. SciNexuses, 3, 94-107. https://doi.org/10.61356/j.scin.2026.3676

Similar Articles

You may also start an advanced similarity search for this article.