# π KPLC Assistant
[](https://streamlit.io/)
[](https://langchain.com/)
[](https://python.org)
**AI-Powered Kenya Power & Lighting Company (KPLC) Customer Support Assistant** with RAG (PDF search) + web search fallback.

## β¨ **Features**
- π **RAG Pipeline**: Semantic search over KPLC PDFs/documents
- π **Web Search**: Tavily search across all `*.kplc.co.ke` domains
- πΎ **Memory**: Persistent conversation history per session
- π₯οΈ **Web UI**: Professional Streamlit chat interface
- π± **Responsive**: Works on desktop + mobile
- β‘ **Streaming**: Real-time responses
## π **Quick Start**
### 1. Clone & Setup
```bash
git clone https://github.com/YOUR_USERNAME/kplc-assistant.git
cd kplc-assistant
python -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
pip install -r requirements.txtcp .env.example .env
# Edit .env:
# GOOGLE_API_KEY=your_key
# TAVILY_API_KEY=your_keyπ kplc_document.pdf # Your tariffs/connection docs
streamlit run streamlit_kplc_app.pyOpen: http://localhost:8501
β "What's 1 token unit price?"
β "How do I get new electricity connection?"
β "Prepaid vs postpaid differences?"
User Query β Streamlit UI β LangChain Agent β [RAG Tool | Tavily Search] β Gemini β Clean Response
| Component | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | LangChain + LangGraph |
| Vector DB | ChromaDB |
| LLM | Google Gemini 2.5 Flash |
| Search | Tavily (KPLC domains) |
| Embeddings | Google text-embedding-004 |
- Fork the repo
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push & PR!
MIT License - see LICENSE Β© 2026
Built with β€οΈ for KPLC customers | Open Issue