Skip to content

rashedulalbab253/AgroGPT-Multilingual-Voice-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌾 AgroGPT: Intelligent Multilingual Agri-Advisory System

Bridging the Digital Divide with Voice-Enabled Generative AI for Agriculture

Build Status Python React Security License


🌟 Project Vision

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.


πŸš€ Key Features

1. 🎀 Voice-First Interaction

Seamlessly transcribe regional dialects into actionable queries using advanced ASR models. Designed for accessibility in rural environments.

2. 🌍 Universal Multilingual Support

Conversational support for 6+ major languages:

  • English, Hindi, Bengali, Gujarati, Kannada, Punjabi.

3. πŸ›‘οΈ Enterprise Security & Scalability

  • API Key Guard: Custom-built middleware for secure, authenticated access.
  • Rate Limiting: Integrated slowapi to prevent abuse and ensure high availability.
  • Async Architecture: Built on FastAPI for high-performance, asynchronous processing.

4. πŸ“¦ Cloud-Ready Deployment

  • Full Dockerization for consistent environments.
  • GitHub Actions (CI/CD) automated pipeline for Docker Hub deployment.

πŸ› οΈ Tech Stack

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

πŸ—οΈ System Architecture

User Interface (React) <---> Secure Gateway (FastAPI) <---> Sarvam AI Engine
                                     |
                          +----------+----------+
                          |          |          |
                    Local Cache   Auth Mgr   Session DB

πŸ“ Project Structure

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

βš™οΈ Setup & Installation

1. Environment Configuration

Create a .env file in the root directory:

SARVAM_API_KEY="your_sarvam_key"
MASTER_API_KEY="my-secret-master-key-12345"

2. Local Development (Classic)

Backend:

cd backend
pip install -r requirements.txt
uvicorn app.main:app --port 8000 --reload

Frontend:

cd frontend
npm install
npm run dev

3. Modern Launch (Recommended)

Launch the entire stack with one command:

python run.py

🐳 Dockerization & Deployment

To run in a containerized environment (Port 8000 & 5173):

docker-compose up --build -d

CI/CD Pipeline: The project is configured to automatically push images to Docker Hub:

  • Backend: rashedulalbab1234/agrogpt-backend
  • Frontend: rashedulalbab1234/agrogpt-frontend
  • GitHub User: rashedulalbab253

πŸŽ“ Academic Significance

This project serves as a research foundation for:

  1. NLP in Low-Resource Languages: Real-world application of cross-lingual knowledge transfer.
  2. HCI (Human-Computer Interaction): Studying the impact of voice-based AI on rural technology adoption.
  3. Domain-Specific AI Alignment: Implementing strict system prompts and safety guards for critical agricultural advice.

�️ Contribution & Role

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.

οΏ½πŸ‘¨β€πŸ’» Author

Rashedul Albab


πŸ“œ License

Licensed under the MIT License.

About

"🌾 AgroGPT: An enterprise-grade AI advisor. Features voice/chat support in regional languages, built with FastAPI, React, and Docker. πŸš€ Includes CI/CD automation and API security."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors