DEV Community

Cover image for I Built an AI Gardening App That Tells Me to Put the Laptop Down
Shubhra Pokhariya
Shubhra Pokhariya

Posted on AI-assisted

I Built an AI Gardening App That Tells Me to Put the Laptop Down

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

Coding is my thing. Gardening is a part of who I am.

I have hundreds of pots, and I know my plants through the little things they show me. I notice which ones respond well to buried banana peels, which seem happier with used tea granules or old buttermilk, and which need my lunch-box system instead of raw kitchen scraps buried around them. I watch their leaves, new growth and flowers.

I do not need an app to tell me how to care for my own plants. That understanding comes from spending time with them. But it made me think about how a tool could help someone who is still learning to notice these things.

For a long time coding and gardening lived in different corners of my day. I would code for hours, then walk away from the screen to be with my plants, and the two never really met. This challenge gave me a reason to put them in the same room. So first, thank you to the DEV team and everyone behind it. You gave me the opportunity to write code about the thing I love most, and I enjoyed every hour of it.

The question I almost asked an AI

On 30 September I moved my marigold out of a shady, bright corner and into the open sun. The corner was there to keep the heavy rain off it. It grew from a cutting of a plant that came up by itself from last year's seeds, so it already feels a little like family.

On 5 October I counted about three open flowers and three buds. On 9 October I counted seven open flowers and five buds.

My first thought was to ask an AI why.

An answer would have been easy to get and easy to believe. But the sun, rain and time passing had all played a part, and I couldn't tell which one made the difference. Neither could an AI. So I asked a different question. Not "why is my plant doing this?" but "what should I look at before I change anything?"

That question became Garden Trials.

What I Built

Garden Trials is a small app that runs entirely on your own computer. The whole idea fits in one line, which is look first, change one thing, let the garden answer.

I do not like screens near my plants. When I am with them I want my hands in the soil and my phone away. Sometimes a bloom looks so good that I click a photo, for myself and for other plant lovers. So I built the app the way I wish gardening tools worked. It talks to me before and after, and in the middle it asks me to put the laptop down and go and look.

  1. I write a note about a plant and the day I saw it. A local Gemma model reads it into plain facts.
  2. The app asks me to check one specific thing on the plant. Until I write down what I found, it will not suggest anything.
  3. I either watch, or pick one change from a small fixed menu, ideally leaving a similar plant alone to compare.
  4. I count and take a photo. The app shows me the last photo so I can match the angle.
  5. I get a table, a chart, a verdict, an evidence level from 0 to 3, and one plain next step.

It is not a plant doctor. It never says what is wrong with a plant, and it never says what caused a result.

Garden Trials is for gardeners who are still learning to read their plants, and for anyone who wants to check their assumptions rather than jump to conclusions. It brings observations, follow-up checks, simple experiments and evidence tracking into one process. Instead of just recording what happened, it helps gardeners look at what changed, what else might have affected the result, and what their observations can actually tell them. It is not meant to replace the understanding that grows from spending time with plants, but to encourage closer observation.

The Look First box asking me to go and check the plant before anything else

Demo

The quickest way in is the sample garden. Tick "Try the illustrative sample garden" in the sidebar and you can walk through the whole loop with made-up plants. Nothing from it is ever saved to a real garden.

The sample garden, clearly labelled as made up

Code

GitHub logo shubhrapokhariya / garden-trials

Local Gemma 3 1B app (Ollama + Streamlit) that sends gardeners back to their plants to look first, helps them test one change at a time, and assigns each result an evidence level from 0 to 3.

🌱 Garden Trials

Look first. Change one thing. Let the garden answer.

A small local app for gardeners. A Gemma model running on your own laptop helps you write down what you see and asks one thing to go and check on the plant. Plain Python builds the experiment, keeps the records and works out how much the evidence really shows. The app never says what caused a result.

Built for the Hacktoberfest Open-Source AI Challenge, Week 1: Touch Grass.

Demo video (48 seconds, no sound): https://youtu.be/Rm7X4btlZVk

Quickstart

  1. Install Python 3.11 or newer and Ollama. The tests were run on Python 3.11.
  2. Download the code, then in its folder run:
python -m pip install -r requirements.txt
ollama pull gemma3:1b
python -m streamlit run app.py
Enter fullscreen mode Exit fullscreen mode

On Windows you can double-click run.bat instead. On macOS or Linux, run bash run.sh. Both scripts still start the app if Ollama is missing…

Setup is in the README: Python 3.11 or newer, Ollama, ollama pull gemma3:1b, then python -m streamlit run app.py. The folder examples/my-garden/ holds my real notes, counts and photos from this week. Start the app with GARDEN_DIR=examples/my-garden and you can read them without touching your own data.

