AI-powered agriculture advisory chatbot using Retrieval-Augmented Generation (RAG) to deliver localized, multilingual farming guidance for Ethiopian farmers.
# πΎ AI Agriculture Advisor (RAG-based MVP)
An AI-powered agriculture question-answering system focused on Teff and Maize, designed for Ethiopia β Africa β Global use. This project uses Retrieval-Augmented Generation (RAG) to answer farmers' questions based on trusted agricultural documents.
## π Quick Start
### Backend Setup
1. Navigate to the backend directory:
```bash
cd backend
```
2. Install dependencies:
```bash
pip3 install -r requirements.txt
```
**Note:** Use `pip3` and `python3` (macOS default python is 2.7)
3. Run the FastAPI server:
```bash
python3 -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
```
Or use the helper script:
```bash
./start-backend.sh
```
The API will be available at `
localhost`
### Frontend Setup
1. Navigate to the frontend directory:
```bash
cd frontend
```
2. Install dependencies:
```bash
npm install
```
3. Start the development server:
```bash
npm start
```
The app will open at `
localhost`
## π Project Structure
```
agri-advisor-rag/
βββ backend/ # FastAPI backend
β βββ main.py # Main FastAPI application
β βββ services/ # Service modules
β β βββ rag_service.py # Mock RAG service
β β βββ translation_service.py # Translation with Ge'ez detection
β β βββ logging_service.py # JSONL logging
β β βββ cache_service.py # In-memory cache
β βββ requirements.txt # Python dependencies
β βββ README.md # Backend documentation
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ App.tsx # Main app component
β βββ package.json # Node dependencies
β βββ README.md # Frontend documentation
βββ data/ # Agricultural documents
βββ logs/ # Application logs (JSONL)
βββ README.md # This file
```
## π― Features
### Backend
- **FastAPI** async endpoints
- **RAG service** data retrieval
- **Translation β¦