<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akshat</title>
    <description>The latest articles on DEV Community by Akshat (@thecuriouslad).</description>
    <link>https://dev.to/thecuriouslad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4162067%2F718c568b-2046-4ec5-9ff5-681f53c42b55.png</url>
      <title>DEV Community: Akshat</title>
      <link>https://dev.to/thecuriouslad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thecuriouslad"/>
    <language>en</language>
    <item>
      <title>AI Gardener: Spend 30 Seconds Here. Spend the Rest Outside.</title>
      <dc:creator>Akshat</dc:creator>
      <pubDate>Thu, 08 Oct 2026 07:05:36 +0000</pubDate>
      <link>https://dev.to/thecuriouslad/ai-gardener-spend-30-seconds-here-spend-the-rest-outside-2m9j</link>
      <guid>https://dev.to/thecuriouslad/ai-gardener-spend-30-seconds-here-spend-the-rest-outside-2m9j</guid>
      <description>&lt;p&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AI Gardener — Spend 30 seconds here. Spend the rest outside.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most gardening apps and AI chatbots do the exact opposite of touching grass: they keep you glued to your screen reading long encyclopedias, tweaking complex trackers, or scrolling through walls of generic AI text. I built &lt;strong&gt;AI Gardener&lt;/strong&gt; around a single rule: &lt;strong&gt;spend 30 seconds on the screen to see today's exact physical action, then close the app and go outside into your garden.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI Gardener is an open-source, multimodal gardening companion powered by local open-weight models (&lt;code&gt;gemma3:4b&lt;/code&gt; for structured reasoning and vision, and &lt;code&gt;nomic-embed-text&lt;/code&gt; for 768-dimensional semantic embeddings via Ollama), grounded with MongoDB Atlas Vector Search, and deployed live on Render.&lt;/p&gt;

