Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build an OpenFEMA Agricultural Flood Declaration Tracker

Format
Code-aware
Lines
67
Sections
11
Linked challenge
Build an OpenFEMA Agricultural Flood Declaration Tracker

Prompt source

Original prompt text with formatting preserved for inspection.

67 lines
11 sections
No variables
1 code block
## Build
Track repetitive agricultural disaster declarations across farming counties using OpenFEMA historical endpoints. Identify chronically vulnerable cropland and formulate structured soil drainage adaptation plans.

## User
Agricultural Extension Risk Officer

## Workflow
1. Poll OpenFEMA DisasterDeclarationsSummaries filtered by incidentType Flood and designated area.
2. Map declarations to regional USDA agricultural soil classification zones.
3. Compute repeat flood return rates across multi-decade farming histories.
4. Draft tailored agricultural drainage and crop diversification adaptation recommendations.

## Interface
Web dashboard with county-level agricultural flood recurrence graphs, soil type overlays, and printable adaptation briefs.

## Data
Access OpenFEMA API via HTTP queries using $filter and $select parameters. Cache sample county disaster declarations locally.
Starter examples below are synthetic. They are not downloaded records.

## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Utilizes OpenFEMA API URI parameters $select, $filter=incidentType eq 'Flood', and $orderby=declarationDate.

## Tools
haystack, requests, pydantic.
Constructs document processing pipelines that integrate tabular disaster statistics into retrieval-augmented adaptation briefs.
Local or hosted LLM compatible with Haystack OpenAIChatGenerator or HuggingFace pipelines.

## 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
- Executes OpenFEMA queries with compliant ISO-8601 date filters.
- Aggregates flood disaster frequencies per agricultural county.
- Synthesizes soil drainage adaptation proposals matching local crop conditions.

## Starter Examples
```json
[
  {
    "input": {
      "county_fips": "19001",
      "state": "IA",
      "crop_type": "Corn",
      "flood_declarations_count": 5,
      "soil_drainage_class": "POORLY_DRAINED"
    },
    "expected_output": {
      "county_fips": "19001",
      "recurrence_tier": "HIGH_FREQUENCY",
      "drainage_intervention_required": true,
      "recommended_practice": "PATTERN_TILE_DRAINAGE_AND_COVER_CROPS",
      "adaptation_readiness_score": 0.88
    }
  },
  {
    "input": {
      "county_fips": "19003",
      "state": "IA",
      "crop_type": "Soybeans",
      "flood_declarations_count": 0,
      "soil_drainage_class": "WELL_DRAINED"
    },
    "expected_output": {
      "county_fips": "19003",
      "recurrence_tier": "LOW_FREQUENCY",
      "drainage_intervention_required": false,
      "recommended_practice": "STANDARD_CONSERVATION_TILLAGE",
      "adaptation_readiness_score": 0.22
    }
  }
]
```

## Safety
Supplies advisory agronomic recommendations; does not furnish engineering warranties for drainage installations.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.