Skip to content

AnoMi-1/FUTURE_ML_03

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“„ README.md

# πŸ”Œ KPLC Assistant

[![Streamlit App](https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white)](https://streamlit.io/)
[![LangChain](https://img.shields.io/badge/LangChain-262727?style=for-the-badge&logo=langchain&logoColor=white)](https://langchain.com/)
[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org)

**AI-Powered Kenya Power & Lighting Company (KPLC) Customer Support Assistant** with RAG (PDF search) + web search fallback.

![Demo](docs/demo.gif)

## ✨ **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.txt

2. Configure API Keys

cp .env.example .env
# Edit .env:
# GOOGLE_API_KEY=your_key
# TAVILY_API_KEY=your_key

3. Add KPLC Documents

πŸ“ kplc_document.pdf     # Your tariffs/connection docs

4. Launch Web App

streamlit run streamlit_kplc_app.py

Open: http://localhost:8501

πŸ’¬ Sample Queries

❓ "What's 1 token unit price?"
❓ "How do I get new electricity connection?"  
❓ "Prepaid vs postpaid differences?"

πŸ—οΈ Architecture

User Query β†’ Streamlit UI β†’ LangChain Agent β†’ [RAG Tool | Tavily Search] β†’ Gemini β†’ Clean Response

πŸ“Š Tech Stack

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

🀝 Contributing

  1. Fork the repo
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push & PR!

πŸ“„ License

MIT License - see LICENSE Β© 2026

πŸ› οΈ Deployment


Built with ❀️ for KPLC customers | Open Issue

About

πŸ”Œ KPLC AI Chatbot | LangChain RAG + Streamlit Production-ready assistant for KPLC customers. Handles tariffs, meters, connections & CEO info via PDF search + kplc.co.ke web search. ✨ Features: RAG β€’ Web fallback β€’ Memory β€’ Streamlit UI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Generated from github/codespaces-blank