Logo Lanfrica

LonlyEdward/KatibaAI

Domaine:

natural language processing

Type de record:

software
Créateur:
Lon
Hôte:
AI powered legal assistant that uses Retrieval Augmented Generation (RAG) to answer questions about the Constitution of Tanzania. # KatibaAI AI powered legal assistant that uses Retrieval Augmented Generation (RAG) to answer questions about the Constitution of Tanzania, providing context-aware responses supported by relevant constitutional articles and references. --- ## Description The Constitution of Tanzania is a long formally structured document with many Articles making it difficult to quickly find the specific provisions needed to answer real questions. KatibaAI solves this using Retrieval-Augmented Generation (RAG). It chunks the Constitution into structured sections, generates vector embeddings for semantic search, retrieves the most relevant constitutional provisions for each user query and provides them as context to a Large Language Model (LLM). The LLM then generates an answer grounded in the retrieved constitutional text while citing the relevant Article numbers. --- ## Features - Ask questions in natural language and get answers grounded in the actual Constitution text - Automatic source citation where every answer names the specific Article(s) it's based on - Direct article lookup, asking "what does Article 13 say?" reliably returns Article 13, not a loosely related semantic match - Conversation memory within a session where follow-up questions like "does it have any limits?" are understood in context - Persistent chat history meaning logged-in users can maintain multiple separate conversations and revisit them later - Secure authentication using JWT-based login with short-lived access tokens and rotating refresh tokens - GraphQL API as a single, typed endpoint for all chat functionality --- ## Tech Stack | Layer | Technology | |---|---| | Backend language / framework | Java 21, Spring Boot 3.4.5 | | Frontend | React (Vite) | | API | GraphQL (chat features), REST (authentication) | | Database | PostgreSQL 16 with the pgvector extension | | Database migrations | Flyway | | Authentication | JWT + Spring Security | | Chat model | Qwen2.5 (via Ollama, local inference) | | …