Skip to main content
Loading navigation

Build an ONDC Grocery Sourcing and Delivery Agent with Mastra AI and Helicone

High grocery fulfillment costs and margin pressures frequently threaten e-commerce platforms across Indian regional logistics networks. Build an automated ONDC grocery routing agent using Mastra AI and Helicone to analyze merchant inventory signals, detect delivery anomalies, and keep fulfillment failure rates below two percent.

Business OperationsHosted by Vera

What you are building

Implement a TypeScript-based Mastra AI workflow monitored via Helicone observability to dynamic-route local ONDC grocery orders based on real-time SLA and inventory metrics.

How work is evaluated

Evaluation

Evaluates the Mastra AI agent on routing accuracy, latency limits, and Helicone logging compliance.

Datasets

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

How submissions are scored

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

valid_seller_selection

Ensures chosen seller has required stock and valid SLA.

Binary check

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

Dimension 2

routing_accuracy

Percentage of test cases where optimal seller was selected. • 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

  • Design Mastra AI workflows for dynamic local order routing on ONDC network protocols.

  • Integrate Helicone for real-time observability and cost tracing of multi-step agent decisions.

  • Implement automated failover mechanisms for high-latency or low-stock catalog providers.

Resources

Dataset notes

Simulated ONDC order feeds containing item list, delivery pincode, stock availability, and merchant network metadata.

Challenge setup

Evaluates the Mastra AI agent on routing accuracy, latency limits, and Helicone logging compliance.

Challenge input

JSON object with order details and array of available seller network nodes.

Mastra AI

TypeScript-native workflow and agent orchestration framework

Helicone

LLM monitoring and proxy tracing for latency and cost tracking

Evaluated output

JSON object with selected_seller_id, estimated_sla_minutes, and reasoning.

Evaluation checks
  • Ensures chosen seller has required stock and valid SLA.
  • Percentage of test cases where optimal seller was selected. • target: 0.95 • range: 0-1
Configured evaluation evidence
  • Benchmark: ONDC Logistics Benchmark v1
  • Routing Accuracy target: 0.95
  • 1 public reference case
Configured runtime
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

Action Space
  • Mastra AI · Optional
  • Anon · Optional
Observation
  • Helicone · Required
Orchestration
  • Mastra AI · Optional

Evaluation contract

  • valid_seller_selection · Weight 1
  • routing_accuracy · Weight 1

Metrics

  • routing_accuracy · Target 0.95

Benchmarks

  • ONDC Logistics Benchmark v1
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON object with order details and array of available seller network nodes.

    Output: JSON object with selected_seller_id, estimated_sla_minutes, and reasoning.

    Execution harness: JavaScript

Evaluation tools

  • Mastra AI · agent_framework
  • Helicone · observability

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build an ONDC Grocery Sourcing and Delivery Agent with Mastra AI and Helicone