Inspiration
The decisions that make or break a farm's long-term health rarely get made at a desk. They happen standing in a field, staring at a plant that might be a crop or might be a weed, or squinting at a patch of ground trying to remember what grew there two seasons ago. Get either call wrong — spray a field that didn't need it, or plant the same crop family back-to-back — and the cost isn't just yield. It's soil that erodes a little faster, groundwater that carries a little more runoff, and fertilizer bills that climb because the ground never gets a chance to recover.
That gap is bigger than any one field. Agriculture is Canada's fifth-largest source of greenhouse gas emissions — 10% of the national total — and those emissions grew 42% between 1990 and 2021, driven mostly by crop production. Crop rotation is one of the sector's best-understood levers against that trend, yet Statistics Canada found that in 2021 only 31% of farms followed the same rotation sequence every year, and just a third of those rotations included a nitrogen-fixing pulse crop like lentils or dry peas — the crops that actually cut the need for synthetic fertilizer. The knowledge that rotation works isn't the bottleneck. Knowing what to plant next, on this field, given what grew here before, is.
Most tools built for this moment assume connectivity, patience, or a desk. None of those exist in a field. What does exist is a farmer standing there with a phone.
We built Cultiva to put sustainable, field-specific decision-making directly into that moment — identify what's actually growing before reaching for a herbicide, and plan crop rotations that keep soil productive without leaning on synthetic inputs to compensate.
What it does
Cultiva is a mobile-first web app built around two decisions that matter most for sustainable row-crop farming:
Is this actually a weed, and does it need treating? Point the camera at a plant and Gemini identifies it, then recommends one of three tiers: monitor (low density, not worth treating), spot-treat (this location only), or broader concern (spreads aggressively, check nearby). The goal is the least intervention the photo actually justifies — not reflexive blanket spraying. If it's not a plant, it says so instead of guessing
What should go here next, and when? Draw your farm boundary and field plots on an interactive map, log soil type, pH, and crop history, and get a rotation recommendation grounded in real agronomic features. Every field shows an at-a-glance status — rotate now, marginal, safe to repeat — so the sustainable choice is the obvious one.
Why this matters — the numbers
A six-year study of diversified rotations found they cut N₂O emissions 39%, raised yields up to 38%, and grew soil organic carbon 8%. The fertilizer math is concrete too: a pulse crop can cut nitrogen needs by up to 25 lb/acre — on a 1,500-acre farm, that's ~$28,100 in fertilizer never bought. Applied at national scale, that 8% soil-carbon gain against Canada's ~69 Mt of 2021 agricultural emissions works out to a modeled ~5.5 Mt CO₂e in additional potential offset — not a measured result, but the size of the opportunity Cultiva is aimed at.
How we built it
Frontend: React, TypeScript, Vite. The farm map is a from-scratch interactive drawing tool built directly on Leaflet primitives over OpenStreetMap tiles — draw a boundary or field plot point-by-point, undo mid-draw, and go back later to drag or delete individual vertices to reshape a plot without redrawing it from scratch.
Backend: Python, FastAPI, Pydantic — bcrypt-hashed auth with session tokens, and a data model that treats crop history, soil conditions, and rotation status as first-class fields, not an afterthought.
Google Gemini
Gemini identifies the plant and makes the weed/action-tier call. Instead of asking it to write a paragraph and picking that apart, we tell it exactly what fields to fill in — species, is it a weed, which tier — so it always hands back clean, ready-to-use data. The prompt checks "is this even a plant" before a species call, and bakes in "prefer the least intervention" directly, so tiering defaults toward monitoring, not treating.
Rotation & soil-exhaustion model
The rotation and soil-exhaustion predictions are served by XGBoost models we trained locally on soil type, pH, crop family history, and area — gradient-boosted trees rather than a heavyweight network, chosen deliberately: they run on CPU, infer in milliseconds, and don't require an external API call per prediction. The model outputs a rotate/don't-rotate call, a soil exhaustion score, likely NPK deficiency, and suggested next crops, all surfaced with a plain-language reason so the recommendation is traceable, not a black box.
MongoDB Atlas
MongoDB Atlas stores everything per account — login, fields, and the whole farm drawing — and each account only ever sees its own data. The farm drawing itself — the boundary, every field's shape, its soil and crop data — autosaves to the database shortly after you stop editing, and loads back automatically the next time you log in.
Challenges we ran into
- Early Gemini prompts defaulted to "spot-treat" for almost everything — tiering only got trustworthy once the least-intervention principle was stated outright, not just implied by the schema.
- Getting the rotation model working.
- Not crashing out over merge conflicts, commits landing under the wrong author, etc. We got more disciplined about small, frequent merges
Accomplishments
- An AI feature that changes a default behavior (blanket spray → tiered response), not just labels a photo.
- A fully custom map-drawing tool: draw, undo, edit-after-the-fact
- A measured 5–6x faster field save from collapsing redundant MongoDB round-trips into one atomic op.
What we learned
Holding a multimodal LLM to a strict, typed contract (response_schema) means the frontend trusts the output with no defensive parsing. "AI for sustainability" only lands when it changes a concrete default, not just labels something. And database latency is worth profiling with real numbers before optimizing — atomic find-and-modify beats find-then-write-then-refetch every time.
What's next
- Aerial/satellite imagery for field-health trends over a season.
- Opt-in regional pest/weed pressure sharing so "broader concern" catches outbreaks earlier.
- Offline-first support for fields without signal.
- Environmental-impact scoring per rotation choice, to make the payoff visible.
Built With
- css
- gemini-api
- html
- javascript
- mongodb
- python
- typescript

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