My real garden, this week

Petunia

On 7 October I counted two open flowers, one spent flower, four buds and a lot of tiny buds forming. I took photos and counts on 7, 8, 9 and 10 October, but I only opened the app on the 10th, so I typed the first three days in afterwards. The app marks those entries as backfilled, which is exactly what they are. It is also why the trial says it started on 10 October.

When I saved the 7 October note, Gemma's reading dropped a number, so the app threw the reading away and kept my words exactly as I wrote them. Then Gemma's Look First question turned out to be about pests or disease, which I had never mentioned. The app blocked it and asked its own question instead:

Count the open flowers and the buds right now. Do the newest shoots have buds?

My note kept exactly as written. The app rejected Gemma's reading, so the line shown is my own words.

I went and looked on the 10th. Four open flowers, two bright ones on top and two darker ones lower down that had just opened, and small buds at the tips of the shoots.

Date Open flowers Buds Note
7 Oct 2 4 Front view. One spent flower not counted.
8 Oct 2 4 Removed the spent flower. Photo from above.
9 Oct 2 4 Buds clearly bigger and longer.
10 Oct 4 2 Two buds opened. Bright sun, so the reds look brighter.

Petunia on 7 October (left) and 10 October (right)

I removed one spent flower on the 8th. That was routine upkeep, not a test, but I want to say so. There was no comparison plant, and petunia buds open on their own anyway. The app gave this evidence level 0 and said it plainly. No change was made during these counts, so it shows what the plant did while I watched and says nothing about a cause.

The petunia table and chart, with entries marked backfilled

The two new flowers opened darker and more velvety than the older ones. I read that a new petal is still small and tightly folded, so its colour is packed close together, and that as the flower opens fully and stretches out, the same colour spreads over a bigger petal and looks lighter. So I guess that is what I am seeing.

Marigold

The 5 October photo was taken for myself, not for the trial. I clicked it just because the plant looked lovely, from the side, and only later decided to use it here. One bud is partly cut off at the edge. The 9 October photo is the one I took for the trial, from above, where every flower and bud can be seen. My first count may have missed buds I could not see from the side, so the jump from 3 to 7 open flowers is in my notes, but it is not a fair comparison. A few petals also looked flattened after some rain. The rain may be the reason, but that is a guess.

Marigold on 5 October from the side (left) and on 9 October from above (right)

Bougainvillea

Five cuttings, about a month and a half old, in the same soil and the same small black nursery bags on the same bench. One of them already has two pink flowers and the other four have none. Its mother plant is in full bloom, while my other bougainvilleas are only starting. My guess, not tested, is the variety or the time of year. The cuttings are different varieties, so "same soil, same bench" is not a fair test. A real test needs cuttings of the same variety, taken at the same time from different mother plants.

Five bougainvillea cuttings, one with pink flowers

How I Built It

The stack is small on purpose: Streamlit, one JSON file, and gemma3:1b running locally through Ollama. I picked the 1B Gemma model to find out whether this idea works on an ordinary laptop with no cloud account. On a laptop CPU an answer can take up to a minute.

Gemma has three jobs. It reads my note into plain facts, suggests one thing to go and check, and picks one change from a short menu. Everything that has to be reliable lives in plain Python, because I treat the model's output the way I would treat any untrusted input.

  • If a number from my note is missing in Gemma's reading, the reading is rejected and my exact words are kept.
  • Details Gemma adds that I did not write are removed by a word-match check. It is a loose check, so it can miss some.
  • The cause field is forced to "unknown" in code.
  • Pest and disease questions are blocked unless I raised them first.
  • Trials come from a fixed menu that is filtered per plant. "Water more" is never offered for bougainvillea, which likes to stay on the dry side.
  • Verdicts and evidence levels are calculated by code, never by Gemma. Level 3 needs two finished trials of the same change, each with a comparison plant and nothing else changed, all pointing the same way.
  • Saves go to a temporary file first and are then swapped in. A garden file that cannot be read is moved aside and never overwritten.

The tests replace Gemma with fake and deliberately bad answers, such as garbage, dropped numbers, invented pests, off-menu picks. A second set drives the real pages end to end. There are 85 tests, and none of them needs Ollama.

What went wrong

The model did not behave in my own garden. Gemma's reading of all three of my notes was rejected by the number check, and one of its three questions was blocked.

The sidebar panel showing three dropped numbers and one blocked question

The other two questions got through, and they were generic. "Is the plant's stem straight?" had nothing to do with what I was seeing, so I wrote down what I actually noticed. The guards block invented pests. They cannot make a small model's question a good one. They also only catch the failures I thought of, and the checks match English words, so notes in Hindi are not checked the same way. In my real garden Gemma only read my notes and wrote Look First questions. Both of my real trials were watch-only, so it never picked a trial there.

