RAG for the Constitution of Kenya is a Python-based project that enables users to interact with the Constitution of Kenya (2010) in a simple, searchable way. By applying text extraction and keyword search techniques, the system allows a user to input a query and instantly retrieve relevant Articles from the Constitution.
# RAG for the Constitution of Kenya
# Overview
This project provides a simple Python-based **search assistant** for the Constitution of Kenya (2010).
It extracts, organizes, and indexes Articles from the Constitution PDF, then allows users to query the document interactively.
# Features
- Extracts all Articles (1–264) from the official Constitution PDF.
- Keyword-based search to find relevant Articles.
- Interactive terminal-based assistant.
- Helps users quickly navigate and understand Kenyan law.
# Technologies Used
- Python
- pdfplumber (for PDF text extraction)
- Regex (for splitting and organizing Articles)
- Dictionary-based retrieval
# How It Works
1. Load the Constitution of Kenya PDF.
2. Extract text and split it into structured Articles.
3. Store Articles in a dictionary for fast lookup.
4. Accept user input (keywords).
5. Return matching Articles with excerpts.