AWS Builder Center

WeatherWise: AI weather alerts for farmers and families, built with Strands Agents on AWS

How we built a team of Strands agents on Amazon Bedrock AgentCore that warns farmers and families about heat waves, drought and floods days ahead, guides them to shelter, and helps households prepare, in their own language.

Software Engineering Leader
A team of six Strands agents on Amazon Bedrock AgentCore turns weather forecasts into clear, local warnings about heat, drought and floods. We tested it against ten real disasters.
Live app:  weatherwise.online  · Code:  github.com/princebirring/weatherwise  (Apache-2.0) · Built for the AWS "Strands SDK: Workshop to Ship" hackathon, climate resilience track.
For judges:  check it in two minutes : this morning's agent run, Memory, the Strands features, the replay proof and the tests, with a link to each.
2026 has been a hard year for farmers in India. In May, temperatures in Uttar Pradesh passed 48 °C ( Euronews ). The monsoon ended on September 30 about 13% below normal, the weakest in more than a decade, and drought was reported in several states ( Rural Voice ). On October 28, Cyclone Arnab hit the coast of Andhra Pradesh after at least 180,000 people had been evacuated ( Al Jazeera ).
Most of this was forecast. What a small farmer still lacks is the step from a forecast to a decision: Will it be dangerous where I am? On which day? What should I do first? In this post, we show how we built WeatherWise, a phone app that answers these questions for any place in India using six Strands agents on Amazon Bedrock AgentCore. We also show how we tested it against real disasters, and what we learned.

The problem

India has good forecasts and official warnings. However, warnings cover whole districts, are often only in English, and assume that people already know what to do. The harm is also undercounted: officials record 500 to 1,500 heat deaths a year, while one study estimates nearly 30,000 extra deaths from a single five-day heat wave ( Euronews ).
About 126 million farm holdings in India, 86% of the total, are smaller than 2 hectares ( Agriculture Census 2015-16 ). Many of these farms depend on rain, and the people who work them stay outdoors through every heat wave. One bad week of weather can wipe out a season's income.
A small farmer needs four answers, on a basic phone, in their own language, days in advance:
  1. Is it dangerous where I am?
  1. On which day?
  1. What should I do?
  1. Where can I go to be safe?
The hackathon's climate challenge has three parts, and WeatherWise covers all three for any place in India:
  • Heat-wave and drought early warnings for small farmers.
  • Directions to the nearest cooling center or shelter during extreme weather.
  • A flood guide that helps a household prepare, step by step.

Solution overview

Figure 1 shows the whole system. People use the website on their phone. Two kinds of work reach the agents on AgentCore: questions asked in the Ask chat, and a scheduled morning run that writes warnings before anyone asks.




Figure 1. WeatherWise on AWS.
The app's screens never call a model. Only the chat and the morning run use AgentCore, and both carry their own copy of our MCP server, so every fact comes from the same tested code.
We split the work between agents and code:
  • Agents do the reasoning. They understand the question, choose which tools to call, pick the advice that matters today, and rewrite a message until it is safe.
  • Code owns the numbers and the alarm. A model can sound confident while being wrong about a number, so code computes every figure and decides whether there is danger. Code also checks every message before anyone sees it.
One source of facts. A Climate Risk MCP server provides 8 tools:  find_place ,  resolve_place ,  hazard_outlook ,  official_alerts ,  find_shelters ,  backtest ,  cap_alerts  and  message_policy . It turns any point on the map into a district, its terrain and the nearest large river. It takes forecasts from Open-Meteo (ECMWF weather and GloFAS river flow), corrects them using each place's own recent forecast errors, and checks them against the India Meteorological Department (IMD) definitions and our own clearly labelled rules.
Rules in files, not in code. Every threshold and check lives in the  rules/  folder: one global file, one file per country and one file per language. No place names appear in the code, so adding a country means adding two files.

The app

