Logo Lanfrica

XasanMussa/somali-Legal-Chatbot

Domain:

natural language processing

Record type:

software
Creator:
Xas
Host:
# 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 …