Back to prompt library
Build a County Disaster Declaration Adaptation Prioritizer — implementation
Linked challenge: Build a County Disaster Declaration Adaptation Prioritizer
Prompt source
implementation69 lines11 sectionsNo variables1 code block
## Build
Aggregate county-level disaster declaration counts from OpenFEMA to prioritize regional adaptation grant proposals. Rank counties by administrative exposure to historical flood and severe storm events.
## User
Regional Resilience Grant Coordinator
## Workflow
1. Query the OpenFEMA API for county-level disaster declaration records spanning the past two decades.
2. Group administrative records by disaster incident type to identify dominant hazard categories per county.
3. Ingest county demographic housing metrics to weight the base disaster frequency.
4. Rank county-level adaptation intervention priorities and generate draft grant allocation worksheets for human review.
## Interface
Dashboard table with sortable county ranks, hazard tallies, and exportable CSV reports.
## Data
Query OpenFEMA endpoint `v2/DisasterDeclarationsSummaries` via REST API; test using bundled offline mock JSON responses.
Starter examples below are synthetic. They are not downloaded records.
## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Constructs OpenFEMA `$filter` queries with logical operators like `ge` on declarationDate and `$select` for specific fields.
## Tools
agno, requests, pandas.
Agno lightweight agents orchestrate data retrieval, statistical ranking, and narrative grant proposal drafting.
Local or hosted LLM with fast structured function calling capabilities.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Correctly filters declarations by start date using OpenFEMA date formatting.
- Ranks counties deterministically by historical incident frequency.
- Produces a prioritized adaptation report with justification notes for human review.
## Starter Examples
```json
[
{
"input": {
"county_id": "COUNTY-701",
"county_fema_counts": {
"Flood": 6,
"Severe Storm": 8
},
"residential_units": 120000
},
"expected_output": {
"county_id": "COUNTY-701",
"total_incidents": 14,
"priority_level": "TIER_1",
"recommended_grant": "FLOOD_MITIGATION_ASSISTANCE",
"record_type": "Simplified synthetic app record"
}
},
{
"input": {
"county_id": "COUNTY-702",
"county_fema_counts": {
"Flood": 0,
"Severe Storm": 1
},
"residential_units": 45000
},
"expected_output": {
"county_id": "COUNTY-702",
"total_incidents": 1,
"priority_level": "TIER_3",
"recommended_grant": "STANDARD_PREPAREDNESS",
"record_type": "Simplified synthetic app record"
}
}
]
```
## Safety
Produces planning prioritization scores for human review; carries no statutory authority over actual federal grant distribution.
Use mock external writes. Require human review before any real deployment.