The app opens on one screen that answers "What about today?" within a few seconds. It is useful on calm days too, because farmers will not keep an app that only speaks during disasters.
  • Today shows plain farm advice from the forecast, such as "good for spraying until Thursday", and three danger tiles: Heat, Flood and Dry. A tile lights up only when a check finds a risk. Official warnings from IMD and state authorities appear at the top, and an official red alert turns the screen into a short emergency message.
  • A page for each danger gives advice, the week ahead and the nearest safe places. The flood page is a step-by-step household checklist. The heat page lists the nearest cooling and health centers.
  • Ask is a chat that answers questions such as "Can I work in the field tomorrow afternoon?" using live data. This is where the Strands agents work.
  • Help calls 112, 108 or 1077 with one tap.
The app works in English, Hindi and Marathi. A Listen button reads each screen aloud with the phone's built-in voice, and pages keep working offline once they have loaded.







Figure 2. The live app in Vijayawada on November 4, 2026, after Cyclone Arnab. Left: the Today screen with official alerts and the Flood tile. Right: the flood checklist that opens from "What should I do?"

The six agents

All six agents are Strands agents running on Amazon Bedrock AgentCore Runtime. Three of them answer questions in the chat. The other three write the morning warnings.
Agent
When it runs
What it does
Tools and skills
Orchestrator
A person asks a question in the chat
Understands the question, gets the facts, hands off to a specialist and writes the reply
MCP:  find_place ,  resolve_place ,  hazard_outlook ,  official_alerts ,  find_shelters . Skills: sign-up, shelter reply
Warning agent
Chat questions about heat or dry weather
Gives heat, drought or sow-or-wait advice for the person's crop and water source
MCP:  hazard_outlook ,  find_shelters . Skills: heat advice, drought advice
Flood Guide agent
Chat questions about floods
Guides a household through preparing, one step at a time, or gives one short urgent message
MCP:  hazard_outlook ,  find_shelters . Skills: flood preparation (village, city), flood urgent
Warning writer
Morning run, when heat or dry weather is found
Writes the warning for that place
Skills: heat advice, drought advice
Flood writer
Morning run, when a flood risk is found
Writes the flood message for that place
Skills: flood preparation (village, city), flood urgent
All-clear writer
Morning run, when an earlier risk has eased
Says that the risk has eased, without ever saying "safe"
Skill: all-clear
The chat specialists are passed to the Orchestrator as tools (the "agents as tools" pattern). The three writers are nodes in a Strands Graph. Every agent has the Evaluator attached, and the chat agents also have a cost-guard hook that limits tool calls.
The Evaluator is built on Strands steering. Code checks every draft against clear rules: a helpline is included, every number came from a tool, the message never says "you are safe", a flood message contains no map directions, and "go to high ground" always comes with a warning about hill slopes, because of landslides. A draft that breaks a rule goes back to the agent with the reason. After two failed rewrites, the person receives a pre-written safe message in their language instead. Finally, an AI tone check reads the reply for calm, plain wording.
The morning run is a Strands Graph, shown in Figure 3. A code step scans each place for risk and picks a writer. After the writer, a code safety gate checks the message again, and delivery rules decide whether to send it. AgentCore Memory stores what each place was told, so the next morning the agent can send an update or an all-clear instead of repeating itself.




