Inspiration
I grew up visiting my grandfather's farm in Tamil Nadu, India. Every season, I watched him walk the entire field under the hot sun, spraying pesticides blindly across all 40 acres. Half the chemicals went on healthy crops. Half the beneficial insects died. The soil got worse every year. He spent ₹50,000 per season on chemicals alone.
When I read about the Google Cloud Rapid Agent Hackathon, I knew I had to build something for farmers like him. Not another dashboard. Not another chatbot. An agent that actually does the work — scans fields from space, spots problems before they spread, and dispatches drones to treat only the affected spots.
What It Does
FarmMind AI is an autonomous precision agriculture agent. It monitors farm fields via satellite imagery, detects weeds and pests using Gemini AI, plans precision treatments, and dispatches drones — all while keeping the farmer in control with a single approval click.
The farmer opens the Field Scans page, drops a pin on their farm location, and the agent does everything else. It fetches satellite imagery from Planet Labs, analyzes it with Gemini to detect specific weed species like Amaranthus or pest infestations like Aphids, estimates the affected area, and plans an optimal drone route. The farmer sees exactly what was found, where it is on the map, how much it will cost, and clicks "Approve" to dispatch treatment.
Every action is automatically logged for organic compliance. The Treatment History page shows completed deliveries, cost savings, and flight safety margins. The Compliance Logs page generates a complete digital audit trail with unique IDs for every scan, treatment, and inventory change — fully certified for India Organic and NPOP standards.
How We Built It
Frontend: We built a clean, Perplexity-style React interface with a sidebar navigation across five pages — Home, Field Scans, Treatment History, Compliance Logs, and Settings. The Field Scans page integrates Google Maps for location selection and satellite readout visualization.
Backend: FastAPI handles all API endpoints. When a farmer confirms their location, the backend triggers a multi-step agent workflow. It fetches satellite imagery from Planet Labs, sends it to Gemini for multimodal analysis, stores detections in MongoDB, checks inventory levels, plans treatment routes, and logs compliance actions.
AI Brain: Google Gemini 3 powers the perception and reasoning layer. We configured function calling so Gemini can invoke tools automatically — analyzing imagery, storing detections, planning routes, and checking inventory without human intervention between steps.
Data Layer: MongoDB Atlas stores everything — field boundaries as GeoJSON, detection records with confidence scores, treatment histories, inventory levels, and compliance logs. We integrated MongoDB through their MCP server, exposing tools like get_field_data, store_detection, plan_treatment_route, and log_compliance_action that Gemini calls directly.
ML Observability: We integrated Arize to monitor Gemini's prediction accuracy. Every detection is logged with confidence scores. Over time, Arize tracks whether predictions were correct, monitors for model drift, and alerts if accuracy drops below 85%. This ensures the agent stays trustworthy as it scales across thousands of farms.
Autonomous Loop: The agent follows a clear perceive-reason-plan-act-learn cycle. It perceives through satellite imagery, reasons with Gemini AI, plans treatments with cost optimization, acts through drone dispatch after farmer approval, and learns from seasonal data to improve future recommendations.
Challenges We Ran Into
Getting satellite imagery to work reliably was harder than expected. Planet Labs API has rate limits and cloud coverage issues. We solved this by caching recent imagery and falling back to pre-downloaded tiles for the demo while keeping the live integration ready for production.
Integrating MCP servers was new territory. Getting Gemini to correctly invoke MongoDB tools through the MCP protocol took multiple iterations. We had to carefully structure the function schemas so Gemini understood when to call store_detection versus plan_treatment_route.
Making the agent truly autonomous while keeping farmer trust was a balancing act. We didn't want the drone flying without permission. So we designed the approval gate — the agent plans everything, presents the full treatment plan with cost breakdown, and only dispatches after explicit farmer confirmation.
Accomplishments That We're Proud Of
We built a complete autonomous agent in five days that goes from satellite imagery to drone dispatch with just one human approval. The cost savings are real — targeting 2.3 acres instead of spraying 85 acres cuts pesticide use by over 90% and saves the farmer roughly ₹47,000 per treatment.
The compliance automation is something we are especially proud of. Every scan, every treatment, every inventory change generates an immutable audit log. For organic farmers who need certification, this eliminates weeks of manual paperwork.
Our Arize integration means the agent gets better over time. It tracks its own accuracy, detects when it is making mistakes, and adjusts. This is not a static model — it is a learning system.
What We Learned
We learned that the gap between AI research and real-world agriculture is massive. Farmers don't need better chatbots. They need agents that handle the full workflow — from detection to action — while keeping them in the loop.
We also learned that MCP is genuinely powerful. Being able to expose database operations as tools that an AI model can invoke changes how you architect applications. It is not API calls anymore. It is an agent with superpowers.
Geospatial data is harder than it looks. Converting pixel coordinates from satellite images to real-world lat/lng for map overlays, calculating acreage from polygon areas, handling different coordinate reference systems — all of this taught us respect for GIS engineering.
What's Next for FarmMind AI
Real drone integration: Connect DJI Agras SDK for actual autonomous flight control instead of simulation.
Multi-spectral imaging: Integrate NDVI and thermal sensors for early disease detection before visible symptoms appear.
Predictive analytics: Use seasonal data to predict pest outbreaks before they happen, enabling preventive treatments.
Farmer network: Build a collaborative intelligence layer where anonymized detection data from thousands of farms improves the global model through federated learning.
Voice interface: Add voice commands in regional languages so farmers can interact with the agent while working in the field.
Built With
- css
- fastapi
- firebase
- gcp
- gemini
- html
- javascript
- mangodb
- node.js
- react
- typescript
Log in or sign up for Devpost to join the conversation.