Skip to main content
Challenge

European Heatwave Parametric Monitoring with Mastra AI and Sourcegraph Amp

As Europe faces extreme heat and wildfire risks, traditional insurance models are struggling to keep up. Parametric insurance, which pays out automatically based on weather triggers, is the solution. This challenge tasks you with building a 'Heat-Stress Parametric Workflow' using the Mastra AI framework (TypeScript). You will use Mastra's built-in tools and state management to monitor Copernicus climate data feeds and trigger payouts for agricultural policyholders when temperatures exceed defined thresholds for consecutive days. To ensure enterprise-grade reliability, you will use Sourcegraph Amp to manage the AI engineering lifecycle—auditing the agent's decision logic and ensuring the TypeScript workflow is robust against API failures. The system must use a RAG (Retrieval-Augmented Generation) component to explain to policyholders why a trigger was or wasn't met, using local weather station data as the 'ground truth'.

Machine LearningHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop a TypeScript-based parametric insurance agent using Mastra AI and Sourcegraph Amp to automate climate risk payouts in Europe.

Delivery guide

How work is evaluated

Evaluation

Evaluation is based on the correctness of the trigger activation logic and the quality of the generated explanation.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Threshold Logic

Payout must be true only if threshold is met for consecutive days

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Explanation Clarity

Similarity score to human-verified explanation • target: 0.9 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Build complex AI workflows in TypeScript using the Mastra AI framework

  • Orchestrate AI engineering tasks and code audits with Sourcegraph Amp

  • Integrate time-series weather APIs into an agentic toolset

  • Design an automated claims settlement engine with explainable evidence

Resources and assets

Reference links and supporting material

Dataset notes

Time-series climate data (Temperature max/min) for 10 European cities during the 2026 heatwave, including coordinate-specific wildfire risk indices.

Challenge setup

Evaluation is based on the correctness of the trigger activation logic and the quality of the generated explanation.

Challenge input

JSON array of daily max temperatures

Mastra AI

TypeScript framework optimized for workflows and state.

Sourcegraph Amp

Used for code intelligence and workflow auditing.

OpenAI o3

Used for deep reasoning on trigger conditions.

Evaluated output

JSON with 'payout_triggered' (bool) and 'explanation' (string)

Evaluation checks
  • Payout must be true only if threshold is met for consecutive days
  • Similarity score to human-verified explanation • target: 0.9 • range: 0-1
Configured evaluation evidence
  • Benchmark: ClimateIndex-Parametric-v1
  • Explanation Clarity target: 0.9
  • 1 public reference case
Configured runtime
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Sourcegraph Amp · Required
  • Mastra AI · Optional
  • AI21 Studio · Optional
Observation
  • Sourcegraph Amp · Required
Orchestration
  • Mastra AI · Optional

Evaluation contract

  • Threshold Logic · Weight 1
  • Explanation Clarity · Weight 1

Metrics

  • Explanation Clarity · Target 0.9

Benchmarks

  • ClimateIndex-Parametric-v1
  • energy

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON array of daily max temperatures

    Output: JSON with 'payout_triggered' (bool) and 'explanation' (string)

    Execution harness: JavaScript

Evaluation tools

  • Mastra AI · Agent Framework
  • Sourcegraph Amp · Engineering Tooling
  • OpenAI o3 · Logic Model

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about European Heatwave Parametric Monitoring with Mastra AI and Sourcegraph Amp