DEV Community

Cover image for AgroCare AI - Touch Grass Edition
Tharusha Inuwara
Tharusha Inuwara

Posted on

AgroCare AI - Touch Grass Edition

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

I built AgroCare AI: Touch Grass Edition, a progressive web application designed to get gardeners, farmers, and plant enthusiasts off their screens and into the dirt.

AgroCare AI allows you to snap a quick photo of a sick plant, leaf, or fruit, and instantly receive a diagnosis alongside a rigid "Touch Grass" Care Schedule. Instead of generic paragraphs of advice, it generates an actionable 3-step physical mission (Day 1, Day 3, Day 7).

For example, a Day 1 instruction isn't "ensure proper drainage"—it's "Go outside right now, touch the soil 2 inches deep, and completely flush the pot with water until it drains out the bottom." It encourages you to step away from your device and physically interact with the real world.

Demo

Since farming happens outdoors where cell service is often spotty, AgroCare AI works offline. Try our demo to see the offline fallback mode in action!

Video Demo

GitHub Repository

Code

🌿 AgroCare AI: Touch Grass Edition

AgroCare AI is a fast, responsive, and offline-capable progressive web application that helps farmers and gardeners diagnose plant diseases instantly using AI.

Built with the "Touch Grass" philosophy in mind, this app doesn't just tell you what's wrong—it gives you a step-by-step physical action plan to treat the problem immediately so you can put your phone down and get your hands dirty.


✨ Key Features

  • Instant AI Diagnosis: Take a photo or upload an image of a sick leaf, fruit, or plant, and Google's Gemini AI will instantly diagnose the issue.
  • "Touch Grass" Care Schedules: Generates highly specific, actionable physical tasks to complete on Day 1, Day 3, and Day 7 to nurse your plant back to health.
  • Offline Fallback Mode: Farming happens outdoors! If your connection drops or the API is rate-limited, AgroCare AI automatically falls back to an in-browser…

How I Built It

AgroCare AI is built as an offline-capable React/Vite web app that utilizes a hybrid AI architecture:

  1. Cloud AI (Primary): Uses the Google Gemini API (@google/generative-ai) via strict prompt engineering to force structured JSON output containing the exact physical care schedules and diagnoses.
  2. Local Open-Source AI (Offline Fallback): Built around HuggingFace's Transformers.js (@huggingface/transformers). If the user loses internet connection in the field, or the API fails, a Web Worker automatically downloads an open-weight Vision Transformer (Xenova/vit-base-patch16-224) directly into the browser to classify the plant image entirely on-device and offline.

I also built an Intelligent Local Storage Manager to save the user's diagnosis history and compressed base64 images locally, ensuring their data is always available without an internet connection.

Why Does Open Innovation Matter?

Open innovation is the backbone of this project. While closed APIs like Gemini are fantastic for deep reasoning, they require a constant, strong internet connection. By combining a closed cloud API with an open-weight, in-browser AI model (Transformers.js), AgroCare AI becomes a truly resilient tool.

Open innovation makes it possible to take AI completely offline and into rural areas, greenhouses, and fields where it is actually needed most.

My Agent Session

(Note: If you saved your agent session with DevRelay, you can embed it here using the {% agent_session ... %} tag!)

Prize Categories

  • Google Gemini Category (Used Gemini API for the primary cloud reasoning and structured JSON schedule generation)
  • Hugging Face Category (Used Transformers.js for the offline open-weight model fallback in the browser)

Top comments (0)