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 a STAC Agricultural Drought Biomass Loss Indexer

Format
Code-aware
Lines
105
Sections
11
Linked challenge
Build a STAC Agricultural Drought Biomass Loss Indexer

Prompt source

Original prompt text with formatting preserved for inspection.

105 lines
11 sections
No variables
1 code block
## Build
Process agricultural STAC Item asset references alongside simplified synthetic app records for crop stress to streamline claim preparation. Evaluate parcel-level vegetation anomaly flags against regional drought periods.

## User
Agricultural Claims Specialist

## Workflow
1. Query public STAC Item catalogs over farm bounding boxes across the growing season.
2. Extract multispectral asset references and ingest simplified synthetic app records containing normalized vegetation anomaly values for the parcels.
3. Correlate biomass deficit time series against regional drought emergency records.
4. Generate a structured crop loss assessment dossier for agronomist review.

## Interface
Streamlit parcel search console displaying satellite asset links, vegetation degradation curves, and drought period markers.

## Data
Use public Earth Search STAC API endpoints and local JSON files acting as simplified synthetic app records for parcel polygons and NDVI values.
Starter examples below are synthetic. They are not downloaded records.

## Source
[STAC specification](https://raw.githubusercontent.com/radiantearth/stac-spec/master/README.md)
Extract STAC Item assets, bbox boundaries, and datetime properties defined in STAC Item specification.

## Tools
llamaindex, shapely, fastapi, pandas.
LlamaIndex indexes temporal metadata and asset links from parsed STAC Items and synthetic crop stress records for fast retrieval.
Hosted LLM with tool calling for structured claim dossier generation and evidence compilation.

## 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
- STAC Item geometry overlaps parcel boundaries exactly.
- Computes vegetation deficit percentile relative to baseline within 5% tolerance using ingested synthetic records.
- Outputs structured JSON dossier with asset URIs and anomaly flags.

## Starter Examples
```json
[
  {
    "input": {
      "parcel_id": "PARCEL-IA-882",
      "bbox": [
        -93.5,
        41.5,
        -93.4,
        41.6
      ],
      "stac_items": [
        {
          "id": "S2A_20230715",
          "properties": {
            "datetime": "2023-07-15T10:30:00Z",
            "eo:cloud_cover": 2.1
          },
          "assets": {
            "ndvi": {
              "href": "https://storage.example.org/ndvi_20230715.tif"
            }
          }
        }
      ],
      "baseline_ndvi": 0.78,
      "observed_ndvi": 0.42
    },
    "expected_output": {
      "parcel_id": "PARCEL-IA-882",
      "anomaly_ratio": -0.46,
      "drought_stress_detected": true,
      "evidence_item_ids": [
        "S2A_20230715"
      ],
      "dossier_status": "READY_FOR_ADJUSTER"
    }
  },
  {
    "input": {
      "parcel_id": "PARCEL-NE-104",
      "bbox": [
        -98.1,
        40.8,
        -98,
        40.9
      ],
      "stac_items": [
        {
          "id": "S2B_20230801",
          "properties": {
            "datetime": "2023-08-01T10:30:00Z",
            "eo:cloud_cover": 85
          },
          "assets": {
            "visual": {
              "href": "https://storage.example.org/rgb_cloudy.tif"
            }
          }
        }
      ],
      "baseline_ndvi": 0.72,
      "observed_ndvi": null
    },
    "expected_output": {
      "parcel_id": "PARCEL-NE-104",
      "anomaly_ratio": null,
      "drought_stress_detected": false,
      "evidence_item_ids": [],
      "dossier_status": "INSUFFICIENT_CLEAR_SCENES"
    }
  }
]
```

## Safety
Emphasizes that crop biomass indices serve as claim evidence preparation rather than automatic adjustment.
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.