AI Agriculture Advisory System
Crop Health, Disease and Irrigation Advice
Design a service that watches farmers' fields from satellite images, diagnoses crop diseases from phone photos (even offline), and tells each farmer when and how much to irrigate, with advice that is careful about what it does not know.
Overview
A farm advisory service answers three questions for a farmer: is my crop healthy, what is this spot on the leaves, and should I water today. It draws on three kinds of data: free satellite images that show plant vigor across every field every few days, photos the farmer takes with a phone, and weather forecasts plus, on some farms, soil moisture sensors.
The users shape the design as much as the data. Many are smallholders on basic phones with patchy mobile data, reading or listening in a local language. So the app must work offline, keep messages short, and offer voice. Advice has consequences: a wrong irrigation call wastes water or stresses a crop, and a confident wrong diagnosis leads to the wrong spray. The system should prefer well-established agronomy (the FAO's standard method for crop water needs) over a black-box model where it can, and say 'ask an extension officer' when it is unsure.
Questions to ask first
Before drawing anything, settle the scope with the interviewer. These are the questions to ask, each with the answer this design assumes.
- How many farmers and fields? 2 million farmers and 4 million fields, mostly around 1 hectare each.
- Which satellite data? Free Sentinel-2 imagery, with 10 m pixels and a new image about every 5 days.
- Which crops and diseases? A few staple crops per region, and their common diseases.
- Do farmers have sensors? Some do. There are about 100,000 soil moisture sensors in total.
- What about connectivity? Phones are often offline for days, so the app must diagnose common diseases without a network.
- Which languages? Several local languages, in text and voice.
The design at a glance
Slow inputs run as batch pipelines: the imagery pipeline clips each Sentinel-2 image to the fields, masks clouds and stores a per-field NDVI (a plant-vigor index) in the fields' health history, while weather forecasts and soil sensor time series feed the advice engine. The advice engine runs the water balance and reviewed rules and sends short advice through notifications by SMS, push or voice. Photos take the fast path: the farmer's phone diagnoses offline with its own model, and once online it sends the photo through the advisory API to the diagnosis service, whose results feed an outbreak detector that warns neighbors. The Visual Explanation below draws both paths, and the sections that follow take the satellite path first.
What you will be able to do
- Turn satellite images into a per-field health signal, and handle clouds.
- Design disease diagnosis that works offline on a basic phone and knows when to defer to a person.
- Compute irrigation advice from the FAO-56 water balance and a weather forecast.
- Detect regional outbreaks from individual diagnoses and alert the right farmers.
- Size the system and explain why most of it is batch work, not request traffic.
Key concepts
- Field boundaries (GeoJSON)
- NDVI from satellite bands
- Cloud masking
- Anomaly against a baseline
- Image classification on the phone
- Offline-first sync
- FAO-56 water balance
- Outbreak detection by area
- Human expert in the loop
Functional requirements
- Register a field by drawing its boundary on a map, with crop and planting date
- Show each field's crop health over time from satellite images, and alert on an unusual drop
- Diagnose a disease from a leaf photo, online or offline, with a confidence and the next step
- Give a daily irrigation recommendation per field: irrigate today or not, and how much
- Alert farmers growing a crop when a disease is spreading nearby
- Deliver advice in the farmer's language by app, SMS or voice
- Let an agronomist review uncertain diagnoses and correct them
Non-functional requirements
- Offline diagnosis for the most common local diseases, with results synced when online
- New satellite data reflected in field health within 24 hours of availability (our target)
- Irrigation advice sent before the working day starts
- Outbreak alerts within a few hours of the cluster being detected (our target)
- Uncertain answers say so and point to a person; no silent low-confidence advice
- Small downloads: the app and its model fit on a low-end phone
Interview questions
- How do you turn satellite images into crop health for one field?
- How does disease diagnosis work without a network?
- Why not just trust a model trained on a big public dataset?
- How do you decide whether a farmer should irrigate today?
- How do you detect a disease outbreak and who do you tell?
- Where is the load in this system?
- How do you keep advice safe?
Sign up free to read the full topic
More System Design topics
- A framework for the system design interview
- A/B Testing Platform Design
- ACID vs BASE
- Active-Active vs Active-Passive
- Ad Click Event Aggregation
- AI Airline Booking Chatbot
- AI Analytics Dashboard
- AI Anomaly Detection System
- AI Art Generation System
- AI Banking Chatbot
- AI Bot and Scalper Detection System
- AI Click Fraud Detection System
Start free on Cariara · Coding problems · System design studio