Yalpha/AGRITECH-META
๐ฑ AgriDecisionEnv v3 โ Sustainable Farming RL Environment
๐ Overview
AgriDecisionEnv v3 is a real-world OpenEnv-compatible environment designed to evaluate AI agents on multi-season agricultural decision-making under uncertainty, delayed effects, and resource constraints.
The environment models how farmers must balance:
- ๐พ Crop yield (short-term productivity)
- ๐ Soil health (long-term sustainability)
- ๐ง Water usage (groundwater limits)
- ๐ฐ Budget constraints (economic feasibility)
This environment evaluates agent performance under delayed rewards, stochastic climate conditions, and resource constraints, closely mimicking real-world agricultural decision-making.
๐ Real-World Motivation
Over 33% of global arable land is degraded due to:
- monocropping
- excessive fertilizer use
- unsustainable irrigation
Existing systems rely on static heuristics and fail under dynamic conditions.
๐ This project provides a benchmark environment for training and evaluating intelligent agents capable of adaptive, long-term agricultural decision-making.
๐ง Environment Design
The environment simulates a farm across multiple seasons. At each timestep, the agent observes the current state and selects actions.
๐ Interaction Loop
State โ Agent โ Action โ Environment โ New State + Reward
๐ Scenario Initialization
๐ Observation Space
๐ฏ Action Space
โ๏ธ Reward Function
reward = clamp( yield_score
- soilqualitybonus
- fertilizer_penalty
- delayedfertilizerpenalty
- irrigation_penalty
- monocrop_penalty
- groundwater_penalty
- budget_penalty , 0.0, 1.0)
Key Properties
- Dense reward signal (not sparse)
- Penalizes unsustainable practices
- Encourages long-term planning
- Strictly normalized to [0.0, 1.0]
๐งช Task Design
๐ข Easy (1 step)
- Objective: maximize immediate yield
- Deterministic
- No delayed effects
๐ก Medium (3 steps)
- Objective: balance yield and soil improvement
- Introduces temporal dependencies
- Penalizes overuse
๐ด Hard (5 steps)
- Includes:
- stochastic weather
- delayed fertilizer effects
- groundwater depletion
- budget constraints
๐ Tests long-term sustainability strategies
๐ Baseline Results
LLM Agent (via OpenAI client + HF router)
Rule-Based Baselines
๐ Rule-based agent conserves budget but trades off yield; greedy/random overspend
๐ค Inference (OpenAI Client)
The agent uses the OpenAI client interface for all LLM calls.
Required environment variables:
- APIBASEURL
- MODEL_NAME
- HF_TOKEN
Logging Format (STRICT)
[START] [STEP] [END]
โ Required for evaluation โ Fully reproducible
๐งฑ Project Structure
agriv3/ โโโ models.py โโโ env.py โโโ tasks/ โโโ baselineagents.py โโโ inference.py โโโ openenv.yaml โโโ Dockerfile โโโ README.md
โ๏ธ Setup & Usage
Local
pip install pydantic openai HFTOKEN=yourtoken python inference.py
Docker
docker build -t agri-env . docker run -e HFTOKEN=yourtoken agri-env
Hugging Face Spaces
- SDK: Docker
- Tag: openenv
- Must respond to /reset
โ OpenEnv Compliance
- reset() โ Observation
- step(action) โ (Observation, float reward, done, info)
- state() โ Observation
โ Typed models โ Deterministic grading โ Reward range [0,1] โ Docker-compatible
๐ง Why This Matters
This environment models:
- real agricultural trade-offs
- long-term sustainability challenges
- constrained decision-making under uncertainty
๐ Useful for:
- RL benchmarking
- LLM evaluation
- policy simulation
๐ Conclusion
AgriDecisionEnv v3 is a realistic and scalable benchmark for evaluating intelligent agents in sustainable agriculture โ where short-term gains often conflict with long-term survival.
