Live Demo: goodfarm website
Project Video: https://www.youtube.com/watch?v=DidSeaS96NY
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.
Goodfarm is a multi-agent system leveraging the full Gemini 3 family:
- Autonomous Virtual Sensors (
gemini-3-pro-preview+ Google Search): Background Celery agents invoke Gemini withtools=[{"google_search": {}}]to act as virtual IoT sensors. It synthesizes real-time weather and commodity prices (e.g., in Lagos, Nigeria) without physical sensors. - Multimodal Identification (
gemini-3-flash-preview): Employs high-resolution vision processing to instantly identify crops and livestock from user uploads, bypassing manual data entry. - 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. - 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. - Stateful Multimodal Context: Uses
types.Contentto maintain a persistent history of text, images, and videos, functioning as a continuous farm manager rather than a stateless chatbot.
- 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.
- AI Engine: Google Gemini 3 (Pro, Flash, Image, Search)
- Backend: Flask (Python) + SQLAlchemy (SQLite)
- Environment:
python-dotenvfor 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.
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)
-
Clone the Repository:
git clone https://github.com/jerryblessed/goodfarm cd goodfarm -
Install Dependencies:
pip install -r requirements.txt
-
Set Environment Variables: Create a
.envfile 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 -
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
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.
