jevrecipes

Recipe catalog / entity-match

Match records to one entity

entity-match is a Jev recipe from the jev-recipes TypeScript package. Do firstRecord and secondRecord describe the same real-world entity despite formatting, abbreviation, or partial fields? Use it when you need to decide whether two customer, vendor, product, or place records should be merged or linked.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use entity-match 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 { entityMatch } from 'jev-recipes/entity-match';

const result = await entityMatch({
  "firstRecord": "{\"name\":\"Acme Corp.\",\"city\":\"Portland, OR\",\"phone\":\"(503) 555-0147\",\"website\":\"acme.example\"}",
  "secondRecord": "ACME Corporation, 1200 SW Main St, Portland Oregon 97204. Tel 503-555-0147.",
  "context": "Both records come from vendor onboarding forms filled in by hand.",
  "minConfidence": 0.8
});
console.log(result);

What input does entity-match take?

FieldTypeNeeded
firstRecordstringRequired
secondRecordstringRequired
contextstringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "firstRecord": {
        "type": "string"
      },
      "secondRecord": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "firstRecord",
      "secondRecord"
    ]
  },
  "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"
        ]
      },
      "probability": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "verdict": {
        "type": "string",
        "enum": [
          "same",
          "different"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "probability",
      "confidence",
      "verdict"
    ],
    "additionalProperties": false
  }
}

What does a entity-match 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 entity-match.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "probability": 0.94,
  "confidence": 0.94,
  "verdict": "same"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. Each record is a string; pass free text or the output of JSON.stringify for a structured record. context is optional and is omitted from the request when absent.

Result

verdict is same when Jev's yes probability is at least 0.5 and different otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields different with 0.9 confidence.

A result is ready when confidence meets minConfidence. Otherwise it is review. Treat a review result as unknown and keep the records separate until a person or a stricter rule decides.

Reuse and calls

Uses the shared gate helper, a single yes/no question. This folder owns the question wording, the outcome descriptions, and the review policy. A live invocation makes one logical Jev request.

Limits

The recipe compares the two records as supplied. It does not look either record up, check that its fields are accurate, or know your business definition of a duplicate. Records that share a name but conflict on a distinguishing detail grade different; records where one side simply has fewer fields can still grade same. Deciding which record survives a merge and how fields are combined belongs in application code.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo entity-match shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe entity-match to inspect the input and result schemas.

How accurate is entity-match?

Current synthetic measurement

jev-1.13.0 / 2026-10-04 / 60 development cases

Scoring revision 2.

87%All-case accuracy
15Sent for review
0Failed calls / cases

45 ready decisions, with 100% accuracy among those decisions.

95% case-level interval: 76% to 93%. Related synthetic cases are correlated.

This measures the recorded dataset, not general readiness. Label sources: author-synthetic: AI-authored synthetic boundary cases for jev-recipes; labels have not had independent human review.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of entity-match?