Figure 3. The morning warning Graph.
Only the writer steps call a model. If nothing is found, the run stops with no model cost, and if the model fails, the pre-written warning still goes out.
The Graph takes a few lines of Strands  GraphBuilder  code, and conditional edges pick one of the three writers (from  weatherwise/agents/warning_pipeline.py ):
b = GraphBuilder()
b.add_node(CodeNode("risk_scan", risk_scan), "risk_scan") # plain code, no model
b.add_node(warning_writer, "warning_writer") # Strands agent + Evaluator
b.add_node(flood_writer, "flood_writer") # Strands agent + Evaluator
b.add_node(all_clear_writer, "all_clear_writer") # Strands agent + Evaluator
b.add_node(CodeNode("final_gate", final_gate), "final_gate") # safety rules again
b.add_node(CodeNode("send", send), "send") # delivery rules
b.add_edge("risk_scan", "warning_writer", condition=lambda s: rec.hazard_kind == "heat_dry")
b.add_edge("risk_scan", "flood_writer", condition=lambda s: rec.hazard_kind == "flood")
b.add_edge("risk_scan", "all_clear_writer", condition=lambda s: rec.hazard_kind == "all_clear")
b.add_edge("warning_writer", "final_gate")
b.add_edge("flood_writer", "final_gate")
b.add_edge("all_clear_writer", "final_gate")
b.add_edge("final_gate", "send")
b.set_entry_point("risk_scan")
graph = b.build()
In the chat, each specialist is a Strands agent wrapped as a tool of the Orchestrator. Its docstring tells the Orchestrator when to use it, and each specialist receives only the tools and skills it needs (from  weatherwise/agents/orchestrator.py , shortened):
@tool
def flood_guide_agent(request: str) -> str:
"""Run the household flood guide: prepare mode (one step at a time) or urgent mode (one
short message). Give the place, village or city, and the step the household is on."""
return str(make("flood_guide_agent", FLOOD_PROMPT,
["flood-prepare-village", "flood-prepare-city", "flood-urgent"], # skills
{"hazard_outlook", "find_shelters"})(request)) # MCP tools

orchestrator = Agent(
name="orchestrator", model=model,
tools=[*_by_name(climate_tools, {"find_place", "resolve_place", "hazard_outlook",
"official_alerts", "find_shelters"}),
warning_agent, flood_guide_agent],
plugins=[AgentSkills(skills=[...]), *evaluator(tone=True)],
hooks=[CostGuardHook(), step_log],
)
The Evaluator is a Strands steering handler. After the model writes its final reply, code checks the reply against the facts that the tools returned. If a rule fails,  Guide  sends the agent back with the reason (from  weatherwise/agents/steering.py , shortened):
class SafetyRulesHandler(SteeringHandler):
async def steer_after_model(self, *, agent, message, stop_reason, **kwargs):
if stop_reason != "end_turn":
return Proceed(reason="not a final reply")
violations = check_message(_text(message), context_from_tools(_tool_results(agent)), self.rules)
if not violations:
return Proceed(reason="all safety rules pass")
rewrites = (agent.state.get("evaluator_rewrites") or 0) + 1
agent.state.set("evaluator_rewrites", rewrites)
if rewrites > MAX_REWRITES:
agent.state.set("use_fallback", True) # the caller sends the safe message
return Proceed(reason="rewrite limit reached")
return Guide(reason="Rewrite the reply. Fix: "
+ "; ".join(f"{v.rule}: {v.detail}" for v in violations))

Running on AWS

The whole system is one AWS CloudFormation stack ( infra/cloudformation/weatherwise-service.yaml ) in the US East (Ohio) Region. GitHub Actions deploys it on every merge to  main .
  • Amazon ECS on AWS Fargate runs the app container: the website, the API and a local copy of the MCP server.
  • Amazon Bedrock AgentCore Runtime runs all six agents, with each chat in its own private session. AgentCore Memory stores what each place was told, and AgentCore Observability sends traces to Amazon CloudWatch and AWS X-Ray.
  • Amazon EventBridge Scheduler starts the morning run at 3 AM India time for 25 places across India. Amazon S3 stores the weather cache and each morning's results.
  • AWS WAF and an Application Load Balancer protect the app, and Amazon Route 53 serves the weatherwise.online domain.
All six agents use Amazon Nova Pro on Amazon Bedrock.
One AgentCore entry point handles both kinds of work (from  weatherwise/runtime.py , shortened):
@app.entrypoint
def invoke(payload: dict, context):
kind = payload.get("type", "chat")
if kind == "chat": # a question from the Ask screen
team = build_team(bedrock_model(), _mcp_client().list_tools_sync(),
_policy(payload.get("country", "in")), language=payload.get("language"))
return _chat_stream(team, message)
if kind == "warning": # the morning run, one place at a time
model = MeteredModel(bedrock_model())
pipeline = WarningPipeline(outlook, model, ledger, outbox,
_policy(place["country"]), memory=_place_memory())
rec = pipeline.run(group, datetime.now(ZoneInfo(place["timezone"])))
return run_report(rec, outbox, model.usage(), time.monotonic() - started)




