Logo Lanfrica

MissBaduwa/AI_10012200033

Domain:

natural language processing

Record type:

software
Creator:
Mis
Host:
CS4241 - Introduction to AI: Complete RAG system for Ghana election results (1992-2020) and 2025 Budget. Built from scratch without LangChain/LlamaIndex. Features: FAISS + BM25 hybrid search, conversation memory, feedback loop, 0% hallucination rate on adversarial tests. # πŸš€ Academic City RAG System: Ghana Elections & 2025 Budget **CS4241 - Introduction to Artificial Intelligence | End of Semester Project** **A complete Retrieval-Augmented Generation system built from scratch without LangChain or LlamaIndex** Live Demo | API Docs | Video Walkthrough --- ## πŸ“‹ Table of Contents - Overview - Features - Architecture - Dataset - Technical Implementation - User Interface Gallery - Results & Evaluation - Innovation Features - Testing - Acknowledgments --- ## 🎯 Overview This project implements a **production-grade RAG (Retrieval-Augmented Generation) system** for querying: - πŸ‡¬πŸ‡­ **Ghana Presidential Election Results** (1992-2020) - 615 records - πŸ“Š **Ghana 2025 Budget Statement** - 252 pages, 1M+ characters **Key constraint:** Built entirely from scratch - no LangChain, no LlamaIndex, no pre-built RAG pipelines. ### Why This Matters Traditional LLMs hallucinate on specific facts about Ghana's elections and budget. This RAG system grounds responses in actual documents, achieving **0% hallucination rate** on out-of-domain queries vs 67% for pure LLM. --- ## ✨ Features ### Core RAG Capabilities | Feature | Implementation | Status | |---------|---------------|--------| | Data Cleaning | Pandas + regex preprocessing | βœ… | | Chunking Strategy | Recursive + semantic (512 chars, 128 overlap) | βœ… | | Embeddings | Sentence Transformers (all-MiniLM-L6-v2, 384-dim) | βœ… | | Vector Store | FAISS (IndexFlatIP for cosine similarity) | βœ… | | Sparse Retrieval | BM25 with custom tokenization | βœ… | | Hybrid Search | Reciprocal Rank Fusion (RRF) | βœ… | | Query Expansion | 5 template variations | βœ… | | Re-ranking | Cross-encoder (ms-marco-MiniLM-L6-v2) | βœ… | | LLM Integration | Groq (llama-3.3-70b-versatile) | βœ… | | Hallucination Control | Prompt engineering + source constraints | βœ… | ### Innovation Features (Part G) | Feature | Description | Impact | |---------|-------------|--------| | 🧠 **Conversation Memory** | Remembers up to 5 previou …