&lt;p&gt;Instead of giving generic textbook advice, AI Gardener acts like a local agronomist that remembers your garden across days and weeks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Go Outside — Today's Next Actions Card:&lt;/strong&gt; At the very top of the dashboard, a dedicated action card surfaces the single next physical task for each of your active gardens (up to 3 concurrent gardens per user). You check what to do today in 30 seconds, walk outside, do the work in the soil, and mark it Done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sequential Multi-Day Lifecycle Progression:&lt;/strong&gt; Tasks are completed in real-world chronological order (&lt;code&gt;Day 1&lt;/code&gt;, &lt;code&gt;Day 2&lt;/code&gt;, &lt;code&gt;Day 3&lt;/code&gt;...). Once you finish your current batch of 5 tasks, a &lt;code&gt;Done — Generate Next Plan&lt;/code&gt; button unlocks, advancing your garden from &lt;code&gt;Day 1–5&lt;/code&gt; to &lt;code&gt;Day 6–10&lt;/code&gt; and transitioning your garden phase from &lt;code&gt;PLANTING&lt;/code&gt; to &lt;code&gt;GROWING&lt;/code&gt; and &lt;code&gt;MAINTENANCE&lt;/code&gt; without ever repeating completed tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hyper-Local Climate and Crop Grounding:&lt;/strong&gt; Growing tomatoes in Gorakhpur during winter fog (Rabi season) requires completely different care than growing hibiscus in Shimla or okra in Pune during the monsoon. I grounded the system in 2,174 curated plant health records across 76 crops and 70 agro-climatic records sourced from ICAR-CRIDA district contingency plans and meteorological authorities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimodal Leaf Photo Diagnosis:&lt;/strong&gt; When you are outside in your garden and notice yellow halos, leaf curl, or brown spots on a leaf, you snap a photo and upload it. Gemma 3's vision capability inspects the leaf, cross-checks our plant pathology and local climate vectors (such as morning fog increasing fungal blight risk), and automatically updates your daily task schedule with targeted recovery actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Who is it for?&lt;/strong&gt;&lt;br&gt;
Home gardeners, balcony and terrace growers, and beginners who want hyper-local, step-by-step physical tasks tailored to their exact city, square footage or pot count, daily sunlight hours, and season.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Deployed Application (Render):&lt;/strong&gt; &lt;a href="https://ai-gardener.onrender.com" rel="noopener noreferrer"&gt;https://ai-gardener.onrender.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Screenshots / Demo Video:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbykipdcltkgc9o04h8wt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbykipdcltkgc9o04h8wt.png" alt="AI Gardener login and sign-up screen on Render" width="800" height="423"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs95uinxdcuh32zk96b4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs95uinxdcuh32zk96b4r.png" alt="AI Gardener sunlight guardrail rejecting 100 hours of daily sunlight while preserving chickpea context" width="799" height="382"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40y8yodv2fj3uu6hcboe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40y8yodv2fj3uu6hcboe.png" alt="AI Gardener multi-garden dashboard showing Today's Next Actions card for Gorakhpur Tomato and Shimla Hibiscus gardens" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/the-curious-lad" rel="noopener noreferrer"&gt;
        the-curious-lad
      &lt;/a&gt; / &lt;a href="https://github.com/the-curious-lad/ai-gardener" rel="noopener noreferrer"&gt;
        ai-gardener
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🌱 AI Gardener — &lt;em&gt;Touch Grass&lt;/em&gt;
&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Hacktoberfest 2026 · Week 1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;An open-source AI gardening assistant that gets you off the screen and into the soil.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://nodejs.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fcc1fb293ab5f072fff22c59991434c614c5d72489cb0779c5f00674016befc0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6f64652e6a732d32302b2d3333393933333f6c6f676f3d6e6f64652e6a73266c6f676f436f6c6f723d7768697465" alt="Node.js"&gt;&lt;/a&gt;
&lt;a href="https://www.mongodb.com/atlas" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6dca90d96b485da0fc5f001af42f3922a35f4ac5be6176799e068b8450f63ff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f6e676f44422d41746c61732d3437413234383f6c6f676f3d6d6f6e676f6462266c6f676f436f6c6f723d7768697465" alt="MongoDB Atlas"&gt;&lt;/a&gt;
&lt;a href="https://ai.google.dev/gemma" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/012f13cc98eef64627198dfe8af62e0d8118e0e83b7e8d1d011c5fea4ea91144/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f47656d6d612d3325323034422d3432383546343f6c6f676f3d676f6f676c65266c6f676f436f6c6f723d7768697465" alt="Gemma 3"&gt;&lt;/a&gt;
&lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/987532c4a707fd19a018e523cc3f9f8935c7723226c1f2cc4aaf076b59a450cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d4f6c6c616d612d626c61636b3f6c6f676f3d6f6c6c616d61" alt="Ollama"&gt;&lt;/a&gt;
&lt;a href="https://render.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/333edf9357e9d4e9574f1b3ae619689f0892f4ccc332f49b4c59864f76b37700/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4465706c6f792d52656e6465722d3436453342373f6c6f676f3d72656e646572266c6f676f436f6c6f723d7768697465" alt="Render"&gt;&lt;/a&gt;
&lt;a href="https://github.com/the-curious-lad/ai-gardener/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667" alt="License: MIT"&gt;&lt;/a&gt;
&lt;a href="https://hacktoberfest.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9a81c3d5347047eb7e9eb086eabe713af7156194e2ac6f3cbdcf6084ae3e210a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4861636b746f626572666573742d323032362d464636413030" alt="Hacktoberfest"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ The Idea&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Most AI tools keep you glued to a screen.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AI Gardener flips that.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You spend 30 seconds telling it about your garden. It gives you one clear task for today. You go outside, do it, come back, and optionally snap a photo of your plant. The AI analyzes the photo, checks its knowledge base for diseases or care tips, and gives you tomorrow's task.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The screen is the shortest part of the experience.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🎯 Prize Categories&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;How We Qualify&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🏆 &lt;strong&gt;Overall (Touch Grass)&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Spend 30 seconds on the screen, spend the rest outside — built on open-weight &lt;code&gt;gemma3:4b&lt;/code&gt; and &lt;code&gt;nomic-embed-text&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🍃 &lt;strong&gt;MongoDB Atlas&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;4 collections (&lt;code&gt;garden_sessions&lt;/code&gt;, &lt;code&gt;users&lt;/code&gt;, &lt;code&gt;plant_health_knowledge&lt;/code&gt; with 2,174 records, &lt;code&gt;climate_location_knowledge&lt;/code&gt; with 70 records) + 768-dim&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/the-curious-lad/ai-gardener" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/the-curious-lad/ai-gardener" rel="noopener noreferrer"&gt;https://github.com/the-curious-lad/ai-gardener&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I built AI Gardener around a modular, provider-agnostic open-source AI architecture running &lt;code&gt;gemma3:4b&lt;/code&gt; and &lt;code&gt;nomic-embed-text&lt;/code&gt; locally on Ollama, backed by MongoDB Atlas for stateful session persistence and 768-dimensional vector retrieval, and hosted on Render.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Four-Stage Agentic Pipeline
&lt;/h3&gt;

