# 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 β¦