Figure 4. One Ask chat from the live app, traced in AWS X-Ray. The Orchestrator calls  hazard_outlook  through MCP, then hands the question to the Warning agent, which checks the forecast and reads its skill before writing. A tone check reads the final reply before it is sent.

Going beyond the workshop

The Strands workshop covered tools, hooks, skills, steering, sessions, agents as tools, evaluations and deployment to AgentCore. We used all of them and added the following:
  • A Strands Graph that mixes code and agents. Code steps and agent steps share one pipeline, and conditional edges choose the writer. The workshop did not cover Graphs.
  • Our own MCP server as the single source of facts. The app screens and the agents use the same server, so they always show the same numbers.
  • Agents that act before anyone asks. EventBridge starts the morning run on AgentCore, and AgentCore Memory lets the next morning's message say what has changed, or that the risk has eased.
  • Agents tested against history. The same Graph replays past disasters with the forecasts that were available at the time, and it records the cost of every model call.
  • Rules files instead of hard-coded places, so adding a country is a configuration change, not a code change.

Results

Warnings ahead of real disasters

We replayed ten real disasters day by day, using only the forecasts that were available on each day, so nothing from the future leaks in. Nine of them have archived forecasts. Our checks warned ahead of 5 of those 9, and we publish the 4 we missed. Official warnings are not archived, so these scores cover only our own checks.
Event
Type
Result
Kolhapur-Sangli floods, July 2024
Flood
Warned 9 days before the river crossed its danger mark, with no false alarms
Phalodi 50 °C, May 2024
Heat
Warned 5 days ahead
Delhi heat wave, May-June 2024
Heat
Warned 4 days ahead
Vijayawada floods, August 2024
Flood
Warned 2 days ahead, from rain that was unusual for that place
Vidarbha heat wave, April 2026
Heat
Caught the first heat spell on the day, and a later spell 3 days ahead
Kharghar heatstroke, April 2023
Heat
No archived forecasts; the actual conditions met our heat checks
Wayanad landslides, July 2024
Flood
Missed
Assam floods, July 2024
Flood
Missed
Cyclone Fengal, November 2024
Flood
Missed
Punjab floods, August-September 2025
Flood
Missed

The agents on the same days

Next, we ran seven of these events through the real morning Graph, using Amazon Nova Pro in English. The model wrote 78 warnings:
  • 65 of 78 (83%) passed every safety rule on the first try.
  • 12 passed after the Evaluator sent them back for a rewrite.
  • 1 was replaced by the pre-written safe message.
  • No message that broke a safety rule reached a household. After each run, every delivered message is checked again with the current rules.
  • The model cost for all seven events was US$0.25.
Event
Days our checks flagged
Passed first try
Passed after rewrite
Messages a household received
Model cost
Kolhapur-Sangli floods, July 2024
11
9 of 11
2
4
$0.038
Vijayawada floods, August 2024
8
7 of 8
1
7
$0.028
Punjab floods, August-September 2025
13
6 of 13
6, plus 1 safe message
8
$0.053
Cyclone Fengal rain, November 2024
6
4 of 6
2
5
$0.019
Wayanad landslides, July 2024
0
-
-
0
$0.000
Vidarbha heat wave, April 2026
22
21 of 22
1
8
$0.060
Phalodi 50 °C, May 2024
18
18 of 18
0
5
$0.051
Delivery rules cut the 78 checked messages to the 37 that a household would actually have received. Normal warnings go out only between 5 AM and 8 PM, and the rules limit how often a household hears about the same risk. Urgent warnings can go out at any hour.

Choosing the model

