Recipe catalog / loss-cause-kind
Identify the cause of loss in a claim narrative
loss-cause-kind is a Jev recipe from the jev-recipes TypeScript package. What cause of loss does narrative describe: weather, fire, water, theft, collision, wear and tear, vandalism, or something else? Use it when a claims intake or routing system needs to sort a free-form loss description into a cause-of-loss category so it can pick the right adjuster queue, forms, or follow-up questions.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use loss-cause-kind in TypeScript?
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { lossCauseKind } from 'jev-recipes/loss-cause-kind';
const result = await lossCauseKind({
"narrative": "We returned from a long weekend on Monday evening and found the back door forced open, with the frame splintered around the deadbolt. Two laptops, my wife's jewelry box, a camera bag, and the cash we kept in the desk drawer were gone. Drawers were pulled out in every bedroom. We called the police that night and have a report number; the neighbor's doorbell camera shows two people in the yard at around 3 am on Sunday.",
"minConfidence": 0.8
});
console.log(result);
What input does loss-cause-kind take?
| Field | Type | Needed |
|---|---|---|
| narrative | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"narrative": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"narrative"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"weather",
"fire",
"water",
"theft",
"collision",
"wear_and_tear",
"vandalism",
"other",
"unclear"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"weather",
"fire",
"water",
"theft",
"collision",
"wear_and_tear",
"vandalism",
"other",
"unclear"
]
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"required": [
"weather",
"fire",
"water",
"theft",
"collision",
"wear_and_tear",
"vandalism",
"other",
"unclear"
]
}
},
"required": [
"model",
"usage",
"status",
"verdict",
"confidence",
"probabilities"
],
"additionalProperties": false
}
}What does a loss-cause-kind result look like?
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo loss-cause-kind.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"verdict": "theft",
"confidence": 0.91,
"probabilities": {
"weather": 0.01,
"fire": 0,
"water": 0.01,
"theft": 0.91,
"collision": 0,
"wear_and_tear": 0,
"vandalism": 0.04,
"other": 0.01,
"unclear": 0.02
}
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.
Result
verdict is one of weather, fire, water, theft, collision, wear_and_tear, vandalism, other, unclear. unclear means the supplied facts do not establish a decision and always requires review.
A result is ready when confidence meets minConfidence and the verdict is not unclear. Inspect the verdict as well as the status: a ready result can name an outcome your application treats as negative. probabilities covers every verdict.
Reuse and calls
Uses the shared choice helper for the Jev call and response parsing. This folder owns its question, verdict criteria, and review policy. A live invocation makes one logical Jev request.
Limits
The verdict names the cause the claimant's wording describes; it does not investigate, verify, or reconstruct what actually happened, and it must not be used to decide coverage, apply exclusions, or assess fault. Chains of events resolve to the single initiating cause the narrative emphasizes, so a storm that caused a roof leak is weather, while a leak with no stated origin is water; if you need every contributing cause, extract them separately. Vehicle, property, and marine losses all pass through the same categories; the recipe does not know which line of business the claim belongs to unless the narrative makes it obvious.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo loss-cause-kind shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe loss-cause-kind to inspect the input and result schemas.
How accurate is loss-cause-kind?
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of loss-cause-kind?
- Names the cause the narrative describes, not the cause an investigation would establish, and makes no coverage or exclusion determination.
- Returns the primary cause only. Chains such as a storm that causes a flood resolve to the initiating cause the narrative emphasizes, or to unclear when the narrative gives no dominant cause.
Which recipes are related to loss-cause-kind?
- failure-kind: Use failure-kind to classify why a technical operation failed rather than what caused an insured loss.
- shipment-issue-kind: Use shipment-issue-kind for what went wrong with a delivery; this recipe classifies the peril behind a property or vehicle loss.