Gemini 3 Integration -
1. Multimodal Identification (gemini-3-flash-preview)
To catalog inventory instantly, we pipe user uploads to the Flash model using media_resolution_high and thinking_level="minimal". It analyzes visual features and returns structured JSON identifying the species and scientific name, bypassing manual data entry.
2. Autonomous Monitoring (gemini-3-pro-preview)
Background Celery agents act as virtual sensors by invoking Gemini with tools=[{"google_search": {}}]. Instead of IoT hardware, the AI actively searches for local weather and daily commodity prices, synthesizing live web data into actionable farming alerts.
3. Deep Reasoning & Planning
For complex advisory tasks, we utilize thinking_level="high". This enables the model to "think" through growth cycles, soil requirements, and historical data before generating 4-day action plans. Thought signatures are stored to maintain logic across sessions.
4. 4K Asset Generation (gemini-3-pro-image-preview)
The application auto-generates professional visual assets using text-to-image. With aspect_ratio="1:1" and image_size="4K", the system populates the database with consistent, high-quality imagery for every crop or animal.
5. Stateful Context
The chat engine uses types.Content to preserve conversation history. This allows the AI to reference past interactions and analyzed media, functioning as a continuous farm advisor rather than a stateless chatbot.
Inspiration
475 million smallholder farmers globally face high IoT costs and infrastructure barriers preventing precision agriculture adoption. While the precision farming market is projected to reach $21.45 billion by 2032, 84% of the world's 570 million farms are under 2 hectares and cannot afford traditional smart farming equipment.
We envisioned a solution where farmers could access autonomous monitoring without expensive sensors, internet-dependent devices, or technical expertise. By replacing physical IoT with virtual agents powered by AI, farmers simply photograph their crops and receive real-time guidance—democratizing precision agriculture for those who need it most.
What it does
Goodfarm is an autonomous farming assistant that runs farms virtually through:
Virtual Farm Setup: Users select crops/livestock from our AI-generated catalog or upload images for automatic identification using Gemini 3 Vision. The system researches growth cycles, generates professional category images, and creates personalized farming timelines.
Autonomous Monitoring Agents: Background Celery workers continuously:
- Check weather conditions via Google Search every 6 hours
- Track market prices daily
- Update growth stages weekly
- Send email alerts for critical issues
Multimodal Chat Interface: Farmers interact through:
- Text conversations with context-aware AI
- Image/video uploads for crop health analysis
- Markdown-formatted advice with actionable recommendations
- Persistent chat history across devices
Real-Time Telemetry: Dashboard displays live temperature, humidity, market prices, and 4-day action plans—all fetched through AI-powered web search rather than physical sensors.
Email Integration: Farmers receive notifications and can reply via email, which automatically feeds back into the AI conversation system.
How we built it
Tech Stack:
- Backend: Flask + SQLAlchemy (SQLite), Flask-Login, Celery Beat for scheduling
- AI Engine: Google Gemini 3 Pro (with Search, Vision, and Image Generation)
- Storage: Google Drive API for category images, Redis for caching/task queue
- Email: SMTP/IMAP for autonomous notifications and two-way communication
- Frontend: Server-rendered HTML with vanilla JavaScript
Architecture:
- Category Management: AI identifies plants/animals from photos, generates 4K catalog images, and researches growth flows
- Autonomous Agents: Celery tasks run scheduled checks using Gemini 3 + Google Search for weather/prices
- Conversation Engine: Maintains persistent multi-turn dialogue with thought signatures for enhanced reasoning
- Notification System: Priority-based alerts delivered via email with chat history integration
Challenges we ran into
Google Drive Timeouts (CRITICAL): Initial Drive API calls frequently timed out on Windows due to SSL handshake delays, causing 500 errors when loading category images.
Solution: Through divine inspiration and experimentation in AI Studio, we:
- Implemented
httplib2.Http(timeout=60)with properAuthorizedHttpwrapper - Added TTL-based image caching (
cachetools) to avoid repeated Drive hits - Built a streaming proxy endpoint with 15-second timeouts and fallback placeholders
Accomplishments that we're proud of
✅ Zero Hardware Required: Achieved precision farming capabilities without a single physical sensor
✅ Truly Autonomous: Background agents monitor 475M+ potential users' farms 24/7
✅ Multimodal Intelligence: Integrated vision, search, and reasoning in one unified system
✅ Email-First Design: Farmers can interact purely via email if they prefer
✅ Dynamic Image Generation: Auto-creates professional 4K crop/livestock images from text descriptions
✅ Production-Ready: Persistent storage, error recovery, user authentication, and share links
What we learned
AI Search ≠ IoT Sensors: AI agents using conversational interfaces and real-time web search can provide 24/7 personalized agronomy advice—matching expensive sensor networks through intelligent data synthesis.
Thought Signatures: Gemini 3's thought_signature parameter significantly improved farm-specific reasoning by maintaining conceptual continuity across autonomous checks.
Drive API Reliability: Google's services require defensive timeout handling and retry logic in production—never assume 100% uptime.
User Trust: Farmers preferred email notifications over app notifications, validating our communication-first approach.
What's next for Goodfarm
Short-term (3 months):
- Voice mode integration for low-literacy farmers
- WhatsApp bot deployment for broader reach in developing regions
- Marketplace integration (connect farmers to buyers based on harvest predictions)
Medium-term (6-12 months):
- Cooperative farming groups (shared monitoring for community farms)
- Offline-first mobile app with sync capabilities
- Multi-agent systems where pest detection agents alert irrigation agents for synchronized resource optimization
Long-term Vision:
- Blockchain-based supply chain tracking from farm to market
- Carbon credit calculation for sustainable farming practices
- Micro-insurance integration based on AI risk assessments
- Satellite imagery integration (when budgets allow) to complement photo-based monitoring
Market Opportunity: With the precision agriculture market growing at 13.30% CAGR to $43.64 billion by 2034, and our solution targeting the excluded 80%+ of farmers, Goodfarm aims to become the WhatsApp of autonomous farming—ubiquitous, simple, and indispensable.
Built With
- gemini-3-flash
- gemini-3-pro
- gemini-3-pro-image

Log in or sign up for Devpost to join the conversation.