We ran the same 78 mornings on three other Amazon Nova models, with the same facts, skills and Evaluator.
Model
Passed first try
Passed after rewrite
Safe message used
Flagged by reader checks
Cost per message
Median time per message
Nova 2 Lite
66 of 78 (85%)
11
1
1
$0.0032
12.0 s
Nova Pro (in production)
65 of 78 (83%)
12
1
0
$0.0032
13.5 s
Nova Micro
62 of 78 (79%)
13
3
2
$0.0002
1.8 s
Nova Lite
0 of 78 (0%)
76
2
1
$0.0005
5.8 s
Nova Pro and Nova 2 Lite performed about the same at the same cost, so we kept Nova Pro, which was already running in production. Nova Micro is much cheaper but needed the safe message more often. Nova Lite's drafts kept including its own working notes, which the Evaluator never allows. The reader checks flag messages that are poor but not unsafe, such as a helpline for the wrong hazard, or an opening that reassures before it warns.

Testing the safety checker

We also planted mistakes in drafts in English, Hindi and Marathi, such as invented temperatures, missing helplines, "you are safe", map links during a flood, and requests for a one-time password (OTP).
  • 30 of 30 planted mistakes were caught by the right rule.
  • 15 of 15 correct drafts were allowed through, so the checker does not simply block everything.
  • 6 of 6 agent runs that produced an unsafe draft never showed it to the person.
All of these results can be reproduced from the repository with  evals/eval_replays.py ,  evals/eval_safety.py  and  evals/eval_agent_replays.py . Every message is saved in  evals/results/ .

Live every morning

Since November 3, 2026, EventBridge Scheduler has run the morning Graph on AgentCore for 25 places across India. The  live page  shows every message, what the Evaluator sent back, and the cost. The first run wrote 2 warnings: heat in Mumbai, and a flood warning for Vijayawada during an official red alert. In the first three runs (November 3 to 5), all 75 place checks finished without errors. The agents wrote 8 warnings, the Evaluator sent 3 drafts back, and the model cost was US$0.14 in total. AgentCore Memory changed what the agents wrote: on November 4, 2 warnings were updates of the day before, and on November 5 the all-clear writer told 4 places that their risk had eased. No messages are sent to people yet, because no one has subscribed to these places.

Run it yourself

The code is open source under the Apache-2.0 license. You need Python with  uv  and Node.js. The app, the tests and the replays run without an AWS account:
git clone https://github.com/princebirring/weatherwise && cd weatherwise
uv sync
uv run pytest -m "not live" # offline tests
uv run python -m evals.eval_safety # safety evals -> evals/results/SAFETY.md
uv run python -m evals.eval_replays # replay scorecard -> evals/results/REPLAYS.md
(cd website && npm install && npm run build) # build the website once
uv run python -m weatherwise.api.server # app + API on http://127.0.0.1:8080
The Ask chat and the agent replays need access to Amazon Bedrock. Set  CLIMATE_AGENT_MODEL_ID  to a model you can use, then run  uv run python -m evals.eval_agent_replays .
To deploy your own copy with GitHub Actions:
  1. Deploy  infra/cloudformation/github-oidc-ecr-publisher.yaml  once. It creates an Amazon ECR repository and GitHub OIDC roles that can deploy only from  main .
  1. Add its outputs as GitHub Actions variables:  AWS_ECR_PUBLISH_ROLE_ARN ,  AWS_CLOUDFORMATION_DEPLOY_ROLE_ARN ,  AWS_CLOUDFORMATION_EXECUTION_ROLE_ARN  and  AWS_REGION .
  1. Merge to  main . GitHub Actions runs the tests, builds the ARM64 images, and creates or updates the  weatherwise-prod  stack. No AWS access keys are stored.
To deploy manually instead, run:
aws cloudformation deploy \
--stack-name weatherwise-prod \
--template-file infra/cloudformation/weatherwise-service.yaml \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
ImageUri=ACCOUNT.dkr.ecr.REGION.amazonaws.com/weatherwise:COMMIT_SHA \
AgentRuntimeImageUri=ACCOUNT.dkr.ecr.REGION.amazonaws.com/weatherwise:agentcore-COMMIT_SHA \
ClimateAgentModelId=us.amazon.nova-pro-v1:0
To clean up, delete the stack with  aws cloudformation delete-stack --stack-name weatherwise-prod , then delete the publisher stack and the images in Amazon ECR. AgentCore and Amazon Bedrock charge only for use, so nothing else keeps running.

