A bilingual (English/Kiswahili) RAG assistant for the Kenya 2025 Finance Bill, built with LangChain, and Ollama
# FinanceBill-Assistant-KE2025
A bilingual (English/Kiswahili) RAG assistant for the Kenya 2025 Finance Bill
# Finance Bill RAG Assistant
**A Retrieval-Augmented Generation (RAG) assistant that answers questions from a Finance Bill PDF (English & Swahili).**
---
## Table of contents
* What is this project?
* Features
* Prerequisites
* Setup — step by step (beginner-friendly)
* Project structure
* How to run (notebook)
* How to run (Streamlit app)
* How it works (simple explanation)
* Key settings to tune (and why)
* Prompts used in this project
* Examples & expected behavior
* Troubleshooting
---
## What is this project?
This repository demonstrates a **beginner-friendly** Retrieval-Augmented Generation (RAG) workflow that:
* loads a Finance Bill PDF,
* splits it into searchable chunks,
* creates embeddings and stores them in a vector database,
* retrieves relevant chunks for a user question,
* answers the question using an LLM and custom prompts.
It’s aimed at learners who are new to LangChain, vector search, and practical RAG setups.
---
## Features
* Load PDFs (Finance Bill) and extract text.
* Split long documents into smaller chunks for better retrieval.
* Create embeddings and persist a vector store (Chroma by default).
* Custom Query + Answer prompts (keeps language consistent — English/Swahili).
* A Jupyter notebook for exploration and a Streamlit app for end-user interaction.
---
## Prerequisites
* **Python 3.12** (use `python --version` to check)
* `git` (optional, for cloning)
* Basic command-line knowledge (open a terminal)
* Optional: account/API key for your chosen LLM (OpenAI) or a local LLM (Ollama)
---
## Setup — step by step (beginner-friendly)
1. **Clone the repo** (or make a local folder and copy files):
```bash
# replace with your repo link, or skip if working locally
git clone
cd
```
2. **Create & activate a virtual environment** (recommended):
```bash
# Linux / macOS
python -m venv venv
source venv/bin/activate
# Windo …