# đ± Shamba-Smart â Voice Assistant for Kenyan Farmers
A WhatsApp-linked voice bot that detects Swahili or Kikuyu automatically, retrieves agricultural advice from a RAG knowledge base, and replies with expert voice responses.
---
## đ Project Structure
```
MSHAURI-WA-WAKULIMA-BOT/
âââ BACKEND/
â âââ app.py â Flask webhook server
â âââ requirements.txt â Python dependencies
â âââ .env.example â Config template
â âââ asr/
â â âââ kikuyu_asr.py â Kikuyu ASR (HuggingFace)
â â âââ swahili_asr.py â Swahili ASR (HuggingFace)
â â âââ language_detector.pyâ Cascading ASR â picks best model
â âââ services/
â â âââ intent_router.py â Groq LLM: classify query intent
â â âââ crop_advisor.py â RAG-powered crop diagnosis
â â âââ rag_indexer.py â One-time indexer for knowledge base
â â âââ market_prices.py â Marigiti & Wakulima prices
â â âââ weather.py â Open-Meteo 3-day forecast
â â âââ tts.py â gTTS text-to-speech
â â âââ audio_utils.py â OGGâWAV conversion
â âââ database/
â â âââ db.py â SQLAlchemy ORM + helpers
â âââ tests/
â âââ test_shamba_smart.pyâ Unit tests
â
âââ DATABASE/
â âââ init_db.py â Create SQLite schema
â âââ knowledge_base/
â â âââ kalro_crop_diseases.txt â Crop disease guide
â â âââ soil_management.txt â Fertilizers & soil
â â âââ pest_control.txt â IPM pest guide
â â âââ seasonal_calendar.txt â Planting calendar by region
â â âââ market_prices.json â Commodity price data
â âââ chroma_store/ â Created by rag_indexer.py
â
âââ FRONTEND/ â Future admin dashboard
```
---
## ⥠Quick Start
### 1. Install Dependencies
```powershell
cd MSHAURI-WA-WAKULIMA-BOT\BACKEND
..\ukulima-env\Scripts\Activate.ps1
pip install -r requirements.txt
```
### 2. Configure Environment
```powershell
Copy-Item .env.example .env
# âŠ