What we learned

Three lessons shaped the design:
  1. Give agents judgment, not the alarm switch. Whether there is danger is a question about numbers, and models can be confidently wrong about numbers. Code decides whether there is danger, and agents decide what it means for this person and what to do first. This makes every warning testable, and quiet days cost nothing.
  1. Check safety in code, not in the prompt. A prompt can only ask the model to include a helpline. A code check attached through Strands steering makes sure that it is there, and a pre-written message goes out if the model cannot fix a draft in two tries.
  1. Test against real disasters. Made-up test cases passed. Replaying real events with the forecasts of the time showed us where we were wrong, and what we will never catch.
Most of the problems we fixed were safety problems, and most of them appeared only when we tested against real events:
What went wrong
What we changed
On October 31, the app said "Safe to work today" while a cyclone was in the news. Our checks cannot see everything that forecasters see.
Official warnings now always appear first and are fetched separately, so they still show if our forecast fails. The app never tells anyone that they are safe.
Vijayawada's forecast never reached IMD's 115.6 mm "very heavy rain" level, so our first version never warned.
Rain that is unusual for that particular place now starts the flood guide.
An invented temperature in Marathi ("47 अंश", meaning 47 degrees) passed, because the checker only recognized °C and mm.
The checker now reads the unit words in every language file.
The tone check ran before every tool call and never saw the final reply.
It now checks only the final reply, which cut one answer from 10 model calls to 7.
On November 3, a live flood warning for Vijayawada said only "move to a sturdy building".
The Evaluator now requires "away from rivers" and "never cross flowing water" in every flood warning.
That new rule was never added to the writer's instructions, so no model's first flood draft passed.
We added the rule to the writer's skill.
The tone check's own wording, such as "Please stay calm", leaked into the warnings.
Those phrases are now blocked and counted in every run.
The model listed helplines for every hazard, or left out 112.
Code now chooses the helplines that match the message's hazard.
"Move livestock to higher ground" passed the landslide rule, which only looked for "high ground". A re-check found 7 such messages.
The rule is fixed, and every delivered message is now re-checked after each run. This stricter rule is the main reason why first-try passes are 83%.

Limits and next steps

What we miss. Our checks miss very local extreme rain (as in Wayanad), cyclones, and river floods caused by rain far upstream (as in Assam and Punjab). Official warnings cover these cases, and the app always shows them first. Our "danger" level for outdoor heat warns too often, and each forecast covers an area about 25 km wide. No district's shelter list has been verified yet, so the router gives the helpline and the nearest health facilities, marked unverified, and the Hindi and Marathi text still needs review by native speakers.
What's next.
  • WhatsApp and SMS delivery to subscribed households, using the delivery rules that the Graph already applies.
  • Shelter lists for every district, extracted from district disaster plans by an agent and approved by a person.
  • Landslide and cyclone checks, to close the gaps that our replays found.
  • Countries beyond India. A new country needs a country file in  rules/countries/  (helplines and the official alert source) and a language file, so the same design can serve farmers in Africa next.

Conclusion

WeatherWise shows that a team of Strands agents can take on real responsibility where safety matters, as long as each job sits in the right place. Agents understand questions, choose tools and write advice that people can act on. Code keeps the numbers honest and decides when to raise an alarm. AgentCore runs everything every morning, with no servers for us to manage. Replaying past disasters let us check that it works, and say plainly where it does not.
See this morning's warnings on the  live page , try the  app , or clone the  repository  and replay a past event anywhere in India.

Try it

Team: Prashant Mahajan (engineering and product) and Prince Birring (AWS and infrastructure). Claude Code wrote much of the agent code.





WeatherWise is not an official warning service. Always follow IMD and your local authorities. Weather data by  Open-Meteo.com  (CC BY 4.0).
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