&lt;p&gt;Every user message or photo upload flows through four specialized stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stage 1 — Intent-Aware Query Rewriter and Router (&lt;code&gt;queryRewriter.js&lt;/code&gt;):&lt;/strong&gt; Combines &lt;code&gt;gemma3:4b&lt;/code&gt; structured JSON extraction (validated with Zod schemas) with a deterministic regex signal extractor so explicit user inputs (cities, Indian states, sq ft/pots, sunlight hours, seasons, and plant names) are never dropped or re-asked. Initial garden planning requires all 5 essential context fields (plant, city/state, growing area, daily sunlight hours, and season), while general botany questions or photo observations bypass unnecessary context checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 2 — Dual-Collection Hybrid Vector Retrieval (&lt;code&gt;knowledgeVectorSearch.js&lt;/code&gt; and &lt;code&gt;climateVectorSearch.js&lt;/code&gt;):&lt;/strong&gt; Converts the normalized query into a 768-dimensional vector using &lt;code&gt;nomic-embed-text&lt;/code&gt; and queries two MongoDB Atlas collections in parallel: &lt;code&gt;plant_health_knowledge&lt;/code&gt; (2,174 records across 76 crops) and &lt;code&gt;climate_location_knowledge&lt;/code&gt; (70 district and agro-climatic zone records). For regional climate, it resolves a 4-tier geographic hierarchy: Exact Location Mapping -&amp;gt; Regional Climate -&amp;gt; Seasonal Context -&amp;gt; Country/Zone Fallback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 3 — Multimodal Photo Reader (&lt;code&gt;photoReader.js&lt;/code&gt;):&lt;/strong&gt; Uses &lt;code&gt;gemma3:4b&lt;/code&gt; vision to extract structured symptoms (&lt;code&gt;visibleSymptoms&lt;/code&gt;, &lt;code&gt;leafCondition&lt;/code&gt;, &lt;code&gt;possiblePestSigns&lt;/code&gt;, &lt;code&gt;possibleDiseaseSigns&lt;/code&gt;, &lt;code&gt;severity&lt;/code&gt;, and &lt;code&gt;confidence&lt;/code&gt;) from uploaded leaf photos, feeding those visual findings directly into the vector search and planner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 4 — Phase-Aware Planner (&lt;code&gt;plannerService.js&lt;/code&gt;):&lt;/strong&gt; Synthesizes user context, retrieved agronomic records, climate constraints, and completed task history to generate sequential daily tasks (&lt;code&gt;Day 1&lt;/code&gt; to &lt;code&gt;Day 5&lt;/code&gt;, then &lt;code&gt;Day 6&lt;/code&gt; to &lt;code&gt;Day 10&lt;/code&gt;, etc.) and manage lifecycle transitions (&lt;code&gt;PLANTING&lt;/code&gt; -&amp;gt; &lt;code&gt;GROWING&lt;/code&gt; -&amp;gt; &lt;code&gt;MAINTENANCE&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Multi-Layer Domain and Input Guardrails
&lt;/h3&gt;

&lt;p&gt;Small 4B parameter models can easily get derailed if a user enters impossible physical numbers, fictional places, or prompt injections. I built 5 deterministic guardrail layers around the Query Rewriter and Planner:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail 1 — Off-Topic, Length, and Prompt-Injection Fast-Path (0 LLM Calls):&lt;/strong&gt; Non-gardening queries (coding, sports, finance, cooking recipes), messages exceeding the 600-character limit, and prompt-injection attempts (such as "ignore previous instructions" or "reveal system prompt") are intercepted and refused in under 1 millisecond with zero LLM calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail 2 — Physical Sunlight Bounds Validation (1 to 16 Hours):&lt;/strong&gt; If someone enters an impossible value like 100 hours of daily sunlight or 0 hours, the guardrail rejects the invalid number while preserving the rest of their valid context, reminding them that a day only has 24 hours and asking for a realistic 1 to 16 hour daily sunlight figure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail 3 — Knowledge-Base Location Verification:&lt;/strong&gt; If a user enters an unrecognized or fictional place (like "Atlantis") that is not in our climate knowledge base, the system strips the invalid location and transparently asks the user for a supported city or Indian state instead of hallucinating climate data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail 4 — Supported Plant Verification:&lt;/strong&gt; Every requested plant is checked against our 76 verified CSV crops and supported Indian garden/ornamental plants. If someone asks to grow a non-plant item or unsupported species, the guardrail catches it immediately and suggests supported vegetables, herbs, fruits, and flowers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail 5 — Agronomic Low-Sunlight Mismatch Warnings:&lt;/strong&gt; When a user plans a sun-loving crop (such as tomato, sunflower, chilli, hibiscus, or rose) with less than 4 hours of daily sunlight, the Planner automatically prepends a Sunlight Heads-Up warning advising them to place movable containers in their brightest south- or west-facing spot.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Bounded Context Summarizer for Small Local Models
&lt;/h3&gt;

&lt;p&gt;Feeding an ever-growing chat history into a local 4B model quickly degrades instruction following and increases latency. I built a deterministic Context Summarizer (&lt;code&gt;contextSummarizer.js&lt;/code&gt;) that maintains a compact 7-line structured memory summary (&lt;code&gt;contextSummary&lt;/code&gt;) inside MongoDB while preserving the full raw &lt;code&gt;conversationHistory&lt;/code&gt; in the database. Every AI prompt receives only the compact summary plus the last 4 messages, keeping token counts flat and inference fast even after dozens of turns.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Engineering for Latency, Streaming Resilience, and a 371 MB -&amp;gt; 114 MB Memory Optimization
&lt;/h3&gt;

&lt;p&gt;Running an AI + Vector Search backend on Render's 512 MB RAM tier alongside a tunneled local Ollama instance surfaced real production challenges that I solved during development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cutting Memory Usage from 371 MB to 114 MB (69% Reduction):&lt;/strong&gt; Initially, Render was crashing with HTTP 502 Out-Of-Memory errors. Profiling heap memory revealed that parsing our 9.2 MB &lt;code&gt;plant_health_knowledge.csv&lt;/code&gt; fallback file character-by-character (&lt;code&gt;currentField += ch&lt;/code&gt;) created millions of V8 &lt;code&gt;ConsString&lt;/code&gt; sliced string references, ballooning heap + RSS memory to 371 MB. I rewrote &lt;code&gt;parseCSV&lt;/code&gt; in &lt;code&gt;src/utils/csvParser.js&lt;/code&gt; using zero-copy index slicing (&lt;code&gt;content.slice(fieldStart, i)&lt;/code&gt;) and flat UTF-8 buffer allocation, dropping CSV memory footprint from 371 MB down to 114 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Progressive Filter Relaxation in Vector Search:&lt;/strong&gt; Instead of loading all 2,174 documents into Node.js memory when a strict metadata filter returned 0 hits, I implemented progressive filter relaxation directly in MongoDB (&lt;code&gt;plant + knowledgeTypes&lt;/code&gt; -&amp;gt; &lt;code&gt;plant only&lt;/code&gt; -&amp;gt; bounded 200-document slice), keeping steady-state vector search RAM at just 63 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming NDJSON + Truncated JSON Auto-Repair:&lt;/strong&gt; When &lt;code&gt;gemma3:4b&lt;/code&gt; generated long 5-day plans over a tunnel, waiting for a single non-streamed HTTP response caused proxy idle timeouts. I switched &lt;code&gt;OllamaProvider&lt;/code&gt; to stream NDJSON tokens continuously (&lt;code&gt;stream: true&lt;/code&gt;), added automatic brace/quote stack balancing (&lt;code&gt;repairJsonCandidate&lt;/code&gt;) to recover truncated JSON outputs, and added a 24/7 hybrid deterministic fallback so the live Render app stays 100% functional even when my local laptop GPU is offline.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Building AI Gardener on open-weight models (&lt;code&gt;gemma3:4b&lt;/code&gt; and &lt;code&gt;nomic-embed-text&lt;/code&gt;) via Ollama proved four major advantages over closed proprietary APIs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;True Multimodal Privacy for Home Photos:&lt;/strong&gt; When users take photos of their backyard, balcony, or living space to diagnose a plant leaf, those images are processed on open weights under my control rather than being uploaded to a commercial third-party training pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Per-Token Cost for Multi-Step Agent Loops:&lt;/strong&gt; Each garden plan or photo diagnosis runs multiple structured steps (Query Rewriter -&amp;gt; 768-dim Embedding -&amp;gt; Dual Vector Retrieval -&amp;gt; Multimodal Vision -&amp;gt; Phase Planner). With open weights running locally on Ollama, iterating across hundreds of test turns and multi-day replans cost $0.00 in API fees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Control Over Small Models:&lt;/strong&gt; Because I could inspect every raw token stream from &lt;code&gt;gemma3:4b&lt;/code&gt;, I was able to build custom JSON stream repair, bounded 7-line context summarization, and domain guardrails that make a compact 4B open model perform reliably on consumer hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Edge + Cloud Resilience:&lt;/strong&gt; By combining a cloud web host (Render) and cloud vector database (MongoDB Atlas) with a tunneled local Ollama inference engine and deterministic agronomy fallbacks, the project demonstrates how solo developers can ship zero-cost, open-weight AI web apps to production.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full Agent Session Log (GitHub):&lt;/strong&gt; &lt;a href="https://github.com/the-curious-lad/ai-gardener/blob/main/AGENT_SESSION.md" rel="noopener noreferrer"&gt;https://github.com/the-curious-lad/ai-gardener/blob/main/AGENT_SESSION.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During my agentic pair-programming session in Google Antigravity, AI Gardener evolved from a basic single-session chat prototype into a hardened, production-grade multi-garden platform. Here is a summary of what our initial prototype looked like and the key engineering changes we made together:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;From Single Chat Prototype to Multi-Garden Lifecycle Management:&lt;/strong&gt;
We started with a single-session chat prototype, then redesigned the architecture to support lightweight user accounts, up to 3 concurrent gardens per user, a unified "GO OUTSIDE — TODAY'S NEXT ACTIONS" card across all active gardens, and strict sequential task completion (&lt;code&gt;Day 1–5&lt;/code&gt; -&amp;gt; &lt;code&gt;Done — Generate Next Plan&lt;/code&gt; -&amp;gt; &lt;code&gt;Day 6–10&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solving the Day 6+ Replan &amp;amp; Phase Regression Bug:&lt;/strong&gt;
When testing multi-week progression, we noticed &lt;code&gt;gemma3:4b&lt;/code&gt; sometimes repeated &lt;code&gt;Day 6&lt;/code&gt; labels or reset the phase back to &lt;code&gt;PLANTING&lt;/code&gt; on Day 6. We re-engineered the Planner prompt and deterministic post-processor to filter out completed task titles, enforce monotonic day numbering (&lt;code&gt;startDay + idx&lt;/code&gt;), and advance phases cleanly from &lt;code&gt;PLANTING&lt;/code&gt; -&amp;gt; &lt;code&gt;GROWING&lt;/code&gt; -&amp;gt; &lt;code&gt;MAINTENANCE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging Render's 512 MB OOM Crash (371 MB -&amp;gt; 114 MB):&lt;/strong&gt;
When deploying to Render, the server hit HTTP 502 Out-Of-Memory restarts. We profiled Node.js &lt;code&gt;process.memoryUsage()&lt;/code&gt; step-by-step, discovered that character-by-character CSV parsing on the 9.2 MB knowledge base was allocating 371 MB of V8 &lt;code&gt;ConsString&lt;/code&gt; objects, and rewrote the parser with zero-copy slicing to bring memory down to 114 MB (and 63 MB steady-state during vector search).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixing Proxy Timeouts with NDJSON Streaming &amp;amp; JSON Repair:&lt;/strong&gt;
Long structured outputs from local &lt;code&gt;gemma3:4b&lt;/code&gt; over a Cloudflare tunnel occasionally timed out or truncated mid-JSON. We switched &lt;code&gt;OllamaProvider&lt;/code&gt; to continuous NDJSON streaming, built a stack-based JSON auto-repair utility (&lt;code&gt;repairJsonCandidate&lt;/code&gt;), and added a clean one-click &lt;code&gt;Retry Sending&lt;/code&gt; button in the UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardening Security &amp;amp; Adding 5 Domain Guardrails:&lt;/strong&gt;
In our final pass, we removed the internal Pipeline Inspector from the client UI so raw server state is never exposed, added a 600-character input cap, and built 5 domain guardrails so unrealistic inputs (like "100 hours of sunlight" or unknown cities/plants) are caught and explained gracefully.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Overall Challenge Winner — Week 1: Touch Grass (Open-Source AI Innovation):&lt;/strong&gt; Built from the ground up with open-weight models (&lt;code&gt;gemma3:4b&lt;/code&gt; and &lt;code&gt;nomic-embed-text&lt;/code&gt; via Ollama) around the core motto "Spend 30 seconds here. Spend the rest outside." — turning local agro-climatic data, 2,174 plant pathology records, and leaf photos into immediate daily physical tasks in the garden.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Uses &lt;code&gt;gemma3:4b&lt;/code&gt; as both its structured JSON reasoning router/planner and its multimodal vision engine for leaf disease diagnosis, enhanced with custom JSON stream repair, 5 domain guardrails, and a bounded 7-line context summarizer designed specifically for a 4B parameter context window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Render:&lt;/strong&gt; Deployed live on Render (&lt;a href="https://ai-gardener.onrender.com" rel="noopener noreferrer"&gt;https://ai-gardener.onrender.com&lt;/a&gt;) and engineered specifically for Render's 512 MB RAM environment by reducing CSV parser memory from 371 MB to 114 MB, streaming NDJSON chunks to prevent proxy timeouts, and providing a 24/7 hybrid fallback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of MongoDB Atlas:&lt;/strong&gt; Uses MongoDB Atlas across 4 collections (&lt;code&gt;garden_sessions&lt;/code&gt;, &lt;code&gt;users&lt;/code&gt;, &lt;code&gt;plant_health_knowledge&lt;/code&gt;, and &lt;code&gt;climate_location_knowledge&lt;/code&gt;), combining stateful multi-garden lifecycle persistence with 768-dimensional &lt;code&gt;$vectorSearch&lt;/code&gt; retrieval across 2,174 plant health records and 70 hierarchical climate records.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thank you to the DEV team, MLH, DigitalOcean, Google DeepMind, Render, and MongoDB for hosting Hacktoberfest 2026 and championing open-source AI! Building this project solo was an awesome learning experience — now it is time for me to close my terminal, step outside, and touch some grass. 🌱&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
