AWS Builder Center

AgriSense: Climate & Crop Resilience Multi-Agent System with AWS Strands SDK

How I used the AWS Strands Agents SDK and Amazon Bedrock to build a bilingual multi-agent advisory system protecting smallholder farmers in Tamil Nadu from climate shocks.

1. Introduction & The Social Good Challenge

Smallholder farmers across monsoon-dependent agricultural belts like Tamil Nadu operate under high climatic risk. In regions like the Coimbatore basin, Thanjavur delta, and southern plains, sudden microclimate shifts—such as unseasonal heavy downpours, extended dry spells, or sharp relative humidity spikes (>85%)—trigger severe crop damage. High humidity during paddy flowering invites fungal blast disease, while gale winds cause lodging in mature banana plantations and sugarcane.
While satellite weather forecasts exist, two major barriers prevent smallholder farmers from acting on them:
  1. The Translation Gap: Forecasts offer meteorological metrics (e.g., "35mm rain, 88% humidity") rather than direct agronomic advice (e.g., "Do not spray fungicide today; inspect drainage channels instead").
  1. The Language Barrier: Complex advisory bulletins are often published in technical English, leaving grassroots cultivators without actionable, native-language guidance.
To solve this, I built AgriSense (உழவர் தோழன்): an autonomous, multi-agent climate resilience advisory platform developed using the AWS Strands Agents SDK and powered by Amazon Bedrock.



2. Multi-Agent System Architecture

Rather than relying on a single monolithic prompt, AgriSense splits agricultural decision-making into three coordinated Strands agents:
[Hyperlocal Weather Tool (Open-Meteo API)]
│
▼
[Weather Intelligence Agent]
│
(Weather Threat Diagnosis)
▼
[Crop Advisor Agent]
│
(Biological Risk Matrix)
▼
[Action Planner Agent]
│
┌───────────────────┴───────────────────┐
▼ ▼
[English Advisory] [Tamil Advisory (தமிழ்)]

Agent Responsibilities:

  1. Weather Intelligence Agent (@tool enabled): Fetches real-time 7-day weather forecasts for regional coordinates (e.g., Coimbatore at 11.0168° N, 76.9558° E). It flags heat stress (>38°C), unseasonal heavy precipitation (>40mm), and gale winds (>30 km/h).
  1. Crop Advisor Agent: Correlates the weather diagnosis against the phenological growth stage of regional crops (Paddy, Cotton, Sugarcane, Banana, Groundnut, Tomato, Maize, Millets) to evaluate biological vulnerability to lodging, pest escalations, and moisture stress.
  1. Action Planner Agent: Reconciles findings to generate prioritized, time-bound mitigation actions categorized into Immediate (0–24 hrs), Short-Term (24–72 hrs), and Preventative measures. It outputs full bilingual advisories in clear, accessible English and spoken Tamil (தமிழ்).



3.Implementation with AWS Strands Agents SDK

The solution uses the model-driven architecture of the Strands Agents SDK with Python.

import os
import requests
from strands import Agent, tool

# Step 1: Wrap real-world meteorological data collection as a Strands Tool
@tool
def get_hyperlocal_weather(latitude: float, longitude: float) -> str:
"""
Fetches real-time 7-day forecast data including temperatures,
precipitation amounts, rain probability, and maximum wind speeds.
"""
url = (
f"[https://api.open-meteo.com/v1/forecast?latitude=](https://api.open-meteo.com/v1/forecast?latitude=){latitude}&longitude={longitude}"
f"&daily=temperature_2m_max,temperature_2m_min,precipitation_sum,"
f"precipitation_probability_max,windspeed_10m_max&current_weather=true&timezone=auto"
)
try:
response = requests.get(url, timeout=10).json()
daily = response.get("daily", {})
return (
f"Daily Max Temps: {daily.get('temperature_2m_max', [])[:3]} C, "
f"Rainfall Totals: {daily.get('precipitation_sum', [])[:3]} mm, "
f"Rain Probabilities: {daily.get('precipitation_probability_max', [])[:3]} %, "
f"Max Wind Speeds: {daily.get('windspeed_10m_max', [])[:3]} km/h"
)
except Exception as e:
return f"Weather data unavailable: {str(e)}"

# Step 2: Define Specialized Strands Agents
weather_agent = Agent(
name="WeatherIntelligenceAgent",
model="anthropic.claude-3-haiku-20240307-v1:0",
system_prompt="""You are a meteorological risk specialist. Analyze forecasted weather
for acute farming hazards: heat stress (>38C), heavy rain (>40mm), gusts (>30km/h), or dry spells.
State severity level (Low, Moderate, High, Severe) and summarize the exact risk.""",
tools=[get_hyperlocal_weather]
)

