Logo Lanfrica

Muthaka-Frank/SHAMBA-SMART-BOT

Domain:

natural language processingagriculture

Record type:

software
Creator:
Mut
Host:
# 🌱 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 # …