Why Does Open Innovation Matter?

Gemma runs on my laptop through Ollama. There is no API key, no usage bill and no cloud AI call. My notes and photos sit in a folder on my own machine, and the photos are saved without their location data. Setup needs the internet once, to download the packages, Ollama and the model, and I switched off Streamlit's anonymous usage statistics.

Running Gemma locally let me build and test this idea without an API key and without paying for every request. I could try it as often as I liked, and if a better small model arrives, I change one setting (OLLAMA_MODEL) and the rest of the app stays as it is. The small model had clear limitations, which I describe above, but that was part of what I wanted to learn, which is how far an open model can take this idea on an ordinary laptop, with ordinary code checking its output. The experiment showed me both the value of running a model locally and the limits of relying on its answers.

What I took away

The point of the app is what happens when I close the laptop. It asks me to go and look, and I stand there with the plant and nothing else. It cannot tell whether I really went outside, and I will not pretend it can. That pause is a promise I make to myself.

The AI can suggest what to look at. The garden gives the answer.

Thank you for reading, and thank you again to the DEV team for a challenge that let me bring the two things I love together.

Prize Categories

Best Use of Gemma

Top comments (18)

Collapse
 
leob profile image
leob •

Wow that Bougainvillea - so small, and already having flowers!

You gotta have superb green fingers, or maybe you're even a Plant Whisperer - if you ever grow tired of programming, a second career as a farmer or horticulturist is surely an option! :-)

Collapse
 
technogamerz profile image
𝐓𝐡𝐞 𝐋𝐚𝐳𝐲 𝐆𝐢𝐫𝐥 • • Edited

I love Bougainvillea too.

I like tree so much!

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

Such a beauty! Bougainvilleas have a charm of their own, don't they? This is the mother plant of the little bougainvillea I shared in my post. It's blooming right now! 😊

Thread Thread
 
leob profile image
leob •

Very very nice !!

Collapse
 
leob profile image
leob •

Gorgeous !!

Thread Thread
 
shubhradev profile image
Shubhra Pokhariya •

Thank you, Leob! 😊 It's lovely seeing it bloom.

Thread Thread
 
technogamerz profile image
𝐓𝐡𝐞 𝐋𝐚𝐳𝐲 𝐆𝐢𝐫𝐥 • • Edited

I have some image...

This one (lemon)

Thread Thread
 
shubhradev profile image
Shubhra Pokhariya •

Divya, you have so many trees! Looking at all these pictures, it feels like you have your own farm! So lovely to see so much greenery and all those trees! 😊

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

I wish I had such green fingers! 😊 That little bougainvillea surprised me too. A Plant Whisperer, though? I like the sound of that! I'm still learning, and my plants surprise me more often than I can explain! I don't think I'll get tired of programming anytime soon, but I guess my garden has other plans for me! 🌱 Thanks for such a lovely comment!

Collapse
 
technogamerz profile image
𝐓𝐡𝐞 𝐋𝐚𝐳𝐲 𝐆𝐢𝐫𝐥 •

As a plant lover, I love this so, so much! ❤️ Wow! You actually made this? It looks like heaven, with all those beautiful flowers everywhere! 🌸🌷🥹 It's seriously so beautiful and amazing! I really, really love it, and your project is SO COOL! ❤️✨

I have a tree too, named Arjun. 🌴❤️ It's a coconut tree, and it's REALLY, REALLY tall! 🌴🌿

Thank you so much for sharing this with us! ❤️ For someone who loves plants and flowers so much, this feels like a little piece of paradise! 🌸🕊️💕

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

Thank you so much, Divya! ❤️ I'm so happy you liked it! It makes me happy to share a little piece of my garden with fellow plant lovers. 🌸 And Arjun is such a fitting name for a coconut tree! 🌴❤️ Thank you for such a sweet comment! 😊

Collapse
 
leob profile image
leob •

I have a tree too, and it's a palm tree but not a coconut tree - and pretty tall as well, but most likely not as tall as your coconut tree ...

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

Now I'm picturing both trees standing next to each other! 🌴😊

Collapse
 
hemapriya_kanagala profile image
Hemapriya Kanagala •

Shubhra, this is so cool! I love how you brought your love for coding and gardening together. All the best with the challenge 😃

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

Thank you so much, Hema! ❤️ It felt really special to bring these two things I love together. And thank you for the good wishes for the challenge! 😊🌱

Collapse
 
kaashviw3spaces profile image
Kaashvi •

a great submission for the weekly challenge thingy hehe
(plus im going to use it)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.