{"slug": "soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt", "title": "Soil & Compost Doctor: The Offline Open-Source AI That Gets Your Hands in the Dirt", "summary": "A developer built Soil & Compost Doctor, an open-source, fully offline multimodal AI tool that diagnoses plant leaf diseases, soil deficiencies and compost stages from a photo using Meta's Llama 3.2 Vision via a local Ollama instance and ChromaDB retrieval over agricultural extension guidelines. The app runs entirely on localhost with no cloud calls and is designed to keep each interaction under 10 seconds, speaking its diagnosis aloud so gardeners can put their phones away.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass](https://dev.to/challenges/hacktoberfest-week1-2026-10-05)*\n\nMost software applications are designed to maximize user engagement and capture screen time. **Soil & Compost Doctor** was built with the exact opposite philosophy: **keep screen time strictly under 10 seconds per interaction** so people can put their phones away and literally **touch grass**.\n\nIt is a privacy-first, 100% offline-ready multimodal AI diagnostic tool designed for home gardeners, backyard composters, community growers, and plant enthusiasts.\n\n🔗 **GitHub Repository & Full Setup**: [https://github.com/Mustafa1765/Soil-Compost-Doctor](https://github.com/Mustafa1765/Soil-Compost-Doctor)\n\n💻 **Local Web App Interface**: `http://127.0.0.1:5000` *(Runs 100% locally on localhost with zero cloud dependency)*\n\n```\n [ In The Garden / Dirt on Hands ]\n                │\n         1. Snap Specimen 📸\n                ▼\n  [ Soil & Compost Doctor Web UI ]\n                │\n  • ChromaDB Local RAG (Agricultural Extension Data)\n  • Ollama Llama 3.2 Vision (100% Local Inference)\n                │\n                ▼ (⚡ 2.0s Latency)\n   [ 🔊 Speaks Diagnosis Aloud ]\n   \"Your plant has Early Blight. Prune lower foliage now and mulch.\"\n                │\n         2. Put Phone in Pocket\n                ▼\n    👉 [ Touch Grass & Garden! ]\n```\n\n`Leaf Health`\n`[✓] I did this physical task in the garden! 🎉 Hands back in the dirt. Phone put away.`\n`2.03s (Target Met! < 10s)`\n**\"Put your phone away and get your hands in the dirt.\"**\n\nAn open-source, local-first multimodal AI assistant designed to identify plant leaf diseases, diagnose soil deficiencies, evaluate compost decomposition stages, and deliver immediate physical outdoor tasks in under 10 seconds.\n\nTechnology usually keeps us glued to screens. **Soil & Compost Doctor is engineered to do the exact opposite**:\n\n👉 **Full Source Code**: [https://github.com/Mustafa1765/Soil-Compost-Doctor](https://github.com/Mustafa1765/Soil-Compost-Doctor)\n\n`app.py`)\n\n```\n# Pass garden photo & retrieved extension guidelines to local open-weight vision model\nresponse = ollama.chat(\n    model=\"llama3.2-vision\",\n    messages=[\n        {\"role\": \"system\", \"content\": system_prompt_with_rag_context},\n        {\"role\": \"user\", \"content\": \"Analyze specimen for immediate outdoor physical action.\", \"images\": [image_b64]}\n    ]\n)\n```\n\n`build_kb.py`)\n\n```\n# Query persistent local vector store for peer-reviewed extension guidelines\ncollection = chroma_client.get_collection(\n    name=\"soil_compost_kb\",\n    embedding_function=get_embedding_function()\n)\nresults = collection.query(query_texts=[\"dark concentric target spots on leaf\"], n_results=1)\n```\n\n`index.html`)\n\n```\n// Automatically read diagnosis aloud so gardeners don't touch screen with dirty hands\nconst utterance = new SpeechSynthesisUtterance(data.spoken_summary);\nutterance.rate = 1.0;\nwindow.speechSynthesis.speak(utterance);\n```\n\nThe entire application is constructed around **open-source AI and local on-device inference**:\n\n**Open-Weight Vision Model (Meta Llama 3.2 Vision via Ollama)**:\n\nWe harness `llama3.2-vision` running on a local [Ollama](https://ollama.com/) instance. The model inspects specimen images (leaf spot patterns, soil compaction fissures, compost moisture levels) directly on the local machine with zero external cloud calls.\n\n**Open-Source Vector Database (ChromaDB)**:\n\nWe use **ChromaDB** as a persistent local vector store (`./chroma_db`). It stores verified agricultural extension guidelines. When an inquiry is processed, ChromaDB performs vector similarity retrieval to ground the vision model's output in peer-reviewed horticultural practices, preventing hallucinations.\n\n**Deterministic Offline Embeddings (`embeddings.py`)**:\n\nTo ensure the app functions even when completely disconnected from the internet, we developed a deterministic domain embedding engine combining agricultural vocabulary projection and hashing tricks. It runs in milliseconds with zero dependencies on Hugging Face downloads.\n\n**Web Speech Synthesis API**:\n\nBuilt with native browser `window.speechSynthesis`, the app automatically speaks the diagnosis aloud the moment inference finishes, allowing gardeners to keep working without looking at the screen.\n\nOpen innovation isn't just a technical preference for this project—**it is the only reason the project can exist**:\n\n**Gardens and Allotments Don't Have Wi-Fi**:\n\nGardening, composting, and farming happen outdoors: in rural allotments, community plots, backyards, and greenhouses where cellular reception is weak or nonexistent. Closed cloud APIs (like OpenAI GPT-4o or Google Cloud Vision) immediately fail when there is no internet connection. By using open-weight models (`llama3.2-vision`) and local vector storage (` ChromaDB`), **Soil & Compost Doctor works in airplane mode in the middle of a forest**.\n\n**Zero Operating Cost for Community Gardeners & Students**:\n\nCommercial APIs charge per image and per token. For community garden clubs, students, or hobbyists, monthly API bills are a barrier to entry. Open-weight models running on Ollama cost **$0.00**.\n\n**Total Privacy & Land Sovereignty**:\n\nGardeners should not have to upload photos of their homes, yards, private properties, or crops to big tech cloud servers. Local AI ensures **not a single byte of image data leaves the user's machine**.\n\n**Hackability & Community Extension**:\n\nBecause the knowledge base is open code (`build_kb.py`), anyone in the open-source community can fork the repository, add their native flora or regional soil types, and customize the guidelines for their climate zone.\n\nDuring development, pair-programming with an advanced AI coding assistant enabled rapid architecture of:\n\n*Thank you for organizing the Hacktoberfest Open-Source AI Challenge! Now put your phone away, get outside, and touch grass! 🌿*", "url": "https://wpnews.pro/news/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt", "canonical_source": "https://dev.to/mustafa1765/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt-32k0", "published_at": "2026-10-08 18:12:58+00:00", "updated_at": "2026-10-08 18:19:35.256376+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "computer-vision", "ai-agents"], "entities": ["Soil & Compost Doctor", "Ollama", "Llama 3.2 Vision", "Meta", "ChromaDB", "GitHub", "Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt", "markdown": "https://wpnews.pro/news/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt.md", "text": "https://wpnews.pro/news/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt.txt", "jsonld": "https://wpnews.pro/news/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt.jsonld"}}