DEV Community

Cover image for Plant Your Planet | geospatial & temporal analytical guide
Dhwanan Bharadva
Dhwanan Bharadva

Posted on AI-assisted

Plant Your Planet | geospatial & temporal analytical guide

PlantMyPlanet

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


Built in collaboration with @rajan_patel_544aa43c80bfe

What I Built

PlantMyPlanet is a garden planner that starts with the ground under your feet, rather than relying on a generic plant list.

By dropping a pin, the app reads that spot's specific soil and climate data, matches it against the FAO EcoCrop catalog ($2,568$ crops), and determines what can actually thrive there. Once you pick a crop and choose a scale, it generates a stage-by-stage care plan to follow outdoors. A contextual chat advisor stays tied directly to your planting—tracking days in the ground, current growth stage, and logs from your garden.

It is designed for anyone who wants to grow something this season and is tired of receiving advice written for a climate they do not possess.

The Outdoor Loop:

  • Stand where you want to plant and mark the coordinates.
  • See which crops fit that soil pH, texture, rainfall, and temperature.
  • Plant one today and follow the checklist.
  • Come back with field observations—pests, moisture, leaves—and ask questions about that specific plant.

Demo & Local Setup

To run the application locally:

docker compose up -d
python db/ingest_ecocrop.py
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
Enter fullscreen mode Exit fullscreen mode

Code Repository


How I Built It

The recommendation engine does not simply "ask a model what to plant." The language model only engages after the empirical numbers are already computed.

  • Site Reading: For a given latitude and longitude, SoilGrids ($0–5\text{ cm}$: pH, clay, sand, silt, organic carbon, nitrogen, CEC, coarse fragments) and NASA POWER (temperature, rainfall, cloud cover) are fetched in parallel. Open-Meteo adds a $16$-day forecast, solar radiation, and elevation. These records consolidate into a single list of property rows.
  • Open-Source Classification: Laya, a local semantic router running on CPU, translates these numbers into the categories utilized by EcoCrop: texture (heavy / medium / light), fertility, drainage, and light (clear skies through heavy shade) without requiring a GPU or closed classifier API.
  • Matching: PostgreSQL stores the EcoCrop dataset. A crop is retained only if it satisfies hard bounds for latitude, elevation, temperature, rainfall, and pH. Survivors receive a $0-100$ suitability score derived from optimal growth ranges.
  • Open-Weight Advice: Plans and chat interactions route through OpenRouter, utilizing free open-weight models in fallback order:
    • NVIDIA Nemotron $3.5$ Lightning
    • Liquid LFM $2.5$ $1.2\text{B}$
    • Google Gemma (google/gemma-4-31b-it:free, google/gemma-4-26b-a4b-it:free)
  • Prompt Structure: The prompt is anchored in the planting context: crop type, days since planting, current stage, unfinished tasks, and recent field notes. If an API key is missing, plan generation falls back to a deterministic agronomic timeline instead of failing.

Tech Stack: Python, FastAPI, PostgreSQL $16$, lightweight HTML/JS frontend.


Why Does Open Innovation Matter?

A closed "what should I plant?" API obscures its reasoning, locking answers to the model owner. Here, the core logic is public and verifiable:

  • Open Datasets: SoilGrids, NASA POWER, Open-Meteo, and FAO EcoCrop are fully open. Users can inspect the pH, rainfall window, and crop limits to see why a plant was included or excluded.
  • Local Routing: Laya runs locally, meaning texture and drainage classifications do not depend on external vendor endpoints or GPU accounts.
  • Swappable Open Weights: Gemma and other free open-weight models serve as an intelligent voice on top of objective records, rather than acting as the source of the soil test itself.
  • Resilience: Removing API keys still leaves the deterministic matcher and fallback plans fully operational to guide what goes into the ground.

Prize Categories

  • Best Use of Gemma

Hacktoberfest #OpenSource #TouchGrass #PlantMyPlanet #Gemma #OpenWeightAI

Top comments (1)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •

Official Platform Update

Security protocols have been updated for all developer accounts.

  • tr.ee/dev-to