Back to prompt library
Build a Last-Mile Delivery Accessibility and Routing Dispatcher — implementation
Linked challenge: Build a Last-Mile Delivery Accessibility and Routing Dispatcher
Prompt source
implementation77 lines11 sectionsNo variables1 code block
## Build
Coordinate mock logistics providers across Beckn final-mile fulfillment contracts. Evaluate accessibility parameters such as staircase-only access and landmark-based routing for local couriers.
## User
Logistics Dispatch Coordinator
## Workflow
1. Receive fulfillment search requests with customer physical access indicators and drop coordinates.
2. Query mock Beckn final-mile delivery providers for vehicle-type compatibility and serviceability.
3. Rank quotes against accessibility tags including ground-floor preference and vernacular voice navigation.
4. Dispatch simulated on_init and on_confirm fulfillment allocations.
## Interface
Dispatch console displaying pending delivery routes, accessibility tags, and provider bid comparison panels.
## Data
Construct mock provider JSON files implementing Beckn final-mile delivery schema v0.8.2.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Beckn protocol specifications](https://raw.githubusercontent.com/beckn/protocol-specifications/master/README.md)
Leverages Beckn final-mile delivery specification concepts for fulfillment routing and message context.
## Tools
langgraph, fastapi, httpx.
Manages asynchronous state transitions between search, quote, and confirm fulfillment stages.
Fast reasoning API or local model capable of multi-step criteria filtering.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Evaluates provider capability against specific delivery accessibility constraints.
- Emits valid Beckn fulfillment context and transaction headers.
- Simulates asynchronous callback handling with mock ACK and on_search cycles.
- Generates actionable delivery manifests containing localized landmark instructions.
## Starter Examples
```json
[
{
"input": {
"order_id": "ORD-5541",
"drop_location": {
"lat": 12.9716,
"lng": 77.5946,
"accessibility_notes": "Wheelchair accessible ramp at gate 2"
},
"package": {
"weight_kg": 2.5,
"perishable": false
}
},
"expected_output": {
"selected_provider": "BPP-LOG-01",
"fulfillment_id": "FUL-9901",
"vehicle_type": "TWO_WHEELER",
"allocated_instructions": "Enter via Gate 2 ramp; leave at reception counter.",
"status": "DISPATCH_CONFIRMED"
}
},
{
"input": {
"order_id": "ORD-5542",
"drop_location": {
"lat": 12.975,
"lng": 77.599,
"accessibility_notes": "Floor 4, no elevator, heavy cargo"
},
"package": {
"weight_kg": 35,
"perishable": false
}
},
"expected_output": {
"selected_provider": null,
"fulfillment_id": null,
"status": "UNSERVICEABLE_CAPACITY_LIMIT",
"error_reason": "Cargo exceeds two-person carry limit for non-elevator delivery"
}
}
]
```
## Safety
Operates entirely within mock delivery networks; coordinates simulated vehicle dispatches without live GPS tracking.
Use mock external writes. Require human review before any real deployment.