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'.
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.
How work is evaluated
Evaluation is based on the correctness of the trigger activation logic and the quality of the generated explanation.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
Threshold Logic
Payout must be true only if threshold is met for consecutive days
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Explanation Clarity
Similarity score to human-verified explanation • target: 0.9 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
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
Reference links and supporting material
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)
- Payout must be true only if threshold is met for consecutive days
- Similarity score to human-verified explanation • target: 0.9 • range: 0-1
- Benchmark: ClimateIndex-Parametric-v1
- Explanation Clarity target: 0.9
- 1 public reference case
- 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
- Sourcegraph Amp · Required
- Mastra AI · Optional
- AI21 Studio · Optional
- Sourcegraph Amp · Required
- 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
- 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.