crop_agent = Agent(
name="CropAdvisorAgent",
model="anthropic.claude-3-haiku-20240307-v1:0",
system_prompt="""You are an agricultural biologist. Given the crop name, growth stage,
and weather diagnosis, identify biological vulnerabilities (e.g., fungal blast, waterlogging,
bollworm, or lodging) specific to Indian agricultural conditions."""
)

action_planner = Agent(
name="ActionPlannerAgent",
model="anthropic.claude-3-haiku-20240307-v1:0",
system_prompt="""You are a grassroots farm coordinator. Synthesize the meteorological
and crop risks into a structured action plan:
1. Immediate Action (0-24 hrs): Chemical spraying window advice, drainage.
2. Short-Term Action (24-72 hrs): Irrigation and fertilizer schedule.
3. Preventative Measures: Physical propping, pest traps.
Produce the entire advisory in both English and clear, spoken Tamil (தமிழ்)."""
)

# Step 3: Orchestrate the Multi-Agent Flow
def generate_farmer_advisory(crop: str, stage: str, latitude: float, longitude: float):
# Agent 1 analyzes weather threats
weather_summary = weather_agent(f"Analyze weather threats for coordinates: lat={latitude}, lon={longitude}")
# Agent 2 evaluates crop biology
crop_vulnerabilities = crop_agent(f"Crop: {crop}, Growth Stage: {stage}. Weather diagnosis: {weather_summary}")
# Agent 3 synthesizes actionable plan in English and Tamil
final_advisory = action_planner(
f"Generate final farmer advisory from:\nWeather: {weather_summary}\nCrop Risks: {crop_vulnerabilities}"
)
return final_advisory

if __name__ == "__main__":
# Example evaluation for Paddy in Flowering stage in Coimbatore (11.0168° N, 76.9558° E)
advisory = generate_farmer_advisory(
crop="Paddy (நெல்)",
stage="Flowering (பூக்கும் பருவம்)",
latitude=11.0168,
longitude=76.9558
)
print(advisory)


4. Key Results & Sample Advisory Output

When executed for a paddy field under rain warning conditions in Coimbatore, the agents collaborate to output:
=== AGRI-SENSE ADVISORY / உழவர் ஆலோசனை ===
[ENGLISH]
  • Immediate Action (Next 24h): Postpone scheduled fungicide/urea spraying. Rainfall probability exceeds 70%, which will wash away chemicals into runoff.
  • Field Drainage: Clear bund outlets in low-lying plots to prevent water stagnation around flowering panicles.
  • Disease Watch: High relative humidity creates ideal conditions for blast disease; monitor leaf tips once rain subsides.
[தமிழ் (TAMIL)]
  • உடனடி நடவடிக்கை (24 மணி நேரம்): பூஞ்சாணக்கொல்லி அல்லது உரமிடுவதை உடனடியாக ஒத்திவைக்கவும். 70% மழை வாய்ப்பு உள்ளதால் மருந்துகள் வீணாகிவிடும்.
  • வடிகால் வசதி: வயலில் நீர் தேங்காமல் இருக்க வரப்பு வடிகால்களை உடனடியாக தூர்வாரி சீரமைக்கவும்.
  • நோய் கண்காணிப்பு: அதிக ஈரப்பதம் காரணமாக இலைக்கருகல் நோய் (Blast) வர வாய்ப்புள்ளது; மழை நின்றதும் பயிர்களைக் கண்காணிக்கவும்.

5. Real-World Social Good Impact

  • Reducing Input Costs: Eliminates chemical wash-off by alerting farmers against spraying immediately before rain events.
  • Linguistic Inclusion: Native Tamil support empowers grassroots cultivators who are excluded by English-only digital advisory tools.
  • Preventative Climate Adaptation: Giving smallholders 48 to 72 hours of clear warning prevents crop lodging, rot, and severe yield loss, directly advancing UN Sustainable Development Goals (SDG 2: Zero Hunger and SDG 13: Climate Action).

6. What I Learned from the Workshop

Building this agentic pipeline during the "Building AI Agents with Strands SDK: From Simple Loops to Multi-Agent Swarms" workshop reinforced that modern AI agents are far more than prompts—they are modular software systems. The Strands Agents SDK made it seamless to:
  • Bind custom Python functions into tool-using LLM workflows using clean  @tool  decorators.
  • Orchestrate role-specialized agents without building brittle chain-of-thought routing scripts.
  • Deploy robust, production-ready agent reasoning with Amazon Bedrock.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article