Skip to content

Jerryblessed/goodfarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


🌾 Goodfarm: Autonomous Farming Assistant

Precision Agriculture for the 99% — Virtualizing IoT with Gemini 3

🚀 Inspiration

475 million smallholder farmers globally are locked out of the $21.45B precision agriculture market because they cannot afford IoT sensors and infrastructure. Goodfarm democratizes precision farming. By replacing physical hardware with Autonomous Virtual Agents powered by Gemini 3, we provide real-time monitoring, market intelligence, and expert agronomy to any farmer with a basic smartphone or email account.

🧠 Gemini 3 Integration

Goodfarm is a multi-agent system leveraging the full Gemini 3 family:

  1. Autonomous Virtual Sensors (gemini-3-pro-preview + Google Search): Background Celery agents invoke Gemini with tools=[{"google_search": {}}] to act as virtual IoT sensors. It synthesizes real-time weather and commodity prices (e.g., in Lagos, Nigeria) without physical sensors.
  2. Multimodal Identification (gemini-3-flash-preview): Employs high-resolution vision processing to instantly identify crops and livestock from user uploads, bypassing manual data entry.
  3. Deep Reasoning (thinking_level="high"): For complex 4-day action plans, the system utilizes Gemini’s enhanced reasoning to process growth cycles and soil requirements, storing Thought Signatures to maintain logical continuity.
  4. 4K Asset Generation (gemini-3-pro-image-preview): Auto-generates professional-grade catalog imagery (1:1, 4K) for every farm category, ensuring a high-quality, consistent UI.
  5. Stateful Multimodal Context: Uses types.Content to maintain a persistent history of text, images, and videos, functioning as a continuous farm manager rather than a stateless chatbot.

🏗️ Architectural Diagram

Architectural Diagram


✨ Key Features

  • Virtual Farm Setup: Identify plants/animals via photo and auto-generate professional farming timelines using Gemini 3 Vision.
  • Autonomous Monitoring: Celery workers check weather/prices every 6 hours and update the dashboard via background AI agents.
  • Live Telemetry Dashboard: View "Virtual IoT" data (Temp, Market Price, Suggested Action) updated via automatic UI polling—no refresh required.
  • Two-Way Email Control: Receive critical alerts via email and reply directly to the email to chat with the AI (Syncs via IMAP every 5 minutes).
  • Multimodal Chat: Analyze crop health via video and image uploads with professional Markdown rendering via marked.js.

🛠️ Tech Stack

  • AI Engine: Google Gemini 3 (Pro, Flash, Image, Search)
  • Backend: Flask (Python) + SQLAlchemy (SQLite)
  • Environment: python-dotenv for secure secret management.
  • Task Queue: Celery + Redis (Autonomous scheduling & background agents).
  • Web Server: Gunicorn (Production-ready for Azure/Linux).
  • Communication: SMTP/IMAP (Two-way Autonomous Email).
  • Frontend: HTML5, CSS3, Vanilla JS + Marked.js (Markdown) + Live Polling.

📂 Project Structure

goodfarm/
├── app/
│   ├── routes/              # Modular Blueprints (Auth, API, Farm, Main)
│   ├── static/              # CSS, JS, and Architectural Diagrams
│   ├── templates/           # Jinja2 Templates (Marked.js integrated)
│   ├── utils/               # AI Engine, Google Drive, and Email helpers
│   ├── models.py            # Database Schema (Farms, Logs, Notifications)
│   ├── tasks.py             # Celery Task Logic (Weather, Price, Email Sync)
│   └── __init__.py          # App Factory & Celery configuration
├── config.py                # Configuration pulling from .env
├── celery_worker.py         # Celery entry point
├── run.py                   # Flask entry point
├── start.sh                 # Azure/Linux process manager (Gunicorn + Celery)
└── .env                     # Local secrets (Excluded from Git)

⚙️ Installation & Setup

  1. Clone the Repository:

    git clone https://github.com/jerryblessed/goodfarm
    cd goodfarm
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Set Environment Variables: Create a .env file in the root directory:

    SECRET_KEY=your_secret
    GEMINI_API_KEY=your_key
    REDIS_URL=redis://localhost:6379/0
    EMAIL_USER=your_gmail
    EMAIL_PASS=your_app_password
    DRIVE_FOLDER_ID=your_id
    
  4. Start Services:

    # Terminal 1: Redis
    redis-server
    
    # Terminal 2: Celery Worker
    celery -A celery_worker.celery worker --loglevel=info -P solo
    
    # Terminal 3: Celery Beat (Scheduler)
    celery -A celery_worker.celery beat --loglevel=info
    
    # Terminal 4: Flask
    flask run

🌍 Impact & Wow Factor

Goodfarm turns any phone into a precision agriculture hub. By replacing expensive hardware with Gemini 3 Virtual Sensors, we’ve created a solution that is Scalable, Hardware-Free, and Accessible even via basic email.


Goodfarm - Building the future of autonomous agriculture on Gemini 3.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors