Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Buyer Grievance Triage and Return Dispatch Coordinator

Format
Code-aware
Lines
68
Sections
11
Linked challenge
Build a Buyer Grievance Triage and Return Dispatch Coordinator

Prompt source

Original prompt text with formatting preserved for inspection.

68 lines
11 sections
No variables
1 code block
## Build
Triage return disputes across mock decentralized buyer and seller applications. Classify photo evidence against return policies and construct standardized Beckn return handoff tickets.

## User
Consumer advocate resolution officer

## Workflow
1. Ingest buyer dispute filings including damage descriptions and synthetic courier delivery timestamps.
2. Extract defect categories and evaluate claims against standard return window limits.
3. Formulate structured issue manifests mapping complaint descriptions to Beckn post-fulfillment taxonomy.
4. Construct reverse logistics dispatch instructions for review before issuing carrier pickup notifications.

## Interface
Case management dispute dashboard displaying image inspection, return timeline meters, and issue resolution drafts.

## Data
Generate synthetic ONDC grievance tickets and Beckn post-fulfillment callback JSON files from documentation specifications.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Beckn protocol specifications](https://raw.githubusercontent.com/beckn/protocol-specifications/master/README.md)
Utilizes Beckn post-fulfillment specifications covering support, returns, and dispute routing schemas.

## Tools
langgraph, fastapi, pydantic.
Coordinates multi-step stateful dispute progression through buyer intake, evidence verification, and reverse logistics routing.
Hosted Claude API or local Llama 3 model for damage claim extraction.

## 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
- Categorize grievances into standard return codes based on buyer text and synthetic timestamps.
- Generate compliant Beckn context headers with action 'issue' or 'update'.
- Block return requests that exceed established policy return horizons.
- Require user review before finalizing the reverse logistics manifest.

## Starter Examples
```json
[
  {
    "input": {
      "order_id": "ORD-ONDC-8819",
      "delivered_at": "2025-05-10T10:00:00Z",
      "complaint_timestamp": "2025-05-11T14:30:00Z",
      "buyer_reason": "Sealed jar arrived broken with oil spilling everywhere",
      "claimed_category": "damaged_goods"
    },
    "expected_output": {
      "eligibility": "approved",
      "issue_category": "FULFILLMENT_DAMAGED",
      "beckn_action": "update",
      "reverse_dispatch_recommended": true,
      "review_flag": false
    }
  },
  {
    "input": {
      "order_id": "ORD-ONDC-3301",
      "delivered_at": "2025-04-01T10:00:00Z",
      "complaint_timestamp": "2025-05-11T14:30:00Z",
      "buyer_reason": "Color does not match my kitchen curtains",
      "claimed_category": "buyer_preference"
    },
    "expected_output": {
      "eligibility": "rejected",
      "issue_category": "RETURN_WINDOW_EXPIRED",
      "beckn_action": "issue_status",
      "reverse_dispatch_recommended": false,
      "review_flag": true
    }
  }
]
```

## Safety
Handles dispute routing in simulation mode without initiating bank chargebacks or actual reverse courier pickups.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.