# Somali Legal RAG Chatbot - Comprehensive Project Report
## 📋 Project Overview
The **Somali Legal RAG Chatbot** is an advanced AI-powered legal assistance system designed to provide accurate legal information from Somali legal documents. This system implements a Retrieval-Augmented Generation (RAG) architecture to deliver contextual, source-cited responses to legal queries in Somali.
### 🎯 Project Goals
- Provide accessible legal information from Somali legal documents
- Implement semantic search capabilities for legal content
- Create a user-friendly interface for legal queries
- Ensure accuracy through source citations and confidence scoring
- Support the Somali language and legal system
## 🏗️ System Architecture
### High-Level Architecture
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend API │ │ Knowledge │
│ (Next.js) │◄──►│ (FastAPI) │◄──►│ Base (Chroma) │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Embedding │
│ Model │
│ (Sentence │
│ Transformers) │
└─────────────────┘
```
### Technology Stack
#### Backend Technologies
- **Framework**: FastAPI (Python web framework)
- **Vector Database**: ChromaDB (for semantic search)
- **Embedding Model**: Sentence Transformers (multilingual)
- **PDF Processing**: PyPDF2, pypdf
- **Text Processing**: LangChain
- **Configuration**: Pydantic Settings
- **Server**: Uvicorn (ASGI server)
#### Frontend Technologies
- **Framework**: Next.js 14.0.3
- **Language**: TypeScript
- **Styling**: Tailwind CSS
- **Icons**: Lucide React
- **HTTP Client**: Axios
- **UI Components**: Custom React components
## 🤖 AI Models and Machine Learning
### 1. Embedding Model
**Model**: `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2`
**Specificat …