Itegeko AI is a production-grade legal information platform designed to make Rwanda's laws accessible through modern technology. It combines high-performance microservices, vector search, and Retrieval-Augmented Generation (RAG) to provide accurate, source-backed answers to legal queries.
# ⚖️ Itegeko AI - Rwanda Law Navigator
Itegeko AI is a production-grade legal information platform designed to make Rwanda's laws accessible through modern technology. It combines high-performance microservices, vector search, and Retrieval-Augmented Generation (RAG) to provide accurate, source-backed answers to legal queries.
---
## ✨ Key Features
- **🔍 Semantic Legal Search**: Find relevant laws using natural language, powered by `pgvector` and deep learning embeddings.
- **🤖 RAG-Powered Q&A**: Ask complex legal questions and receive answers cited directly from official legal documents.
- **🕷️ Smart Scraper**: Automated ingestion pipeline for official Rwanda Law Reform Commission (RLRC) PDFs.
- **🔐 Enterprise Identity**: Robust user management, RBAC, and audit logging via Keycloak.
- **📂 Document Management**: Integrated S3/MinIO storage for original legal texts and orders.
---
## 🏗️ Architecture
Itegeko AI uses a modular microservices architecture built for scale and reliability.
### System Landscape
```mermaid
graph TD
Client[Browser/Mobile] --> Frontend[Next.js Frontend]
subgraph "Core Services"
Frontend --> LegalSvc[Legal Service - Spring Boot]
Frontend --> IdentSvc[Identity Service - Spring Boot]
end
subgraph "Intelligence & Storage"
LegalSvc --> AISvc[AI Service - FastAPI]
LegalSvc --> LegalDB[(Legal DB - PostgreSQL + pgvector)]
LegalSvc --> Minio[(MinIO Storage)]
end
subgraph "Security & Identity"
IdentSvc --> IdentDB[(Identity DB - PostgreSQL)]
IdentSvc --> Keycloak{{Keycloak Auth}}
end
subgraph "Ingestion"
Scraper[Law Scraper - Python] --> LegalDB
Scraper --> AISvc
end
```
### Data Flow (RAG Pipeline)
How a user query is processed and answered using source-backed legal context:
```mermaid
sequenceDiagram
participant U as User
participant L as Legal Service
participant A as AI Service
participant D as Legal DB
U->>L: Ask legal question
L->>A: Orchestrate RAG
A->>L: Search for context
L->>D: Vector Similarity Search
D-->>L: Context Snipp …