# Algerian Law RAG Project
A comprehensive bilingual Retrieval-Augmented Generation (RAG) system for Algerian legal documents, supporting both French and Arabic languages with advanced search capabilities, authentication, and real-time chat interface.
## Features
### Core Functionality
- **Bilingual Support**: Native French and Arabic language processing
- **Intelligent Search**: FAISS-powered vector search with semantic understanding
- **Real-time Chat**: Streaming responses with Server-Sent Events (SSE)
- **Authentication**: JWT-based user authentication and session management
- **Conversation Management**: Persistent chat history and conversation threading
- **Auto-Recovery**: Intelligent 404 error handling with seamless conversation recovery
### AI & ML Capabilities
- **Language Detection**: Automatic query language identification
- **Dual Embedding Models**: Specialized French (CamemBERT) and Arabic (Multilingual) embedders
- **Smart Fallback**: Multilingual embedder fallback for robust search
- **Fine-tuned Translation**: Custom translation pipeline for legal terminology
- **Quantized Models**: Optimized model loading for efficient performance
### User Experience
- **Responsive Design**: Mobile-first design with Tailwind CSS
- **Dark/Light Theme**: User preference-based theming
- **RTL Support**: Right-to-left layout for Arabic content
- **Toast Notifications**: User-friendly error and status messages
- **Conversation Sidebar**: Easy navigation between chat sessions
## Architecture
```
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React) │
├─────────────────────────────────────────────────────────────┤
│ • Authentication Context • Language/Theme Context │
│ • Chat Interface • Conversation Management │
│ • Toast Notifications • Responsive Design │
└─────────────────┬───────────────────────────────────────────┘
│ HTTP/SSE
┌─────────────────┴── …