Skip to main content
Loading navigation
Back to prompt library

Build an OpenFEMA Administrative Flood Declaration Scorer — implementation

Linked challenge: Build an OpenFEMA Administrative Flood Declaration Scorer

Prompt source

implementation83 lines11 sectionsNo variables1 code block
## Build
Correlate county-level OpenFEMA disaster declarations for inland flooding against croplands and agricultural soil maps. Track historical administrative declaration frequencies to construct targeted soil drainage and crop transition adaptation plans.

## User
Rural Agricultural Resilience Agent

## Workflow
1. Fetch OpenFEMA DisasterDeclarationsSummaries data using OData queries filtered for agricultural counties.
2. Calculate the historical count of administrative flood disaster declarations across specified periods.
3. Intersect declaration frequency scores with rural crop land cover classifications.
4. Generate regional adaptation action plans detailing cover cropping and retention pond allocations based on administrative declaration history.

## Interface
Vue.js dashboard featuring county administrative declaration counts, historical timeframe slider controls, and adaptation plans.

## Data
Use OpenFEMA REST endpoints with $filter, $select, and $format=json parameters to retrieve administrative declaration data.
Starter examples below are synthetic. They are not downloaded records.

## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Employ OpenFEMA $filter by incidentType and state, utilizing $select for field reduction of administrative records.

## Tools
crewai, httpx, pandas.
CrewAI coordinates specialized agents for administrative data extraction, agronomy analysis, and adaptation plan drafting.
Instruction-following LLM capable of multi-agent agricultural planning dialogue focused on administrative historical data.

## 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 builds OpenFEMA query with URL encoding and logical operators.
- Computes administrative declaration event counts accurately from year spans.
- Recommends specific soil mitigation measures for counties exceeding historical administrative declaration thresholds.

## Starter Examples
```json
[
  {
    "input": {
      "county_fips": "19153",
      "county_name": "Polk County, IA",
      "crop_type": "Corn/Soy",
      "declarations": [
        {
          "disasterNumber": 1763,
          "incidentType": "Flood"
        },
        {
          "disasterNumber": 1930,
          "incidentType": "Flood"
        },
        {
          "disasterNumber": 4421,
          "incidentType": "Flood"
        }
      ]
    },
    "expected_output": {
      "county_name": "Polk County, IA",
      "administrative_flood_count": 3,
      "adaptation_priority": "HIGH",
      "recommended_interventions": [
        "EXPAND_WETLAND_BUFFER_STRIPS",
        "TRANSITION_DEPRESSIONAL_ACRES_TO_FORAGE"
      ],
      "record_type": "simplified synthetic app records, not complete official schema files"
    }
  },
  {
    "input": {
      "county_fips": "19001",
      "county_name": "Adair County, IA",
      "crop_type": "Soybeans",
      "declarations": []
    },
    "expected_output": {
      "county_name": "Adair County, IA",
      "administrative_flood_count": 0,
      "adaptation_priority": "BASELINE",
      "recommended_interventions": [
        "MAINTAIN_STANDARD_TILLAGE_MANAGEMENT"
      ],
      "record_type": "simplified synthetic app records, not complete official schema files"
    }
  }
]
```

## Safety
Outputs are agronomic adaptation suggestions based purely on historical administrative records, not physical hazard recurrence probabilities.
Use mock external writes. Require human review before any real deployment.