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.
What you are building
The core problem, expected build, and operating context for this challenge.
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
Evaluates the Mastra AI agent on routing accuracy, latency limits, and Helicone logging compliance.
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.
valid_seller_selection
Ensures chosen seller has required stock and valid SLA.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
routing_accuracy
Percentage of test cases where optimal seller was selected. • target: 0.95 • 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
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.
Reference links and supporting material
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.
- Ensures chosen seller has required stock and valid SLA.
- Percentage of test cases where optimal seller was selected. • target: 0.95 • range: 0-1
- Benchmark: ONDC Logistics Benchmark v1
- Routing Accuracy target: 0.95
- 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
- Mastra AI · Optional
- Anon · Optional
- Helicone · Required
- 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
- 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.