agrillm helps turn farm decision questions into structured, reproducible workflows using large language models and APSIM-based analysis.
The package currently supports a few simple tasks:
resolve_decision()
generate_decision_qmd()
llm_chat()
Install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("byzheng/agrillm")
library(agrillm)
# See the default crop names
agrillm_options$get("crops")
# Classify a decision question
resolve_decision("What about sowing time choice?")To use the AI features, make sure your Azure LLM settings are available. The package expects the Azure environment variables AZURE_OPENAI_API_KEY, AZURE_ENDPOINT_URL and AZURE_RESOURCE_NAME to be set.
If you use agrillm in your research, please cite:
Zheng B, Kikuchi Y, Wang E, Verburg K (2026). A transparent crop model-driven and AI-assisted framework for agricultural decision support. Climate Smart Agriculture 3: 100143. https://doi.org/10.1016/j.csag.2026.100143
BibTeX:
@article{Zheng2026,
author = {Zheng, Bangyou and Kikuchi, Yuki and Wang, Enli and Verburg, Kees},
title = {A transparent crop model-driven and AI-assisted framework for agricultural decision support},
journal = {Climate Smart Agriculture},
year = {2026},
volume = {3},
pages = {100143},
doi = {10.1016/j.csag.2026.100143}
}If you find a bug or want to suggest a feature, please open an issue at: https://github.com/byzheng/agrillm/issues