
In the dynamic landscape of legal technology, navigating extensive legal corpora poses ongoing challenges for professionals, scholars, and citizens alike. The UAE Law RAG Chat introduces an advanced agentic Retrieval-Augmented Generation (RAG) system tailored for United Arab Emirates (UAE) laber legal resources. This innovative application leverages Docling for sophisticated document processing and hybrid chunking, combined with a LangChain agent that treats the core RAG pipeline as a specialized tool. Users can engage in natural language queries about UAE laber laws, receiving precise, context-aware responses enhanced by agentic reasoning. Powered by Google's Gemini model for its generous free tier, the system is implemented with a Python FastAPI backend and a React frontend, offering an intuitive chat interface. This publication outlines the system's architecture, key methodologies, implementation, and implications for legal inquiry and education.
The foundation of the UAE Law RAG Chat is a meticulously curated knowledge base of UAE legal documents, drawn from official sources and public databases. The dataset includes federal laws, decrees, ministerial resolutions, and guidelines across the UAE's bilingual legal system (Arabic and English). Notable features:
This dataset not only fuels the agentic RAG but also supports extensible legal AI applications, with opportunities to incorporate case law and regional treaties.
The UAE Law RAG Chat adopts an agentic RAG framework, where a LangChain agent orchestrates retrieval and generation, using the RAG pipeline as a callable tool for dynamic decision-making. This enhances traditional RAG by enabling multi-step reasoning, tool selection, and error handling in legal queries.

This agentic approach improves handling of complex, multi-faceted legal questions, promoting transparency and reliability.
The full-stack application prioritizes modularity, scalability, and developer-friendly deployment.
python -m src.scripts.document_processing – Parses with Docling, applies hybrid chunking, embeds, and indexes./query trigger the LangChain agent, which calls RAG tools.Deployment: Backend on port 8000, frontend on 5173; Docker-ready.
| Component | Technology | Purpose |
|---|---|---|
| Document Processing | Docling | Parsing and hybrid chunking |
| Backend Server | FastAPI | API and agent execution |
| Vector Store | LanceDB | Similarity search |
| Embeddings | Sentence-Transformers | Semantic vectors |
| Agentic Orchestration | LangChain + Gemini | RAG as tool in agent workflow with generative AI |
| Frontend | React + Tailwind | Interactive chat interface |
Sample questions with the agent's answers
Question: Tell me about the working hours
Answer: As per UAE Labour Law, the maximum normal working hours are 8 hours per day or 48 hours per week. The Cabinet may adjust these hours for specific sectors or worker categories based on the Minister's proposal. Time spent commuting to work is not included in working hours, except for certain worker categories as defined in the Implementing Regulation. You cannot work more than five consecutive hours without a break of at least one hour, which isn't counted as part of your working hours. The Implementing Regulation also specifies working hours during Ramadan. References: Federal Decree-Law No. 33 of 2021 Regarding the Regulation of Employment Relationship and its amendments.pdf
Question: is unemployment insurance mandatory
Answer: Yes, unemployment insurance is mandatory in the UAE, as per Federal Decree-Law No. 13 of 2022. This scheme provides a limited cash benefit to insured individuals in the event of unemployment. The specifics of the scheme, including subscription amounts and procedures, are determined by the UAE Cabinet based on the Minister's proposal. References: Federal Decree-Law No. 13 of 2022 Concerning Unemployment Insurance Scheme.pdf Federal Decree Law No. 20 of 2023 Amending Certain Provisions of Federal Decree Law No. 33 of 2021 Regarding the Regulation of Employment Relationships.pdf Federal Decree-Law No. 33 of 2021 Regarding the Regulation of Employment Relationship and its amendments.pdf
Question: how many days we have for maternity leave
Answer: As per UAE Labour Law, specifically Federal Decree-Law No. 33 of 2021, a female worker is entitled to 60 days of maternity leave. The first 45 days are with full pay, and the subsequent 15 days are with half pay. Additionally, after the maternity leave, a female worker can take unpaid leave for up to 45 days if she or her child is sick due to pregnancy or childbirth, provided it's supported by a medical certificate. References: * Federal Decree-Law No. 33 of 2021 Regarding the Regulation of Employment Relationship and its amendments.pdf * Federal Decree Law No. 20 of 2023 Amending Certain Provisions of Federal Decree Law No. 33 of 2021 Regarding the Regulation of Employment Relationships.pdf
Ongoing challenges: Multilingual edge cases and agent hallucination, mitigated via refined tools.
Quick start:
git clone https://github.com/hudasaleh97188/RAG_overLawDocs.gitcd backend; uv venv; uv pip install -e .; python -m src.scripts.document_processing (Set GOOGLE_API_KEY environment variable for Gemini).cd frontend; npm install; npm run devThe UAE Law RAG Chat advances agentic AI for legal access, empowering users with reasoned, tool-augmented insights via Gemini's efficient capabilities. Future enhancements: Multimodal Docling support, Voice Support
Repository: https://github.com/hudasaleh971-netizen/RAG_overLawDocs.git