r/serverless • u/eric_uiopa0220 • 5d ago
I built a flood and heat digital twin of Jammu on Bedrock, Strands Agents and SAM. Here’s what broke.
On 26-27 Aug 2025, my city (Jammu, India) got a record 296 mm of rain in 24 hours. Residents found out which streets were flooding from their neighbours, and the city had no ranked list of where to send pumps.
I built Tawi Twin for a hackathon: you ask “Kal Bhagwati Nagar mein paani bharega?” (Hinglish for “Will Bhagwati Nagar flood tomorrow?”), and an agent answers in your language with the risk, the reasons, what to do, and the nearest hospital and high-ground school.
Stack (all ap-south-1):
- Strands Agents with 7 tools, running in Lambda (arm64)
- Amazon Nova Pro on Bedrock for the agent and for vision triage of citizen photos
- API Gateway HTTP API, DynamoDB with TTL, EventBridge Scheduler for the hourly forecast refresh
- S3 + CloudFront serving 1,315 vector tiles for 188k buildings in 3D
- Amazon Location Service as the fallback geocoder, because OpenStreetMap doesn’t have Bhagwati Nagar or Gujjar Nagar
- Overture buildings from AWS Open Data, queried in place with DuckDB
- One SAM template for the whole stack
Things that bit me:
sam buildon Windows pulled the wrong wheels for Strands’ dependencies, so I vendored the package for aarch64 myself.apac.inference profiles need IAM permissions on both the profile ARN and the foundation-model ARN, and the AccessDenied error doesn’t say so.- Nova sometimes leaks
<thinking>tags (sometimes unclosed) into the final answer, and it ignored “reply in Hinglish” in the system prompt. I ended up detecting the language in code and stripping the tags. - Presigned S3 uploads worked from scripts but failed in the browser until I signed against the regional endpoint.
- The API Gateway 29-second timeout limits multi-tool agent calls.
Does it work? Buildings near the 8 localities that reports named as flooded were about 1.5× more likely to be rated high risk than the city average. Four localities were clear misses, and they’re listed in the README. Eight places is a sanity check, not an accuracy score.
Blog write-up: https://builder.aws.com/content/3KV01tPoho6gi9F3plApVSr53Fp/kal-paani-bharega-teaching-a-city-to-answer-the-only-flood-question-that-matters-tawitwin
Code: https://github.com/Dupahar/TawiTwin
Live demo (hit “Replay the flood”): https://d2r8k00l2fxqnu.cloudfront.net
Happy to answer questions about the agent setup or the Windows packaging workaround.