Inspiration
Agriculture is the backbone of civilization, yet many farmers—especially in developing regions—lack access to expensive soil testing labs and expert agronomists. We were inspired by the potential of Generative AI to bridge this gap. We wanted to answer a simple question: What if a farmer could get an instant, expert-level analysis of their land just by pointing to it on a map? AgriVision AI was born from the desire to democratize precision agriculture, combining the accessibility of satellite maps with the reasoning power of modern AI.
What it does
AgriVision AI is an intelligent agricultural assistant that provides real-time farming insights. ✅ Geo-Spatial Analysis: Users select any coordinate on the global map. ✅ Instant Soil Assessment: The system synthesizes location data to generate a comprehensive soil health card, estimating pH levels, nutrient content (NPK), and organic matter. ✅ Crop Recommendations: It suggests the most viable crops based on the simulated soil profile and local climate conditions. ✅ AI Agronomist: A built-in chatbot allows users to ask follow-up questions about pest control, irrigation, and yield optimization, with context-aware responses based on the specific location selected.
How we built it
We built AgriVision AI as a modern, responsive web application using the PERN-like stack (minus the database for this MVP): ✅ Frontend: We used React with Vite for a blazing-fast development experience, styled with Tailwind CSS to create a premium, "glassmorphic" user interface. ✅ Mapping: We integrated Leaflet (via React-Leaflet) for the interactive global map layer. ✅ Intelligence: The core analysis is powered by Google's Gemini 1.5 Flash Model. We engineered complex prompts to force the LLM to act as an expert agronomist, returning data in structured JSON formats for the UI and natural language for the chat. ✅ Data Services: We used Open-Meteo API for real-time weather forecasts and Nominatim (OpenStreetMap) for geocoding.
Challenges I ran into
✅ Hallucination Control: Getting a Large Language Model to output strict, parseable JSON for the dashboard while remaining creative for the chat was difficult. We had to implement robust error handling and fallback parsing. ✅ API Coordination: Orchestrating multiple asynchronous calls (Weather, Geocoding, AI) to happen simultaneously without blocking the UI required careful state management. ✅ CORS Issues: Accessing certain public APIs directly from the browser led to Cross-Origin Resource Sharing errors, which we solved by setting up local proxy configurations.
Accomplishments that I'm proud of
✅ The UI/UX: We created an interface that feels like a futuristic "Mission Control" center, using dark modes and animations to make the data pop. ✅ Context-Aware Chat: The chatbot doesn't just answer generic questions; it "knows" the soil data of the selected location. ✅ Robustness: We built a resilient system that degrades gracefully, providing meaningful feedback even when external data services might be temporarily unavailable.
What I learned
✅ Prompt Engineering is Engineering: We learned that the difference between a good AI response and a great one lies in the precision of the system instructions. ✅ The Power of Context: AI models feature significantly better performance when fed real-time environmental context rather than checking them in isolation.
What's next for AgriVision AI
✅ Real Satellite Imagery: Integrating Sentinel-2 or Landsat API to perform actual spectral analysis. ✅ Offline First: Implementing PWA capabilities for farmers in remote areas. ✅ Community Data: Allowing farmers to upload actual soil test tags to fine-tune the predictions.
Built With
- css3
- frontend
- html5
- javascript
- leaflet.js
- react
- react-leaflet
- tailwind
- tool
- typescript
- ui)
- vite