AgroGPT is an enterprise-grade, multilingual AI advisor designed to empower farmers and agriculturists. In regions where literacy or technical barriers exist, AgroGPT provides a voice-first, native-language interface to access expert advice on crop management, pest control, and sustainable farming practices.
This system leverages state-of-the-art Generative AI and ASR (Automatic Speech Recognition) via the Sarvam AI platform to deliver high-accuracy, domain-specific intelligence.
Seamlessly transcribe regional dialects into actionable queries using advanced ASR models. Designed for accessibility in rural environments.
Conversational support for 6+ major languages:
- English, Hindi, Bengali, Gujarati, Kannada, Punjabi.
- API Key Guard: Custom-built middleware for secure, authenticated access.
- Rate Limiting: Integrated
slowapito prevent abuse and ensure high availability. - Async Architecture: Built on FastAPI for high-performance, asynchronous processing.
- Full Dockerization for consistent environments.
- GitHub Actions (CI/CD) automated pipeline for Docker Hub deployment.
| Component | Technology |
|---|---|
| Backend | FastAPI (Python), SQLAlchemy, Pydantic |
| Frontend | React.js, Vite, Tailwind CSS, Axios |
| AI/ML | Sarvam AI (Text-to-Text & ASR), saarika:v2.5 |
| Database | SQLite (Production-ready abstraction available) |
| DevOps | Docker, Docker Compose, GitHub Actions |
User Interface (React) <---> Secure Gateway (FastAPI) <---> Sarvam AI Engine
|
+----------+----------+
| | |
Local Cache Auth Mgr Session DB
AgroGPT-Multilingual-Voice-Chat/
β
βββ π .github/
β βββ π workflows/
β βββ docker-publish.yml # CI/CD pipeline β auto-push to Docker Hub
β
βββ π backend/ # FastAPI Python backend
β βββ π app/
β β βββ π core/ # Core utilities & configuration
β β β βββ __init__.py
β β β βββ config.py # App settings & environment variables
β β β βββ database.py # SQLAlchemy DB session setup
β β β βββ logger.py # Centralized logging setup
β β β βββ security.py # API-Key authentication middleware
β β β
β β βββ π models/ # Data layer
β β β βββ __init__.py
β β β βββ db_models.py # SQLAlchemy ORM models (DB tables)
β β β βββ schemas.py # Pydantic request/response schemas
β β β
β β βββ π routers/ # API route handlers
β β β βββ __init__.py
β β β βββ chat.py # /chat endpoints (text & voice)
β β β
β β βββ π services/ # Business logic & external API clients
β β β βββ __init__.py
β β β βββ sarvam_service.py # Sarvam AI integration (LLM + ASR)
β β β
β β βββ __init__.py
β β βββ main.py # FastAPI app entry point
β β
β βββ π data/ # SQLite database storage (runtime, not committed)
β βββ .dockerignore
β βββ Dockerfile # Backend container definition
β βββ requirements.txt # Python dependencies
β
βββ π frontend/ # React.js frontend (Vite)
β βββ π src/
β β βββ π components/ # Reusable UI components
β β β βββ ChatInterface.jsx # Main chat UI (text + voice input)
β β β βββ Sidebar.jsx # Language selector & session controls
β β β
β β βββ π hooks/ # Custom React hooks
β β β βββ useAPI.js # Axios API call abstraction
β β β
β β βββ App.jsx # Root application component
β β βββ main.jsx # React DOM entry point
β β βββ index.css # Global styles
β β
β βββ index.html # HTML shell
β βββ vite.config.js # Vite bundler configuration
β βββ tailwind.config.js # Tailwind CSS configuration
β βββ postcss.config.js # PostCSS configuration
β βββ package.json # Node.js dependencies
β βββ .dockerignore
β βββ Dockerfile # Frontend container definition
β
βββ π docs/ # Project documentation & reports
β βββ INTERVIEW_SCRIPT.md
β βββ PROJECT_ARCHITECTURE_AND_INTERVIEW_GUIDE.md
β βββ Project_Report.md
β
βββ docker-compose.yml # Multi-service orchestration (backend + frontend)
βββ run.py # One-command local dev launcher
βββ .env # Environment variables (not committed)
βββ .gitignore
βββ README.md
Create a .env file in the root directory:
SARVAM_API_KEY="your_sarvam_key"
MASTER_API_KEY="my-secret-master-key-12345"Backend:
cd backend
pip install -r requirements.txt
uvicorn app.main:app --port 8000 --reloadFrontend:
cd frontend
npm install
npm run devLaunch the entire stack with one command:
python run.pyTo run in a containerized environment (Port 8000 & 5173):
docker-compose up --build -dCI/CD Pipeline: The project is configured to automatically push images to Docker Hub:
- Backend:
rashedulalbab1234/agrogpt-backend - Frontend:
rashedulalbab1234/agrogpt-frontend - GitHub User:
rashedulalbab253
This project serves as a research foundation for:
- NLP in Low-Resource Languages: Real-world application of cross-lingual knowledge transfer.
- HCI (Human-Computer Interaction): Studying the impact of voice-based AI on rural technology adoption.
- Domain-Specific AI Alignment: Implementing strict system prompts and safety guards for critical agricultural advice.
As the Lead Developer of AgroGPT, I spearheaded the following architectural and technical implementations:
- System Orchestration: Designed and implemented the full-stack architecture using FastAPI and React.
- Multilingual Integration: Integrated Sarvam AI's Generative models and ASR (
saarika:v2.5) to support diverse regional languages. - Security Engineering: Built custom API-Key middleware and enforced rate-limiting to ensure system integrity.
- DevOps & Cloud: Engineered the Dockerization strategy and CI/CD pipelines for automated multi-service deployment.
- Agricultural Alignment: Configured domain-specific system prompts to ensure the AI remains focused on providing accurate agricultural advice.
Rashedul Albab
Licensed under the MIT License.