Skip to main content
Challenge

Build an ONDC Dispute Triage Engine with Vercel AI SDK and OpenRouter

In light of over 5.1 lakh e-commerce complaints registered in India, public delivery networks like the Open Network for Digital Commerce (ONDC) require automated, multilingual, and policy-compliant dispute resolution systems. This challenge requires building a real-time e-commerce dispute triage engine using Vercel AI SDK and OpenRouter API, designed to process citizen complaints across multiple Indian languages, parse logistics and transaction telemetry, and generate structured resolution recommendations.

Business OperationsHosted by Vera
Challenge brief

What you are building

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

Build an AI SDK-powered multi-lingual dispute triage pipeline utilizing OpenRouter model switching to automatically analyze ONDC e-commerce customer claims.

Delivery guide

How work is evaluated

Evaluation

Evaluates the triage engine's accuracy in classifying complaint severity, extracting transaction IDs, and outputting standardized JSON schema recommendations.

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

schema_validation

Output must strictly conform to required JSON schema without missing properties.

Binary check

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

Dimension 2

classification_accuracy

Accuracy of grievance_category classification • target: 0.95 • 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

  • Implement structured output streaming using Vercel AI SDK and TypeScript.

  • Configure multi-model routing via OpenRouter to dynamically select LLMs based on language and complexity.

  • Integrate automated fraud detection and refund eligibility scoring against ONDC protocol specifications.

  • Validate JSON schema compliance for dispute triage outputs under strict runtime bounds.

Resources and assets

Reference links and supporting material

Dataset notes

Synthetic dataset of 500 multilingual e-commerce dispute records formatted according to ONDC payload structures, including buyer complaints in Hindi, Tamil, Telugu, and English.

Challenge setup

Evaluates the triage engine's accuracy in classifying complaint severity, extracting transaction IDs, and outputting standardized JSON schema recommendations.

Challenge input

JSON object containing multilingual complaint text and transaction metadata

Vercel AI SDK

Used for structured outputs and model invocation.

OpenRouter

Provides unified access to multi-LLM routing.

Evaluated output

Validated JSON object adhering to OndcTriageResult schema

Evaluation checks
  • Output must strictly conform to required JSON schema without missing properties.
  • Accuracy of grievance_category classification • target: 0.95 • range: 0-1
Configured evaluation evidence
  • Benchmark: DPI-Bench-Ecom-Disputes
  • Classification Accuracy target: 0.95
  • 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
  • Vercel AI SDK · Optional
  • Anon · Optional
Policy Serving
  • OpenRouter · Required
Orchestration
  • OpenRouter · Required
  • Vercel AI SDK · Optional

Evaluation contract

  • schema_validation · Weight 1
  • classification_accuracy · Weight 1

Metrics

  • classification_accuracy · Target 0.95

Benchmarks

  • DPI-Bench-Ecom-Disputes
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON object containing multilingual complaint text and transaction metadata

    Output: Validated JSON object adhering to OndcTriageResult schema

    Execution harness: JavaScript

Evaluation tools

  • Vercel AI SDK · Agent Framework
  • OpenRouter · AI Gateway / Model Provider

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build an ONDC Dispute Triage Engine with Vercel AI SDK and OpenRouter