AI-Powered Plant Disease Diagnosis & Remedy System Helping farmers identify crop diseases through natural language conversations.
AgriCare is an intelligent agricultural assistant designed to bridge the gap between farmers and expert agricultural knowledge. Unlike standard search engines, AgriCare uses Context-Aware Logic and Fuzzy String Matching to understand imperfect user descriptions (e.g., "red spot" instead of "Brown Spot Disease") and provides immediate organic and chemical remedies.
- 🧠 Context-Aware Memory: The bot "remembers" the conversation. If you say "Rice" and then later say "red spots", it intelligently combines them to form a diagnosis.
- 🔍 Fuzzy Logic Engine: Powered by
RapidFuzz, the system handles typos and vague descriptions (e.g., matching "yellowing leaf" to "Rice Tungro Disease"). - 💾 Automatic Report Saving: Every successful diagnosis is automatically logged into a SQLite database (
reportstable) for future reference. - 💊 Dual Remedy System: Provides both Organic (home-made) and Chemical treatment options for every disease.
- ⚡ Zero-Training Deployment: Uses a lightweight, rule-based knowledge graph instead of heavy Deep Learning models, ensuring instant startup and low resource usage.
| Component | Technology | Description |
|---|---|---|
| Backend | Python (Flask) | REST API & Core Logic |
| Frontend | HTML5, CSS3, JS | Responsive Chat Interface |
| Database | SQLite3,PLpgSQL | Stores Knowledge Base & User Reports |
| AI Logic | RapidFuzz | Fuzzy String Matching & Token Ratios |
| Memory | -------- | Frontend-side context management |
AgriCare/
├── .gitignore # Specifies files for Git to ignore
├── LICENSE # MIT License details
├── README.md # Project documentation
├── agricare.db # SQLite Database (Auto-generated)
├── app.py # Main Flask Application (Server)
├── index.html # Main Chatbot Interface (Frontend)
├── plant_diseases_data.json # Backup/Source data for diseases
├── requirement.txt # Python Dependencies list
├── script.js # Frontend Logic & API Calls
├── seed_database.py # Script to reset/populate the database
├── styles.css # Styling for the chat interface
├── agricare_core_schema.sql # For handling both JSON and Geospatial data.
└── version_details.json # Project Metadata and Version infoFollow these steps to run AgriCare on your local machine.
git clone https://github.com/nabakrishna/agricare.git
cd agricareYou need Python installed. Run the following command to install the required libraries:
pip install flask flask-cors rapidfuzz You do not need to create the database manually. The application automatically checks for agricare.db on startup and creates it with the latest schema if missing.
python app.py🚀 STARTING SERVER ON PORT 5000...Open your browser and go to:
http://127.0.0.1:5000- Start a Chat — Say "Hello" or name a crop (e.g., "Wheat").
- Describe Symptoms — Type symptoms like "brown spots", "yellow leaves", or "white streaks".
- Context Test — Multi-turn conversation flow:
- User: "Red spots"
- Bot: "Which plant is this for?"
- User: "Rice"
- Bot: (Combines inputs) -> "Diagnosis: Brown Spot Disease..."
- View Reports — Check your terminal or database to see saved reports.
POST /api/analyze-symptoms— Accepts user input and returns diagnosis:- Request Body (Standard):
{ "symptoms": "rice with brown spots" } - Request Body (Context-Aware):
{ "plant": "Rice", "symptom": "brown spots" } - Response (Success):
{ "disease": "Brown Spot", "organic": "Spray neem oil.", "chemical": "Apply Mancozeb.", "source": "AgriCare Database (Match: 85%)", "is_casual": false }
- Request Body (Standard):
- Image Recognition — working with plant.in api for this
- Voice Support — Add Speech-to-Text for farmer accessibility.(not now)
- Local Dialect Support —
- Minimal Conversation
- Naba Krishna Hazarika