# Soil & Compost Doctor: The Offline Open-Source AI That Gets Your Hands in the Dirt

> Source: <https://dev.to/mustafa1765/soil-compost-doctor-the-offline-open-source-ai-that-gets-your-hands-in-the-dirt-32k0>
> Published: 2026-10-08 18:12:58+00:00

*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass](https://dev.to/challenges/hacktoberfest-week1-2026-10-05)*

Most 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**.

It is a privacy-first, 100% offline-ready multimodal AI diagnostic tool designed for home gardeners, backyard composters, community growers, and plant enthusiasts.

🔗 **GitHub Repository & Full Setup**: [https://github.com/Mustafa1765/Soil-Compost-Doctor](https://github.com/Mustafa1765/Soil-Compost-Doctor)

💻 **Local Web App Interface**: `http://127.0.0.1:5000` *(Runs 100% locally on localhost with zero cloud dependency)*

```
 [ In The Garden / Dirt on Hands ]
                │
         1. Snap Specimen 📸
                ▼
  [ Soil & Compost Doctor Web UI ]
                │
  • ChromaDB Local RAG (Agricultural Extension Data)
  • Ollama Llama 3.2 Vision (100% Local Inference)
                │
                ▼ (⚡ 2.0s Latency)
   [ 🔊 Speaks Diagnosis Aloud ]
   "Your plant has Early Blight. Prune lower foliage now and mulch."
                │
         2. Put Phone in Pocket
                ▼
    👉 [ Touch Grass & Garden! ]
```

`Leaf Health`
`[✓] I did this physical task in the garden! 🎉 Hands back in the dirt. Phone put away.`
`2.03s (Target Met! < 10s)`
**"Put your phone away and get your hands in the dirt."**

An 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.

Technology usually keeps us glued to screens. **Soil & Compost Doctor is engineered to do the exact opposite**:

👉 **Full Source Code**: [https://github.com/Mustafa1765/Soil-Compost-Doctor](https://github.com/Mustafa1765/Soil-Compost-Doctor)

`app.py`)

```
# Pass garden photo & retrieved extension guidelines to local open-weight vision model
response = ollama.chat(
    model="llama3.2-vision",
    messages=[
        {"role": "system", "content": system_prompt_with_rag_context},
        {"role": "user", "content": "Analyze specimen for immediate outdoor physical action.", "images": [image_b64]}
    ]
)
```

`build_kb.py`)

```
# Query persistent local vector store for peer-reviewed extension guidelines
collection = chroma_client.get_collection(
    name="soil_compost_kb",
    embedding_function=get_embedding_function()
)
results = collection.query(query_texts=["dark concentric target spots on leaf"], n_results=1)
```

`index.html`)

```
// Automatically read diagnosis aloud so gardeners don't touch screen with dirty hands
const utterance = new SpeechSynthesisUtterance(data.spoken_summary);
utterance.rate = 1.0;
window.speechSynthesis.speak(utterance);
```

The entire application is constructed around **open-source AI and local on-device inference**:

**Open-Weight Vision Model (Meta Llama 3.2 Vision via Ollama)**:

We 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.

**Open-Source Vector Database (ChromaDB)**:

We 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.

**Deterministic Offline Embeddings (`embeddings.py`)**:

To 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.

**Web Speech Synthesis API**:

Built 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.

Open innovation isn't just a technical preference for this project—**it is the only reason the project can exist**:

**Gardens and Allotments Don't Have Wi-Fi**:

Gardening, 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**.

**Zero Operating Cost for Community Gardeners & Students**:

Commercial 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**.

**Total Privacy & Land Sovereignty**:

Gardeners 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**.

**Hackability & Community Extension**:

Because 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.

During development, pair-programming with an advanced AI coding assistant enabled rapid architecture of:

*Thank you for organizing the Hacktoberfest Open-Source AI Challenge! Now put your phone away, get outside, and touch grass! 🌿*
