An enterprise-grade AgTech proof-of-concept that bridges the gap between Computer Vision and Multi-Agent LLM Orchestration to provide real-time, expert-level agronomic diagnostics.
In precision agriculture, simply detecting a disease is not enough; farmers need immediate, actionable, and accurate treatment plans. AgroVision AI solves this by using a two-tier AI architecture:
- The Eyes (Computer Vision): A custom-trained YOLOv8 model detects crop diseases from leaf images.
- The Brain (CrewAI Multi-Agent System): Instead of relying on a single LLM prompt (which is prone to hallucinations), the system triggers a specialized crew of AI agents (a Chief Agronomist and a Treatment Specialist) to debate and generate a factual, step-by-step action plan.
βββββββββββββββββββ ββββββββββββββββββββββ βββββββββββββββββββββββ
β 1. Image Upload β βββ> β 2. YOLOv8 Model β βββ> β Detected: e.g., β
β (Streamlit UI) β β (Object Detection) β β "Soybean Rust" β
βββββββββββββββββββ ββββββββββββββββββββββ βββββββββββ¬ββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββ
β 3. CrewAI Orchestration (Multi-Agent System) β
β β
β π§βπ¬ Agent 1: Chief Agronomist π¨βπΎ Agent 2: Treatment Specialist β
β Analyzes biological impact and ββ> Formulates chemical/organic β
β contagion risks. treatment & preventive measures. β
ββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β 4. Final Output β
β Bounding box visuals + Comprehensive, step-by-step agronomic report β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
agrovision-ai/
βββ app/
β βββ __init__.py
β βββ streamlit_app.py # Main Streamlit UI (Frontend)
βββ core/
β βββ __init__.py
β βββ vision.py # YOLOv8 inference and image processing logic
β βββ crew_logic.py # CrewAI multi-agent orchestration and LLM config
βββ data/
β βββ sample_images/ # Test images (healthy and diseased leaves)
β βββ models/ # Trained YOLO weights (e.g., yolov8n.pt)
βββ tests/
β βββ __init__.py
βββ requirements.txt # Project dependencies
βββ .env.example # Template for environment variables
βββ .gitignore # Git ignore file (excludes weights, secrets, etc.)
βββ README.md # Project documentation
- Frontend: Streamlit (Interactive, state-managed UI)
- Computer Vision: Ultralytics YOLOv8 (Real-time object detection)
- Agent Orchestration: CrewAI & LangChain
- LLM Provider: HuggingFace Inference API (
meta-llama/Llama-3.1-8B-Instruct) - Image Processing: OpenCV & Pillow
- Hallucination Mitigation: By anchoring the LLM's context strictly to the YOLOv8 output, and dividing tasks among specialized agents via CrewAI, the system prevents generic or hallucinated agricultural advice.
- Separation of Concerns: The vision model handles pixels; the LLM handles text logic. This allows independent scaling and fine-tuning of each component.
- Cost-Effective: Utilizes the HuggingFace Router for inference, keeping API costs to a minimum while maintaining high reasoning capabilities.
git clone [https://github.com/jeorgesilva/agrovision-ai.git](https://github.com/jeorgesilva/agrovision-ai.git)
cd agrovision-ai
pip install -r requirements.txt
(Requires Python 3.9+)
Create a .streamlit/secrets.toml file in the root directory and add your HuggingFace token:
HUGGINGFACEHUB_API_TOKEN = "your_hf_token_here"
Note: Ensure .streamlit/ is added to your .gitignore to prevent leaking API keys.
streamlit run app/streamlit_app.py
- Custom Dataset Fine-Tuning: Train YOLOv8 on specific regional datasets (e.g., Brazilian Soybean or German Wheat diseases).
- Offline Edge Deployment: Optimize the YOLO model using TensorRT for offline inference on farm equipment.
- Drone Integration: Process batch images captured by agricultural drones (DJI/XAG) for field-level mapping.
- Weather API Integration: Pass real-time weather data to the CrewAI agents to adjust treatment recommendations (e.g., "Do not spray today due to high winds").
Jeorge Silva Junior AI Engineer | Bridging Data Science and AgTech LinkedIn | GitHub
Disclaimer: This is a portfolio proof-of-concept. Real-world agricultural application of chemicals should always be verified by a certified human agronomist.
**Quer que eu te mande agora o link do dataset de folhas do Kaggle e o script curtinho do Google Colab para vocΓͺ treinar o seu YOLOv8 e gerar o arquivo `.pt` real para a pasta `data/models/`?**