High in the Peruvian Andes, where potato plots climb above 3,800 meters and many farmers speak Quechua or Aymara rather than Spanish, a soil-moisture sensor reading of 18 percent means nothing on its own. It does not tell a grower whether to irrigate today, whether the dark spots spreading across a potato leaf are late blight, or whether the coming season will generate enough revenue to repay a loan. A research team based in Puno, Peru, has now built and released an open-source platform designed to close exactly that gap, converting cheap microcontroller telemetry into concrete agronomic and economic guidance, and publishing the entire software stack for free reuse.
The platform, called AgroYachay—’yachay’ meaning knowledge in Quechua—is described in the journal SoftwareX and released under the MIT licence with an archived DOI, version 1.0.1. It is the cloud counterpart of a companion tool, AgroCommish, which handles the upstream work of commissioning ESP32 sensor nodes: flashing firmware, discovering sensor pins, provisioning WiFi credentials and registering each verified device with the cloud. Together, the two tools form a complete, reproducible device-to-decision pipeline that a small research group or agricultural programme can deploy entirely on open-source software and commodity hardware, with no per-seat licensing or proprietary cloud lock-in.
Architecturally, AgroYachay follows a three-tier edge-cloud design. At the edge, ESP32 microcontrollers wired to a DHT11 sensor for air temperature and humidity and an FC-28 probe for soil moisture post JSON readings over WiFi every ten seconds. The backend is a Flask 3 application of roughly 7,300 lines of Python, organised into controllers, feature modules and a service layer, with state persisted across fifteen normalised tables in PostgreSQL 17. Authentication relies on JSON Web Tokens with bcrypt password hashing and optional Google OAuth. The frontend is a React 18 single-page application of about 13,000 lines styled with Tailwind CSS, charting live sensor series with Recharts. More than ninety REST API routes tie the system together.
The intelligence layer is deliberately hybrid. Image-based pest diagnosis runs on a self-hosted open multimodal model—qwen2.5-VL-3B, served through Ollama—which keeps farmers’ photographs on local hardware rather than shipping them to a third-party image service. A grower photographs an affected leaf; the vision model, prompted as a phytopathologist specialising in Andean crops, returns a structured verdict covering health status, disease name, confidence, severity, causes, treatment and prevention. A follow-up text-only call to a cloud large language model hosted by Groq converts that verdict into an actionable management plan: urgency, step-by-step actions, chemical products with doses available in Peru, an organic alternative, and guidance on when to consult a human agronomist. The prompt targets potato, quinoa, maize, faba bean, oca and cañihua, the staple crops of the region.
The team validated the vision module with unusual candour, evaluating it as a plant-health triage aid rather than a fine-grained diagnostic tool. Using 509 images—300 laboratory photographs from PlantVillage and 209 field images from PlantDoc—they found perfect sensitivity: every one of the 409 diseased leaves was flagged as diseased, the property that matters most for an early-warning system. Specificity was lower at 62 percent, meaning the model over-flags healthy leaves as diseased, a conservative bias favouring missed nothing over missed disease. Species-level discrimination was weaker, with late blight frequently confused with early blight and a macro-F1 of 0.55. The authors state plainly that the module supports binary field triage, not reliable differential diagnosis, and that performance on real Andean field imagery remains untested. Repeated queries at the deployed temperature of zero produced identical classifications in ten out of ten trials, confirming reproducibility.
Beyond diagnosis, a context-aware conversational assistant answers free-form questions in Spanish, conditioned on the farmer’s registered crops, region and latest sensor values. Separate services translate the five-day OpenWeather forecast into a risk level, a weekly activity plan and optimal-day recommendations for spraying, sowing and irrigation. A crop management module records species, variety, parcel area, GPS location, sowing date and phenological stage, ensuring that every reading, alert, diagnosis and estimate is tied to a specific crop and device. An inputs module calculates fertiliser and agrochemical requirements from parcel area and target yield, while an advisory module queues requests for human agronomists, keeping an expert in the loop when the automated tools should not act alone.
The platform’s most distinctive feature may be its economic layer. Rather than a black-box regressor, the yield-and-revenue estimator is a transparent multiplicative factor model requiring no training data, which suits the sparse-data reality of Andean deployment. A crop-specific base yield—15.5 tonnes per hectare for potato, 1.8 for quinoa, 8.5 for oca—is adjusted by climate factors computed from mean temperature, humidity and accumulated rainfall within phenological windows, by a phenological factor that grows with crop progress, and by a piecewise area factor. The projected tonnage is multiplied by a regional reference price to give expected gross revenue. Because the model is purely multiplicative, its sensitivity is fully transparent: a 10 percent error in any climate factor moves the estimate by exactly 10 percent, and every contributing factor is displayed to the user. Results include pessimistic, probable and optimistic scenarios with a confidence score, and can be exported as styled PDF reports suitable for credit or crop-insurance applications.
The multilingual interface is treated as a first-class feature rather than an afterthought. Of 1,488 UI strings, 94 percent are localised into both Quechua and Aymara, with a complete English and Spanish locale; only technical terms such as ‘IoT’ and ‘ESP32’ are deliberately left untranslated. This matters because a substantial share of Andean smallholders operates primarily in indigenous languages, and generic farm-management platforms assume Spanish or English literacy. The authors note an honest limitation here: while the interface is multilingual, the LLM-generated advice, pest verdicts and exported reports are currently produced in Spanish only, so a Quechua-speaking user still encounters Spanish text at the moment of advice. Extending the prompts and report templates to indigenous languages is the next inclusion step.
Performance measurements on the production server show that core operations are genuinely interactive: lightweight REST calls complete in 2.6 milliseconds at the median, dashboard reads in under 10 milliseconds, and sensor ingestion in 19 milliseconds. A 22-minute bench test of a real ESP32 node delivered 132 of 134 expected sampling cycles, a 98.5 percent success rate with a maximum reconnection gap of 20 seconds. The exception is the vision module: on the CPU-only demonstration server a single diagnosis takes minutes, whereas on a consumer GPU it completes in seconds, so GPU-backed deployment is recommended for interactive use. The conversational assistant, dominated by external inference, averages around two seconds per response.
The developers, based at the Universidad Nacional del Altiplano in Puno, drew requirements from direct field experience in a smallholder economy centred on potato, quinoa, cañihua and Andean livestock, where commercial precision-agriculture suites are cost-prohibitive. They self-tested the platform on their own plantings and received positive informal feedback from local farmer demonstrations, though a formal quantitative user-acceptance study remains future work. So do calibration of the yield estimator against actual harvest records, an expert-labelled Andean field image benchmark, an on-device offline fallback for pest screening, and security hardening measures such as per-device authentication, database encryption at rest and automated secret rotation. Even without the LLM layer, sensor monitoring, alerts, the factor-model estimator and reporting already function. As an early but complete contribution, AgroYachay demonstrates that the entire chain—from flashing a sensor in a highland workshop to issuing a financed-harvest report—can now run on open-source software, potentially reshaping who gets to participate in precision agriculture across Latin America and other developing regions.
Subject of Research: An open-source IoT and large-language-model platform supporting agronomic and economic decision-making for Andean smallholder farmers.
Article Title: AgroYachay: An open-source IoT and large-language-model platform supporting agronomic and economic decision-making for Andean smallholders
Article References: Torres-Cruz, F., Vilca-Solorzano, R. A., Yana-Yucra, D. M., Ibañez-Quispe, V., & Fuentes-Navarro, E. L. (2026). AgroYachay: An open-source IoT and large-language-model platform supporting agronomic and economic decision-making for Andean smallholders. SoftwareX, 36, Article 103037. https://doi.org/10.1016/j.softx.2026.103037
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103037
Keywords: AgroYachay, precision agriculture, IoT, ESP32, large language models, smallholder farming, Andean agriculture, plant disease diagnosis, open-source software, yield prediction, Quechua, Peru
Cite Scienmag News
Alan Morgan. (September 22, 2026). Open-Source AI Platform Brings Smart Farming Decisions to Andean Smallholders. Scienmag. https://scienmag.com/open-source-ai-platform-brings-smart-farming-decisions-to-andean-smallholders/
Alan Morgan. "Open-Source AI Platform Brings Smart Farming Decisions to Andean Smallholders." Scienmag, 22 September 2026, https://scienmag.com/open-source-ai-platform-brings-smart-farming-decisions-to-andean-smallholders/. Accessed 22 September 2026.
Alan Morgan. "Open-Source AI Platform Brings Smart Farming Decisions to Andean Smallholders." Scienmag. September 22, 2026. https://scienmag.com/open-source-ai-platform-brings-smart-farming-decisions-to-andean-smallholders/

